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)
 

Detailed Description

Implementation of QCA4010 Socket layer over QCA4010 On-Chip stack.

Macro Definition Documentation

◆ AF_INET

#define AF_INET   (4U)

IPV4 Socket Family.

WiFi Interface.

◆ SF_WIFI_QCA4010_SOCKET_CODE_VERSION_MAJOR

#define SF_WIFI_QCA4010_SOCKET_CODE_VERSION_MAJOR   (2U)

Major Version of code that implements the API defined in this file

◆ SF_WIFI_QCA4010_SOCKET_CODE_VERSION_MINOR

#define SF_WIFI_QCA4010_SOCKET_CODE_VERSION_MINOR   (0U)

Minor Version of code that implements the API defined in this file

Enumeration Type Documentation

◆ sf_wifi_qca4010_socket_status_t

Silex ULPGN Wifi socket status types

Function Documentation

◆ SF_WIFI_QCA4010_Socket_Close()

ssp_err_t SF_WIFI_QCA4010_Socket_Close ( sf_wifi_qca4010_socket_ctrl_t *const  p_ctrl)

Close the WiFi Device driver.

Parameters
[in]p_ctrlSocket 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.
Return values
SSP_SUCCESSSuspend the driver functionality.
SSP_ERR_NOT_OPENDevice is not opened.
SSP_ERR_ASSERTIONArgument NULL is passed
SSP_ERR_IN_USEModule in use
SSP_ERR_WIFI_FAILEDFailed to close
SSP_ERR_INTERNALInternal Error occurred

Get Mutex Lock

Close lower level drivers

Delete thread created for each socket

Release Mutex

Delete the mutex

◆ SF_WIFI_QCA4010_Socket_Connect()

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.

Parameters
[in]p_ctrlpointer to Socket Wifi control block
[in]socket_noSocket ID number.
[in]p_serv_addrPointer to remote socket address
[in]addrlenSize of sock address structure
Return values
SSP_SUCCESSSocket connection is successful.
SSP_ERR_WIFI_FAILEDSocket connection failed
SSP_ERR_NOT_OPENThe instance has not been opened.
SSP_ERR_ASSERTIONAssertion error occurred.
SSP_ERR_IN_USEModule in use
SSP_ERR_INTERNALInternal 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

◆ SF_WIFI_QCA4010_Socket_Create()

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.

Parameters
[in]p_ctrlpointer to Socket control block
[in]socket_noSocket ID number.
[in]typeSocket type (SOCK_STREAM for TCP and SOCK_DGRAM for UDP)
[in]ipversionSocket IP type.(for IPV4 -> AF_INET or for IPV6 -> AF_INET6 )
Return values
SSP_SUCCESSSocket creation is successful
SSP_ERR_WIFI_FAILEDFailed to create socket
SSP_ERR_NOT_OPENThe instance has not been opened.
SSP_ERR_ASSERTIONAssertion error occurred.
SSP_ERR_INVALID_ARGUMENTInvalid argument
SSP_ERR_IN_USEModule in use
SSP_ERR_INTERNALInternal Error occurred

Get Mutex Lock

Change socket index for multiple socket communication

Create socket

Release Mutex

◆ SF_WIFI_QCA4010_Socket_Disconnect()

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.

Parameters
[in]p_ctrlpointer to Socket Wifi control block
[in]socket_noSocket no
Return values
SSP_SUCCESSDisconnect and close socket network
SSP_ERR_WIFI_FAILEDFailed to close socket network
SSP_ERR_NOT_OPENThe instance has not been opened.
SSP_ERR_ASSERTIONAssertion error occurred.
SSP_ERR_IN_USEModule in use
SSP_ERR_INTERNALInternal 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

◆ SF_WIFI_QCA4010_Socket_Open()

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.

Parameters
[out]p_ctrlpointer to Socket control block
[in]p_cfgpointer 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.
Return values
SSP_SUCCESSModule initialization successful
SSP_ERR_ALREADY_OPENWiFi module is already opened
SSP_ERR_WIFI_INIT_FAILEDWiFi module initialization failed
SSP_ERR_ASSERTIONArgument NULL is passed
SSP_ERR_IN_USEModule in use
SSP_ERR_WIFI_FAILEDFailed to initialize
SSP_ERR_INTERNALInternal Error occurred
SSP_ERR_INVALID_ARGUMENTFailed due to invalid argument

Create Mutex for Synchronization

Get Mutex Lock

Socket open

Initialize global variables

Release Mutex

◆ SF_WIFI_QCA4010_Socket_Recv()

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.

Parameters
[in]p_ctrlpointer to Socket Wifi control block
[in]socket_noSocket ID number.
[out]p_dataPointer to data received from socket.
[in]lengthLength of data array used for receive.
[in]timeout_msTimeout to wait for data to be received from socket.
Return values
SSP_SUCCESSData reception us successful
SSP_ERR_WIFI_FAILEDFailed to receive data
SSP_ERR_NOT_OPENThe instance has not been opened.
SSP_ERR_ASSERTIONAssertion error occurred.
SSP_ERR_IN_USEModule in use
SSP_ERR_INTERNALInternal Error occurred

Get Mutex Lock

Change socket index for multiple socket communication

Receive data which is sent from server/client

Release Mutex

◆ SF_WIFI_QCA4010_Socket_Send()

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.

Parameters
[in]p_ctrlpointer to Socket Wifi control block
[in]socket_noSocket ID number.
[in]p_dataPointer to data to send.
[in]lengthLength of data to send.
[in]timeout_msTimeout to wait for transmit end event
Return values
SSP_SUCCESSData send to client/server is successful.
SSP_ERR_WIFI_FAILEDFailed to send data.
SSP_ERR_NOT_OPENThe instance has not been opened.
SSP_ERR_ASSERTIONAssertion error occurred.
SSP_ERR_IN_USEModule in use
SSP_ERR_INTERNALInternal Error occurred
SSP_ERR_TIMEOUTTimeout to send data

Get Mutex Lock

Change socket index for multiple socket communication

Send data over data port

Release Mutex

◆ SF_WIFI_QCA4010_Socket_Status_Get()

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.

Parameters
[in]p_ctrlSocket Wifi control block
[in]socket_noSocket ID number.
[out]p_socket_statusPointer to an integer to hold the socket status
Return values
SSP_SUCCESSSocket status obtained successfully.
SSP_ERR_ASSERTIONAssertion error occurred.
SSP_ERR_NOT_OPENThe instance has not been opened.
SSP_ERR_IN_USEModule in use
SSP_ERR_WIFI_FAILEDFailed obtain socket status
SSP_ERR_INTERNALInternal Error occurred

Get Mutex Lock

Obtain socket status

Release Mutex

◆ SF_WIFI_QCA4010_Socket_VersionGet()

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

Return values
SSP_SUCCESSRetrieval of version information is successful
SSP_ERR_ASSERTIONArgument NULL is passed