* 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 */
| 115 | * @return ERR_OK if the function was called, another err_t if not |
| 116 | */ |
| 117 | static err_t |
| 118 | netconn_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. |
no test coverage detected