MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / netconn_apimsg

Function netconn_apimsg

components/net/lwip/lwip-2.1.2/src/api/api_lib.c:117–136  ·  view source on GitHub ↗

* Call the lower part of a netconn_* function * This function is then running in the thread context * of tcpip_thread and has exclusive access to lwIP core code. * * @param fn function to call * @param apimsg a struct containing the function to call and its parameters * @return ERR_OK if the function was called, another err_t if not */

Source from the content-addressed store, hash-verified

115 * @return ERR_OK if the function was called, another err_t if not
116 */
117static err_t
118netconn_apimsg(tcpip_callback_fn fn, struct api_msg *apimsg)
119{
120 err_t err;
121
122#ifdef LWIP_DEBUG
123 /* catch functions that don't set err */
124 apimsg->err = ERR_VAL;
125#endif /* LWIP_DEBUG */
126
127#if LWIP_NETCONN_SEM_PER_THREAD
128 apimsg->op_completed_sem = LWIP_NETCONN_THREAD_SEM_GET();
129#endif /* LWIP_NETCONN_SEM_PER_THREAD */
130
131 err = tcpip_send_msg_wait_sem(fn, apimsg, LWIP_API_MSG_SEM(apimsg));
132 if (err == ERR_OK) {
133 return apimsg->err;
134 }
135 return err;
136}
137
138/**
139 * Create a new netconn (of a specific type) that has a callback function.

Callers 15

netconn_prepare_deleteFunction · 0.70
netconn_getaddrFunction · 0.70
netconn_bindFunction · 0.70
netconn_bind_ifFunction · 0.70
netconn_connectFunction · 0.70
netconn_disconnectFunction · 0.70
netconn_acceptFunction · 0.70
netconn_tcp_recvd_msgFunction · 0.70
netconn_sendFunction · 0.70

Calls 1

tcpip_send_msg_wait_semFunction · 0.70

Tested by

no test coverage detected