SPNA248 March 2021 TM4C1292NCPDT , TM4C1292NCPDT , TM4C1292NCZAD , TM4C1292NCZAD , TM4C1294KCPDT , TM4C1294KCPDT , TM4C1294NCPDT , TM4C1294NCPDT , TM4C1294NCZAD , TM4C1294NCZAD , TM4C1299KCZAD , TM4C1299KCZAD , TM4C1299NCZAD , TM4C1299NCZAD , TM4C129DNCPDT , TM4C129DNCPDT , TM4C129DNCZAD , TM4C129DNCZAD , TM4C129EKCPDT , TM4C129EKCPDT , TM4C129ENCPDT , TM4C129ENCPDT , TM4C129ENCZAD , TM4C129ENCZAD , TM4C129LNCZAD , TM4C129LNCZAD , TM4C129XKCZAD , TM4C129XKCZAD , TM4C129XNCZAD , TM4C129XNCZAD
Table 1-1 lists the typical lwIP Raw TCP APIs to be used in an application. Figure 1-1 shows a simplified flowchart of the TCP client-server communication using Raw APIs.
Function Category | API | Description |
---|---|---|
TCP connection | tcp_new | Create a new TCP PCB (Protocol Control Block). |
tcp_bind | Bind the PCB to local IP address and port. The IP address can be specified as IP_ADDR_ANY in order to bind the connection to all local IP addresses. | |
tcp_listen | Make PCB listen for incoming connections. | |
tcp_accept | Set callback used for new incoming connections. When an incoming connection is accepted, the callback function specified with the tcp_accept() will be called. | |
tcp_connect | Open connection to remote host. This function will return immediately and call the callback function specified in the fourth argument. | |
Receiving TCP data | tcp_recv | Set the callback function that will be called when new data arrives. |
tcp_recved | This function must be called when the application has received the data. | |
Sending TCP data | tcp_write | Enqueue data for transmission |
tcp_sent | Specifies the callback function that should be called when data has successfully been received (i.e. acknowledged) by the remote host. | |
tcp_output | Force all enqueued data to be sent now. | |
Application poll | tcp_poll | Set application poll callback. When a connection is idle, lwIP will repeatedly poll the application by calling the specified callback function. |
Closing connection and error handlings | tcp_close | Close the TCP connection. |
tcp_err | Set the callback function to call on connection errors. | |
tcp_abort | Abort the connection. |