Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NNN50_CE_Test_UDP NNN50_linux_firmware NNN50_SoftAP_HelloWorld NNN50_BLEWIFISensor ... more
socket.h File Reference
WINC BSD compatible Socket Interface. More...
Go to the source code of this file.
Data Structures | |
| struct | in_addr |
| IPv4 address representation. More... | |
| struct | sockaddr |
| Generic socket address structure. More... | |
| struct | sockaddr_in |
| Socket address structure for IPV4 addresses. Used to specify socket address information to which to connect to. Can be cast to sockaddr structure. More... | |
| struct | tstrSocketBindMsg |
| Socket bind status. More... | |
| struct | tstrSocketListenMsg |
| Socket listen status. More... | |
| struct | tstrSocketAcceptMsg |
| Socket accept status. More... | |
| struct | tstrSocketConnectMsg |
| Socket connect status. More... | |
| struct | tstrSocketRecvMsg |
| Socket recv status. More... | |
Typedefs | |
| typedef void(* | tpfAppSocketCb )(SOCKET sock, uint8 u8Msg, void *pvMsg) |
| The main socket application callback function. Applications register their main socket application callback through this function by calling registerSocketCallback. In response to events received, the following callback function is called to handle the corresponding asynchronous function called. Example: bind, connect,...etc. | |
| typedef void(* | tpfAppResolveCb )(uint8 *pu8DomainName, uint32 u32ServerIP) |
| DNS resolution callback function. Applications requiring DNS resolution should register their callback through this function by calling registerSocketCallback. The following callback is triggered in response to asynchronous call to the gethostbyname function (DNS Resolution callback). | |
| typedef void(* | tpfPingCb )(uint32 u32IPAddr, uint32 u32RTT, uint8 u8ErrorCode) |
| PING Callback. | |
Enumerations | |
| enum | tenuSocketCallbackMsgType { SOCKET_MSG_BIND = 1, SOCKET_MSG_LISTEN, SOCKET_MSG_DNS_RESOLVE, SOCKET_MSG_ACCEPT, SOCKET_MSG_CONNECT, SOCKET_MSG_RECV, SOCKET_MSG_SEND, SOCKET_MSG_SENDTO, SOCKET_MSG_RECVFROM } |
Asynchronous APIs, make use of callback functions, in-order to return back the results once the corresponding socket operation is completed. Hence resuming the normal execution of the application code while the socket operation returns the results. Callback functions expect event messages to be passed in, in-order to identify the operation they're returning the results for. The following enum identifies the type of events that are received in the callback function. More... | |
Functions | |
| NMI_API void | socketInit (void) |
| NMI_API void | socketDeinit (void) |
| Socket Layer De-initialization. | |
| NMI_API void | registerSocketCallback (tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb) |
| NMI_API SOCKET | socket (uint16 u16Domain, uint8 u8Type, uint8 u8Flags) |
| NMI_API sint16 | recv (SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec) |
| NMI_API sint16 | recvfrom (SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec) |
| NMI_API sint16 | sendto (SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen) |
| NMI_API uint32 | nmi_inet_addr (char *pcIpAddr) |
| NMI_API sint8 | gethostbyname (uint8 *pcHostName) |
| NMI_API sint8 | sslEnableCertExpirationCheck (tenuSslCertExpSettings enuValidationSetting) |
| NMI_API sint8 | setsockopt (SOCKET socket, uint8 u8Level, uint8 option_name, const void *option_value, uint16 u16OptionLen) |
| NMI_API sint8 | getsockopt (SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8 *pu8OptLen) |
| NMI_API sint8 | m2m_ping_req (uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb) |
Detailed Description
WINC BSD compatible Socket Interface.
Copyright (c) 2016-2017 Atmel Corporation. All rights reserved.
Definition in file socket.h.
Generated on Wed Jul 13 2022 16:32:38 by
1.7.2