CDMA wireless terminal TCP / IP protocol

CDMA is a rising star in the field of wireless communications. It uses frequency division coding technology and has obvious advantages compared with GSM based on time division multiplexing. CDMA can achieve a smooth transition from the existing communication system to the next generation communication system, with strong functional scalability; can support advanced antenna technology, reduce the number of base stations by increasing the cell coverage; all bandwidth channels can support high-speed data services ; The network frequency utilization rate is high, and the design, construction and expansion are relatively simple.
The CDMA wireless terminal embedded with TCP / IP protocol achieves the purpose of data transmission through the CDMA network and the Internet, and is suitable for the development of products based on wireless applications, such as monitoring, scheduling, vehicle, remote control, remote measurement, positioning, and navigation. These systems can be automatically attached to the CDMA network when they are powered on, and communicate with the data center in real time online for high-speed data transmission, high reliability, and good application prospects. The CDMA wireless communication module proposed in this article provides AT commands of TCP / IP protocol interface, combined with the command control module, it is applicable to the case where the host does not have TCP / TP protocol but uses serial communication (such as single chip microcomputer data acquisition and transmission system).

1 CDMA wireless terminal TCP / IP protocol implementation
The essence of the Internet is to realize the interconnection of heterogeneous networks. It makes full use of the data transmission capabilities of various communication subnets, and inserts new protocol software between communication modules and applications that depend on the communication subnet to ensure the Interoperability. The Internet protocol family is called "TCP / IP protocol family", which contains a large number of protocols, such as application layer protocol, transport layer TCP, UDP protocol, network layer IP, ARP, ICMP protocol and data link layer protocol, etc. . The wireless network is integrated with the Internet, and the information packet is seamlessly transmitted to the network based on the IP protocol through the wireless medium. Before transmission, the data packet must be encapsulated according to the TCP / IP protocol. IP protocol is also adopted for transmission in CDMA network. The TCP / IP protocol structure in the CDMA system is the data link layer (including the interface layer and the link layer), the network layer, and the transmission and application layer from bottom to top.

1.1 Principles of the data link layer
The data link layer in the CDMA system is special, involving the link and control of the wireless link. The link layer is composed of RLP and PPP, and the transfer of data services is mainly completed by the radio link protocol (RLP). The RLP sublayer is an important interface between the upper layer application and the bottom layer physical connection, and is located above the multiplexing sublayer of the MAC layer. Its main role is to use the forward and reverse channels of the physical layer to provide bitstream-oriented transmission for upper-layer applications, without considering the specific frame format of the upper-layer applications, and forming RLP frames according to the requirements of the multiplexing sublayer. The core idea of ​​quality assurance measures in the RLP sublayer is a best-effort delivery mechanism (Best Effort Delivery), that is, the RLP sublayer ensures the correct transmission of data as much as possible according to the parameters specified in the protocol.

PPP includes the method of encapsulating datagrams on serial links; LCP protocol (Link contr01 Protocol) for establishing, configuring, and testing data link links; IPCP protocol (IP Control Protocol) for establishing and configuring network layer protocols; authentication protocol PAP / CHAP. In order to establish communication on a point-to-point link, one end of the PPP link must first send LCP packets to configure the data link during the establishment phase. After the link is established, before entering the network layer protocol, PPP provides an optional authentication phase. By default, authentication is not mandatory. If link authentication is desired, the implementer must specify the authentication protocol configuration options during the establishment phase.

1.2 The application layer realizes the traditional network programming calls the Socket API function to connect the lower layer transmission protocol. Commonly used network programming interfaces include BSD (Berkeley Software Distributlon) Sockets and Winsock TM. To support network applications, the CDMA system itself provides complete Socket API functions. The process of establishing a TCP connection is shown in Figure 1.



The application calls the dss_open_netlib () function to open the network library, put the data service state machine into Socket mode, and define the network callback function and Socket callback function at the same time, and return the application ID number. The application knows whether the low-level network is available through the network callback function, and the Socket callback function describes the Socket event.

The application program calls the dss_pppopen () function to establish the network subsystem, including the establishment and connection of the transmission channel. After the network subsystem is established, the network callback function informs the application that the current network is available.

One step is omitted in Figure 1, that is, after the low-level protocol is established, the dss_socket () function is called to create a new socket for network communication. Return a descriptor representing this socket; at the same time, initialize the SCB (SocketControl Block) and related data structures, specify the address family (AF_INET), Socket type (sock stream-TCP sockets) and protocol type (IPPROTO_TCP) used by the protocol.

At this point, dss_connect () is called to establish an active connection with the remote server. The function immediately returns DS_EWOULDBLOCK, indicating that the operation needs to be suspended. The application sets the corresponding bits of the SCB through the dss_async_select () function, specifies the current pending event (such as DS_WRITE_EVENT), to support the non-blocking function call of the Socket library, and timely notification of asynchronous events. The application knows that the asynchronous event occurs, and immediately calls the dss_getnextevent () function to check what kind of event occurred and clears the corresponding bit in the SCB queue.
Using the CDMA 800 MHz standard wireless module HT6025-A launched by Huntel Technologies, the network application layer program is developed based on the Socket API function provided by the CDMA operating system itself, and the AT command support of the TCP / IP protocol of the CDMA wireless module is realized. Users only need to input / output the corresponding AT command through the module serial port to realize the call of TCP / IP protocol to achieve the purpose of connecting to the Internet. The system uses packet data services (Packet Data Setvice) supported by the CDMA system for data transmission. The packet data service fully shares the wireless channel, and uses IP Over PPP to achieve high-speed and remote access to the data terminal. Data is charged for data and the transmission rate can reach 14.4 kbps. It is the best choice for sending and receiving random burst data. Figure 2 is a functional diagram of the internal task call and software structure of the CDMA module.


â—‡ SIO: Serial input / output.
â—‡ Call Mgmt: Other call processing and user interface.
â—‡ TX: CDMA data transmission.
â—‡ RX: CDMA data reception.
â—‡ DS: data service control, data mode control and AT command execution task block.
â—‡ PS: Protocol service task block (EIA-617 / TCP / IP / PPP).

The user enters AT commands through the serial port, such as AT $ TCPOPEN = ip, pott (used to initiate a TCP connection), and the DS task block processes the commands, including command parsing, queue waiting, looking up the AT command table, function execution, and response return . The function execution in the DS task block will call the PS task block to truly realize link connection, data packaging, routing and reliable transmission.

2 Test and application Connect the CDMA wireless module to the PC through the serial port, run the serial port debugging program on the PC, send AT commands to the module, establish a connection with the server IP address given by Unicom, apply its test port, send data and receive echo data.

Test commands include: set TCP / IP user account AT $ TCPUID = account; set TCP / IP user password AT $ TCP-PASSWD = password; TCP / IP dial ATD = dial; establish TCP / IP connection AT $ TCPOPEN = ip, port ; Send data AT $ TCPDATA = data (allowing to send up to 512 characters at a time); close TCP / IP Socket AT $ TCPCLOSE; exit TCP / IP application AT $ TCPEXIT. Each command returns to normal, the data is sent and received correctly, and there is a continuous line when there is data traffic. After a certain time without data traffic, the network closes the connection. The data transmission and reception test results are shown in Figure 3.



On the basis of this realization, a set of data acquisition and transmission system was designed and developed to confirm its reliability. The application system is made up of single chip microcomputer, CDMA wireless module, power supply part and external interface part, as shown in Fig. 4.

The power supply part provides suitable power for the microcontroller and the CDMA module. The external interface part includes antenna interface and UIM (User IdenTIty Module) card connector interface.

The single chip microcomputer realizes the functions of data acquisition, formatting, CDMA wireless module initialization, sending AT commands to establish a TCP connection and sending data. The single chip microcomputer provides a variety of sensor interfaces, such as TTL level serial port, RS232 standard serial port and multiple analog input channels with custom input voltage range, which can be connected to various types of analog or digital sensors. Considering the low power consumption requirements of mobile devices, TI's MSP430 microcontroller is used. MSP430 MCU is a kind of Flash ultra-low power single-chip microcomputer with excellent performance. It is easy to program and debug. The working voltage is 3.3V. It supports ultra-low power working mode and is very suitable for being placed in the wild. Its built-in multi-channel A / D conversion module provides a convenient analog sensor interface; the built-in two-channel UART module provides a digital sensor interface. MSP430 is directly connected to the CDMA wireless module through UART1 to realize the initialization and data sending and receiving functions of the CDMA wireless module; at the same time, UART2 extends the MAX232 standard serial port to exchange data with other embedded systems or PCs.

The CDMA wireless module wirelessly transmits data to the base station through the CDMA network. The interworking function unit IWF (Inter Working FuncTIon) of the base station completes the interworking of the wireless data service and the IP access network, and realizes the interrlet access of the sensor data. The server on the other end of the Internet receives the data and can process the physical quantities from the sensors, such as data analysis, data fusion, process judgment, and data display.

Conclusion The intersection of the Internet and mobile communications has shown strong vitality and has become a hotspot in today's global information industry. It will trigger tremendous changes in people's work and life, and has broad development prospects. This article completes the Socket programming of the TCP / IP application layer of the CDMA wireless terminal, realizes the Internet access of the CDMA mobile terminal, gives the actual application system principle and implementation method, and other applications of the CDMA wireless terminal with the embedded TCP / IP protocol Have important reference value.

Lithium-ion Battery

Lithium Storage Battery,Lithium Ion Battery,Lithium Battery,Electric Car Lithium Battery

Henan Xintaihang Power Source Co.,Ltd , https://www.taihangbattery.com