EasyManua.ls Logo

USR IOT USR-TCP232-302 User Manual

USR IOT USR-TCP232-302
53 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #50 background image
USR-TCP232-302 User Manual h.usriot.com
Jinan USR IOT Technology Limited www.usriot.com
50
/ 53
72. ptr += retlen;
73. }
74. //receive data
75. recvlen = 0;
76. retlen = 0;
77. ptr = recvbuf;
78. leftlen = RECV_BUF_SIZE -1;
79. //do
80. {
81. retlen = recv(app_sock, ptr, leftlen, 0) ;
82. if(retlen < 0)
83. {
84. if(errno == EINTR)
85. retlen = 0;
86. else
87. exit(1);
88. }
89. recvlen += retlen;
90. leftlen -= retlen;
91. ptr += retlen;
92. }
93. //while(recvlen && leftlen);
94. printf("receive data is : %s", recvbuf);
95. close(app_sock);
96. }
97. close(listen_sock);
98.
99. return 0;
100. }
Client Socket code:
1. #include <stdio.h>
2. #include <string.h>
3. #include <sys/socket.h>
4. #include <netinet/in.h>
5. #include <syslog.h>
6. #include <errno.h>
7. #include <stdlib.h>
8. #define MAX_LISTEN_NUM 5
9. #define SEND_BUF_SIZE 100
10. #define RECV_BUF_SIZE 100
11. #define SERVER_PORT 1010
12. int main()
13. { int sock_fd = 0;

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the USR IOT USR-TCP232-302 and is the answer not in the manual?

USR IOT USR-TCP232-302 Specifications

General IconGeneral
ModelUSR-TCP232-302
TypeSerial to Ethernet Converter
Serial Port1 x RS232
Power Supply5V DC
RS232 ConnectorDB9
Network Interface1 x Ethernet
Ethernet Port1 x RJ45
Operating Temperature-20°C to 70°C
Storage Temperature-40°C to 85°C
Humidity5% ~ 95% (non-condensing)
ConfigurationWeb-based configuration
Basic FunctionBi-directional transparent transmission between RS232 and Ethernet

Summary

Quick Start

Hardware Testing Environment

Setup and components needed for testing the TCP232-302 conversion function.

Connection

Steps for physically connecting the device and computer for initial setup and testing.

Default Parameter

Lists the default configuration parameters like IP, username, and port for the TCP232-302.

Data Transmission Testing

Procedure for verifying data transmission using network communication setup.

Overview

Features

Lists the key functionalities and capabilities of the TCP232-302 module, including work modes and protocols.

Module Function

Work Mode

Explains the different operational modes like TCP Client, TCP Server, UDP, and HTTPD.

TCP Server Mode

Details the module's operation as a TCP server, accepting multiple client connections.

DHCP and DNS Function

Covers automatic IP assignment via DHCP and domain name resolution via DNS.

VCOM

Explains the use of virtual COM port software for remote serial communication.

Special Function

Introduces special operational features such as factory reset and link status indication.

Additional Function

Covers supplementary functionalities like IP display, MAC address, and DNS settings.

Firmware Upgrade

Provides instructions and steps for upgrading the module's firmware.

Configuration Protocol

Outlines the protocol used for configuring the device across network segments.

Serial port setting protocol

Details commands and procedures for entering serial port setting mode.

Similar T24 series setting protocol

Covers network command formats for T24 series compatible settings.

UART Framing mechanism

Explains the UART framing and packing methods used by the module for data transmission.

Parameter Setting

Webpage Setting

Guides on configuring module parameters via its web interface for various settings.

Local IP

Covers setting the static IP address, subnet mask, and gateway for network configuration.

Serial Port

Details the configurable serial port parameters like baud rate, data bits, parity, and stop bits.

Software Setting

Guides on using the dedicated software for device search and parameter configuration.

Appendix

Meaning of Port parameter bit

Explains the meaning of various bits within the port parameter settings for configuration.

Upper computer Socket programming example

Provides C code examples for server and client socket programming for integration.

Contact Information

Disclaimer

Undated History

Related product manuals