![]() |
Synergy Software Package User's Manual
|
Implementation of QCA4010 Socket layer over QCA4010 On-Chip stack. More...
Macros | |
| #define | AF_INET (4U) |
| IPV4 Socket Family. More... | |
| #define | AF_INET6 (6U) |
| IPV6 Socket Family. | |
| #define | SF_WIFI_QCA4010_SOCKET_CODE_VERSION_MAJOR (2U) |
| #define | SF_WIFI_QCA4010_SOCKET_CODE_VERSION_MINOR (0U) |
Enumerations | |
| enum | sf_wifi_qca4010_socket_status_t |
Functions | |
| ssp_err_t | SF_WIFI_QCA4010_Socket_Open (sf_wifi_qca4010_socket_ctrl_t *p_ctrl, sf_wifi_qca4010_socket_cfg_t const *const p_cfg) |
| Open the WiFi Device driver to use the Socket Layer on WiFi Driver On-Chip stack. More... | |
| ssp_err_t | SF_WIFI_QCA4010_Socket_Close (sf_wifi_qca4010_socket_ctrl_t *const p_ctrl) |
| Close the WiFi Device driver. More... | |
| ssp_err_t | SF_WIFI_QCA4010_Socket_VersionGet (ssp_version_t *const p_version) |
| This function gets the version information of the underlying driver. More... | |
| ssp_err_t | SF_WIFI_QCA4010_Socket_Create (sf_wifi_qca4010_socket_ctrl_t *p_ctrl, uint8_t socket_no, sf_wifi_socket_type_t type, uint8_t ipversion) |
| This creates socket for communication. More... | |
| ssp_err_t | SF_WIFI_QCA4010_Socket_Connect (sf_wifi_qca4010_socket_ctrl_t *p_ctrl, uint8_t socket_no, const struct sockaddr *p_serv_addr, socklen_t addrlen) |
| ssp_err_t | SF_WIFI_QCA4010_Socket_Disconnect (sf_wifi_qca4010_socket_ctrl_t *p_ctrl, uint8_t socket_no) |
| This closes socket. Close opened socket. More... | |
| ssp_err_t | SF_WIFI_QCA4010_Socket_Send (sf_wifi_qca4010_socket_ctrl_t *p_ctrl, uint8_t socket_no, const uint8_t *p_data, uint32_t length, uint32_t timeout_ms) |
| ssp_err_t | SF_WIFI_QCA4010_Socket_Recv (sf_wifi_qca4010_socket_ctrl_t *p_ctrl, uint8_t socket_no, uint8_t *const p_data, uint32_t length, uint32_t timeout_ms) |
| ssp_err_t | SF_WIFI_QCA4010_Socket_Status_Get (sf_wifi_qca4010_socket_ctrl_t *p_ctrl, uint8_t socket_no, uint32_t *p_socket_status) |
Implementation of QCA4010 Socket layer over QCA4010 On-Chip stack.
| #define AF_INET (4U) |
IPV4 Socket Family.
WiFi Interface.
| #define SF_WIFI_QCA4010_SOCKET_CODE_VERSION_MAJOR (2U) |
Major Version of code that implements the API defined in this file
| #define SF_WIFI_QCA4010_SOCKET_CODE_VERSION_MINOR (0U) |
Minor Version of code that implements the API defined in this file
Silex ULPGN Wifi socket status types
| ssp_err_t SF_WIFI_QCA4010_Socket_Close | ( | sf_wifi_qca4010_socket_ctrl_t *const | p_ctrl | ) |
Close the WiFi Device driver.
| [in] | p_ctrl | Socket control block Implements sf_wifi_qca4010_socket_api_t::close Call the low level WiFi device driver's Close API to close the WiFi Driver. |
| SSP_SUCCESS | Suspend the driver functionality. |
| SSP_ERR_NOT_OPEN | Device is not opened. |
| SSP_ERR_ASSERTION | Argument NULL is passed |
| SSP_ERR_IN_USE | Module in use |
| SSP_ERR_WIFI_FAILED | Failed to close |
| SSP_ERR_INTERNAL | Internal Error occurred |
Get Mutex Lock
Close lower level drivers
Delete thread created for each socket
Release Mutex
Delete the mutex
| ssp_err_t SF_WIFI_QCA4010_Socket_Connect | ( | sf_wifi_qca4010_socket_ctrl_t * | p_ctrl, |
| uint8_t | socket_no, | ||
| const struct sockaddr * | p_serv_addr, | ||
| socklen_t | addrlen | ||
| ) |
Connect to a specific IP and Port using socket.
| [in] | p_ctrl | pointer to Socket Wifi control block |
| [in] | socket_no | Socket ID number. |
| [in] | p_serv_addr | Pointer to remote socket address |
| [in] | addrlen | Size of sock address structure |
| SSP_SUCCESS | Socket connection is successful. |
| SSP_ERR_WIFI_FAILED | Socket connection failed |
| SSP_ERR_NOT_OPEN | The instance has not been opened. |
| SSP_ERR_ASSERTION | Assertion error occurred. |
| SSP_ERR_IN_USE | Module in use |
| SSP_ERR_INTERNAL | Internal Error occurred |
Get Mutex Lock
Change socket index for multiple socket communication
Connect socket to specified address
For UDP server, specify the destination address and port
Specify the destination address and port for UDP data to be sent
Release Mutex
| ssp_err_t SF_WIFI_QCA4010_Socket_Create | ( | sf_wifi_qca4010_socket_ctrl_t * | p_ctrl, |
| uint8_t | socket_no, | ||
| sf_wifi_socket_type_t | type, | ||
| uint8_t | ipversion | ||
| ) |
This creates socket for communication.
| [in] | p_ctrl | pointer to Socket control block |
| [in] | socket_no | Socket ID number. |
| [in] | type | Socket type (SOCK_STREAM for TCP and SOCK_DGRAM for UDP) |
| [in] | ipversion | Socket IP type.(for IPV4 -> AF_INET or for IPV6 -> AF_INET6 ) |
| SSP_SUCCESS | Socket creation is successful |
| SSP_ERR_WIFI_FAILED | Failed to create socket |
| SSP_ERR_NOT_OPEN | The instance has not been opened. |
| SSP_ERR_ASSERTION | Assertion error occurred. |
| SSP_ERR_INVALID_ARGUMENT | Invalid argument |
| SSP_ERR_IN_USE | Module in use |
| SSP_ERR_INTERNAL | Internal Error occurred |
Get Mutex Lock
Change socket index for multiple socket communication
Create socket
Release Mutex
| ssp_err_t SF_WIFI_QCA4010_Socket_Disconnect | ( | sf_wifi_qca4010_socket_ctrl_t * | p_ctrl, |
| uint8_t | socket_no | ||
| ) |
This closes socket. Close opened socket.
| [in] | p_ctrl | pointer to Socket Wifi control block |
| [in] | socket_no | Socket no |
| SSP_SUCCESS | Disconnect and close socket network |
| SSP_ERR_WIFI_FAILED | Failed to close socket network |
| SSP_ERR_NOT_OPEN | The instance has not been opened. |
| SSP_ERR_ASSERTION | Assertion error occurred. |
| SSP_ERR_IN_USE | Module in use |
| SSP_ERR_INTERNAL | Internal Error occurred |
Get Mutex Lock
Change socket index for multiple socket communication
If only one UART is used then send escape sequence command
Close the socket network
Release Mutex
| ssp_err_t SF_WIFI_QCA4010_Socket_Open | ( | sf_wifi_qca4010_socket_ctrl_t * | p_ctrl, |
| sf_wifi_qca4010_socket_cfg_t const *const | p_cfg | ||
| ) |
Open the WiFi Device driver to use the Socket Layer on WiFi Driver On-Chip stack.
| [out] | p_ctrl | pointer to Socket control block |
| [in] | p_cfg | pointer to Socket configuration structure Implements sf_wifi_qca4010_socket_api_t::open Call the low level WiFi device driver's Open API to Initialize the WiFi Device Driver, for using Socket Layer on On-Chip stack. |
| SSP_SUCCESS | Module initialization successful |
| SSP_ERR_ALREADY_OPEN | WiFi module is already opened |
| SSP_ERR_WIFI_INIT_FAILED | WiFi module initialization failed |
| SSP_ERR_ASSERTION | Argument NULL is passed |
| SSP_ERR_IN_USE | Module in use |
| SSP_ERR_WIFI_FAILED | Failed to initialize |
| SSP_ERR_INTERNAL | Internal Error occurred |
| SSP_ERR_INVALID_ARGUMENT | Failed due to invalid argument |
Create Mutex for Synchronization
Get Mutex Lock
Socket open
Initialize global variables
Release Mutex
| ssp_err_t SF_WIFI_QCA4010_Socket_Recv | ( | sf_wifi_qca4010_socket_ctrl_t * | p_ctrl, |
| uint8_t | socket_no, | ||
| uint8_t *const | p_data, | ||
| uint32_t | length, | ||
| uint32_t | timeout_ms | ||
| ) |
Receive data over TCP/UDP from server/client.
| [in] | p_ctrl | pointer to Socket Wifi control block |
| [in] | socket_no | Socket ID number. |
| [out] | p_data | Pointer to data received from socket. |
| [in] | length | Length of data array used for receive. |
| [in] | timeout_ms | Timeout to wait for data to be received from socket. |
| SSP_SUCCESS | Data reception us successful |
| SSP_ERR_WIFI_FAILED | Failed to receive data |
| SSP_ERR_NOT_OPEN | The instance has not been opened. |
| SSP_ERR_ASSERTION | Assertion error occurred. |
| SSP_ERR_IN_USE | Module in use |
| SSP_ERR_INTERNAL | Internal Error occurred |
Get Mutex Lock
Change socket index for multiple socket communication
Receive data which is sent from server/client
Release Mutex
| ssp_err_t SF_WIFI_QCA4010_Socket_Send | ( | sf_wifi_qca4010_socket_ctrl_t * | p_ctrl, |
| uint8_t | socket_no, | ||
| const uint8_t * | p_data, | ||
| uint32_t | length, | ||
| uint32_t | timeout_ms | ||
| ) |
Send data over TCP/UDP to server/client.
| [in] | p_ctrl | pointer to Socket Wifi control block |
| [in] | socket_no | Socket ID number. |
| [in] | p_data | Pointer to data to send. |
| [in] | length | Length of data to send. |
| [in] | timeout_ms | Timeout to wait for transmit end event |
| SSP_SUCCESS | Data send to client/server is successful. |
| SSP_ERR_WIFI_FAILED | Failed to send data. |
| SSP_ERR_NOT_OPEN | The instance has not been opened. |
| SSP_ERR_ASSERTION | Assertion error occurred. |
| SSP_ERR_IN_USE | Module in use |
| SSP_ERR_INTERNAL | Internal Error occurred |
| SSP_ERR_TIMEOUT | Timeout to send data |
Get Mutex Lock
Change socket index for multiple socket communication
Send data over data port
Release Mutex
| ssp_err_t SF_WIFI_QCA4010_Socket_Status_Get | ( | sf_wifi_qca4010_socket_ctrl_t * | p_ctrl, |
| uint8_t | socket_no, | ||
| uint32_t * | p_socket_status | ||
| ) |
Get the socket status.
| [in] | p_ctrl | Socket Wifi control block |
| [in] | socket_no | Socket ID number. |
| [out] | p_socket_status | Pointer to an integer to hold the socket status |
| SSP_SUCCESS | Socket status obtained successfully. |
| SSP_ERR_ASSERTION | Assertion error occurred. |
| SSP_ERR_NOT_OPEN | The instance has not been opened. |
| SSP_ERR_IN_USE | Module in use |
| SSP_ERR_WIFI_FAILED | Failed obtain socket status |
| SSP_ERR_INTERNAL | Internal Error occurred |
Get Mutex Lock
Obtain socket status
Release Mutex
| ssp_err_t SF_WIFI_QCA4010_Socket_VersionGet | ( | ssp_version_t *const | p_version | ) |
This function gets the version information of the underlying driver.
Implements sf_wifi_qca4010_socket_api_t::versionGet
| SSP_SUCCESS | Retrieval of version information is successful |
| SSP_ERR_ASSERTION | Argument NULL is passed |