The function performs the necessary initializations for the socket library through the following steps:
Functions | |
NMI_API void | socketInit (void) |
NMI_API void socketInit | ( | void | ) |
The function performs the necessary initialization for the socket library through the following steps: - A check made by the global variable gbSocketInit, ensuring that initialization for sockets is performed only once, in-order to prevent resetting the socket instances already created in the global socket array (gastrSockets). - Zero initializations to the global socket array (gastrSockets), which holds the list of TCP sockets. - Registers the socket (Host Interface)hif callback function through the call to the hif_register_cb function. This facilitates handling all of the socket related functions received through interrupts from the firmware.
This example demonstrates the use of the socketInit for socket initialization for an mqtt chat application.
This example demonstrates the use of the socketinit for socket initialization for an mqtt chat application.
References gbSocketInit, gu16SessionID, hif_register_cb(), m2m_ip_cb(), m2m_memset(), M2M_REQ_GROUP_IP, and MAX_SOCKET.
Referenced by main(), wifi_ap_provision(), and wifi_init().