|
| int | socket (int domain, int type, int protocol) |
| | This creates socket for communication. More...
|
| |
| int | close (int sockfd) |
| | This closes socket. More...
|
| |
| int | bind (int sockfd, const struct sockaddr *p_local_sock_addr, socklen_t addrlen) |
| | This binds socket to IP address. More...
|
| |
| int | listen (int sockfd, int backlog) |
| | This listens for connection on socket. More...
|
| |
| int | connect (int sockfd, const struct sockaddr *p_serv_addr, socklen_t addrlen) |
| | This connects with remote socket(stream socket). More...
|
| |
| int | accept (int sockfd, struct sockaddr *p_cliaddr, socklen_t *p_addrlen) |
| | This accepts connection from remote socket. More...
|
| |
| ssize_t | send (int sockfd, const void *p_buf, size_t length, int flags) |
| | This sends data over STREAM socket. More...
|
| |
| ssize_t | recv (int sockfd, void *p_buf, size_t length, int flags) |
| | This receives data over STREAM socket. More...
|
| |
| ssize_t | sendto (int sockfd, const void *p_buf, size_t length, int flags, const struct sockaddr *p_dest_addr, socklen_t addrlen) |
| | This sends data over DGRAM socket. More...
|
| |
| ssize_t | recvfrom (int sockfd, void *p_buf, size_t length, int flags, struct sockaddr *p_src_addr, socklen_t *p_addrlen) |
| | This receives data over DGRAM socket. More...
|
| |
| int | setsockopt (int sockfd, int level, int optname, const void *p_optval, socklen_t optlen) |
| | This updates socket specific options. Quectel CATM1 supports following socket options SO_SNDBUF: Transmission packet size TCP_MAX_RETRIES: Maximum Number of retransmission TCP_MAX_RTO: Maximum interval time of TCP retransmission. More...
|
| |
| int | getsockopt (int sockfd, int level, int optname, void *p_optval, socklen_t *p_optlen) |
| | This reads socket specific options. Quectel CATM1 supports following socket options SO_SNDBUF: Transmission packet size TCP_MAX_RETRIES: Maximum Number of retransmission TCP_MAX_RTO: Maximum interval time of TCP retransmission. More...
|
| |
| int | select (int nfds, fd_set *p_readfds, fd_set *p_writefds, fd_set *p_exceptfds, struct timeval *p_timeout) |
| | This waits for any activity on socket. More...
|
| |
RTOS-integrated SF Socket WIFI Framework Interface.
This SSP Interface provides access OnChip stack BSD Socket API.
This accepts connection from remote socket.
Accept connection request from remote.
- Parameters
-
| [in] | sockfd | Local socket |
| [out] | p_cliaddr | Pointer to remote socket address which trying to connect |
| [out] | p_addrlen | Pointer to address length of client socket address |
Implements accept This function accepts connection from remote socket. This API is used only with socket type STREAM. The call is blocked if no connection is present or the socket is blocking.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [out] | p_cliaddr | Remote machine Network address |
| [out] | p_addrlen | Size of Socket address structure |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Invalid input arguments OR Error accepting the connection |
| SF_CELLULAR_QCTLCATM1_SOCKET_SUCCESS | Connection is received successfully. |
Implements accept This function accepts connection from remote socket. This API is used only with socket type STREAM. The call is blocked if no connection is present or the socket is blocking.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [out] | p_cliaddr | Remote machine Network address (Can be NULL) |
| [out] | p_addrlen | Size of Socket address structure(Can be NULL) |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Error accepting the connection or invalid input parameters |
- Returns
- Otherwise Connection is received successfully.
This connects with remote socket(stream socket).
Establish TCP connection with remote socket
- Parameters
-
| [in] | sockfd | Local socket |
| [in] | p_serv_addr | Pointer to remote socket address |
| [in] | addrlen | Size of sock address structure |
Implements connect This function connects local socket with remote socket. The call is blocked until a connection is established or error is returned.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [in] | p_serv_addr | Remote machine Network address |
| [in] | addrlen | Size of Socket address structure |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Invalid input arguments OR Error occurred. |
| SF_CELLULAR_QCTLCATM1_SOCKET_SUCCESS | Socket is connected successfully. |
Implements connect This function connects local socket with remote socket. The call is blocked until a connection is established or error is returned.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [in] | p_serv_addr | Remote machine Network address |
| [in] | addrlen | Size of Socket address structure |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Error occurred or invalid input parameters |
- Returns
- Otherwise Socket is connected successfully.
| int getsockopt |
( |
int |
sockfd, |
|
|
int |
level, |
|
|
int |
optname, |
|
|
void * |
p_optval, |
|
|
socklen_t * |
p_optlen |
|
) |
| |
This reads socket specific options. Quectel CATM1 supports following socket options SO_SNDBUF: Transmission packet size TCP_MAX_RETRIES: Maximum Number of retransmission TCP_MAX_RTO: Maximum interval time of TCP retransmission.
Get Socket options.
- Parameters
-
| [in] | sockfd | Local socket |
| [in] | level | Sockets API level |
| [in] | optname | Option to be get |
| [out] | p_optval | Option value to be get |
| [in] | p_optlen | Length of option value |
Implements getsockopt This gets options for an existing socket.
- Parameters
-
| [in] | sockfd | Socket file descriptor |
| [in] | level | Level |
| [in] | optname | Socket option name |
| [out] | p_optval | Socket option value |
| [out] | p_optlen | Size of Socket option |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Invalid input arguments OR Error reading socket option |
| SF_CELLULAR_QCTLCATM1_SOCKET_SUCCESS | Socket option read successfully. |
This reads socket specific options. Quectel CATM1 supports following socket options SO_SNDBUF: Transmission packet size TCP_MAX_RETRIES: Maximum Number of retransmission TCP_MAX_RTO: Maximum interval time of TCP retransmission.
Implements getsockopt This gets options for an existing socket.
- Parameters
-
| [in] | sockfd | Socket file descriptor |
| [in] | level | Level |
| [in] | optname | Socket option name |
| [out] | p_optval | Socket option value |
| [out] | p_optlen | Size of Socket option |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Error reading socket option or invalid socket descriptor |
- Returns
- Otherwise Socket option read successfully.
| int listen |
( |
int |
sockfd, |
|
|
int |
backlog |
|
) |
| |
This listens for connection on socket.
Listen for tcp connection. Set socket in listen mode for tcp connection.
- Parameters
-
| [in] | sockfd | Local socket |
| [in] | backlog | Max number of connection queue. |
Implements listen This function listen for connection on socket.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [in] | backlog | number of maximum connection can be accepted |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Failed to set socket in Listen mode |
| SF_CELLULAR_QCTLCATM1_SOCKET_SUCCESS | Set socket in Listen mode successfully. |
Implements listen This function listen for connection on socket.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [in] | backlog | number of maximum connection can be accepted |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Failed to set socket in Listen mode or invalid input parameters |
- Returns
- Otherwise Set socket in Listen mode successfully.
| ssize_t recv |
( |
int |
sockfd, |
|
|
void * |
p_buf, |
|
|
size_t |
length, |
|
|
int |
flags |
|
) |
| |
This receives data over STREAM socket.
Receive data from remote socket.
- Parameters
-
| [in] | sockfd | Local socket |
| [out] | p_buf | Pointer to data buffer where data will be received |
| [in] | length | Maximum length of data which can be received |
| [in] | flags | Socket flags |
Implements receive This function receives data on a stream socket in connected state. If no packet is available, the socket is blocked until it is set to non-blocking. The application must provide a valid buffer to receive the payload. If the buffer length is smaller than the available payload, the API will do a partial copy, and hold on the rest of the payload for a subsequent call to the API.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [out] | p_buf | Buffer to read data |
| [in] | length | Data length |
| [in] | flags | Socket flag |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Invalid input arguments OR Failed to receive data. |
- Returns
- Otherwise Number of Data bytes received successfully.
Implements receive This function receives data on a stream socket in connected state. If no packet is available, the socket is blocked until it is set to non-blocking. The application must provide a valid buffer to receive the payload. If the buffer length is smaller than the available payload, the API will do a partial copy, and hold on the rest of the payload for a subsequent call to the API.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [out] | p_buf | Buffer to read data |
| [out] | length | Data length |
| [in] | flags | Socket flag |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Failed to receive data or invalid input parameters |
- Returns
- Otherwise Data received successfully.
| ssize_t recvfrom |
( |
int |
sockfd, |
|
|
void * |
p_buf, |
|
|
size_t |
length, |
|
|
int |
flags, |
|
|
struct sockaddr * |
p_src_addr, |
|
|
socklen_t * |
p_addrlen |
|
) |
| |
This receives data over DGRAM socket.
Receive data from remote socket.
- Parameters
-
| [in] | sockfd | Local socket |
| [out] | p_buf | Pointer to data buffer where data will be received |
| [in] | length | Maximum length of data which can be received |
| [in] | flags | Socket flag |
| [out] | p_src_addr | Pointer to remote socket address which has sent data |
| [out] | p_addrlen | Length of socket address structure |
Implements recvfrom This function receives data on a dgram socket. If no packet is available, the socket is blocked until it is set to non-blocking. The application must provide a valid buffer to receive the payload. If the buffer length is smaller than the available payload, the API will do a partial copy, and hold on the rest of the payload for a subsequent call to the API.
- Parameters
-
| [in] | sockfd | Socket file descriptor |
| [out] | p_buf | Data buffer pointer to read data |
| [in] | length | Length of data to read |
| [in] | flags | Flags |
| [in] | p_src_addr | Remote machine network address |
| [in] | p_addrlen | Size of Remote machine network |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Invalid input arguments OR Error receiving data |
- Returns
- Otherwise Numbers of data bytes received successfully.
Implements recvfrom This function receives data on a dgram socket. If no packet is available, the socket is blocked until it is set to non-blocking. The application must provide a valid buffer to receive the payload. If the buffer length is smaller than the available payload, the API will do a partial copy, and hold on the rest of the payload for a subsequent call to the API.
- Parameters
-
| [in] | sockfd | Socket file descriptor |
| [out] | p_buf | Data buffer pointer to read data |
| [in] | length | Length of data to read |
| [in] | flags | Flags |
| [in] | p_src_addr | Remote machine network address (Can be NULL) |
| [in] | p_addrlen | Size of Remote machine network (Can be NULL) |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Error receiving data or invalid input parameters |
- Returns
- Otherwise Numbers of data bytes received successfully.
| int select |
( |
int |
nfds, |
|
|
fd_set * |
p_readfds, |
|
|
fd_set * |
p_writefds, |
|
|
fd_set * |
p_exceptfds, |
|
|
struct timeval * |
p_timeout |
|
) |
| |
This waits for any activity on socket.
Wait on a given socket for specified amount of time. In case of any activity e.g. arrival of packet it comes out of wait.
- Parameters
-
| [in] | nfds | Max fd |
| [in] | p_readfds | Pointer to fd_set to check whether data is available for read |
| [in] | p_writefds | Pointer to fd_set to check whether data is available for write |
| [in] | p_exceptfds | Pointer to fd_set to check whether exceptional condition occurred |
| [in] | p_timeout | Wait time in milliseconds |
Implements select Allow an application thread to block on a given socket handle for a specified time period. This API checks for any activity on specified socket, for example arrival of a packet at the receive queue.
- Parameters
-
| [in] | nfds | Number of socket fds in to check |
| [in] | p_readfds | Read socket fd set |
| [in] | p_writefds | Write socket fd set. If no descriptor is to be tested for writing, p_writefds should be NULL |
| [in] | p_exceptfds | Exceptional socket fd set. If no descriptor is to be tested for exceptions, p_exceptfds should be NULL |
| [in] | p_timeout | Timeout |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Timeout occurred, no activity. |
- Returns
- Otherwise Activity detected(Packet available).
Implements select Allow an application thread to block on a given socket handle for a specified time period. This API checks for any activity on specified socket, for example arrival of a packet at the receive queue.
- Parameters
-
| [in] | nfds | Number of socket fds in to check |
| [in] | p_readfds | Read socket fd set |
| [in] | p_writefds | Write socket fd set - API does not used this parameter |
| [in] | p_exceptfds | Exceptional socket fd set - API does not used this parameter |
| [in] | p_timeout | Timeout |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Timeout occurred, no activity or invalid socket descriptor |
- Returns
- Otherwise Activity detected(Packet available).
| ssize_t send |
( |
int |
sockfd, |
|
|
const void * |
p_buf, |
|
|
size_t |
length, |
|
|
int |
flags |
|
) |
| |
This sends data over STREAM socket.
Send data to remote socket.
- Parameters
-
| [in] | sockfd | Local socket |
| [in] | p_buf | Pointer to data buffer |
| [in] | length | Data buffer length |
| [in] | flags | Socket flags |
Implements send This function sends data on a stream socket in connected state.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [in] | p_buf | Buffer data to send |
| [in] | length | Data length |
| [in] | flags | Socket flag |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Invalid input arguments OR Failed to send data. |
- Returns
- Otherwise Number of Data bytes sent successfully.
Implements send This function sends data on a stream socket in connected state.
- Parameters
-
| [in] | sockfd | Socket File Descriptor |
| [in] | p_buf | Buffer data to send |
| [in] | length | Data length |
| [in] | flags | Socket flag |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Failed to send data or invalid input parameters |
- Returns
- Otherwise Data sent successfully.
| int setsockopt |
( |
int |
sockfd, |
|
|
int |
level, |
|
|
int |
optname, |
|
|
const void * |
p_optval, |
|
|
socklen_t |
optlen |
|
) |
| |
This updates socket specific options. Quectel CATM1 supports following socket options SO_SNDBUF: Transmission packet size TCP_MAX_RETRIES: Maximum Number of retransmission TCP_MAX_RTO: Maximum interval time of TCP retransmission.
Set Socket options.
- Parameters
-
| [in] | sockfd | Local socket |
| [in] | level | Sockets API level |
| [in] | optname | Option to be set |
| [in] | p_optval | Option value to be set |
| [in] | optlen | Length of option value |
Implements setsockopt This sets options for an existing socket.
- Parameters
-
| [in] | sockfd | Socket file descriptor |
| [in] | level | Level |
| [in] | optname | Socket option name |
| [in] | p_optval | Socket option value |
| [in] | optlen | Size of Socket option |
- Return values
-
| SF_CELLULAR_QCTLCATM1_SOCKET_INVALID_FD | Invalid input arguments OR Error setting socket option |
| SF_CELLULAR_QCTLCATM1_SOCKET_SUCCESS | Socket option set successfully. |
This updates socket specific options. Quectel CATM1 supports following socket options SO_SNDBUF: Transmission packet size TCP_MAX_RETRIES: Maximum Number of retransmission TCP_MAX_RTO: Maximum interval time of TCP retransmission.
Implements setsockopt This sets options for an existing socket.
- Parameters
-
| [in] | sockfd | Socket file descriptor |
| [in] | level | Level |
| [in] | optname | Socket option name |
| [in] | p_optval | Socket option value |
| [in] | optlen | Size of Socket option |
- Return values
-
| SF_CELLULAR_RYZ014CATM1_SOCKET_INVALID_FD | Error setting socket option or invalid socket descriptor |
- Returns
- Otherwise Socket option set successfully.