Syntax
short SendSc(
SOCKET sock,
void *pvSendBuffer,
unsigned short u16SendLength,
unsigned short flags
);
Parameters
- sock
-
[in] Socket descriptor
- pvSendBuffer
-
[in] Specify the send buffer.
- u16SendLength
- [in] Specify the size of the data to be sent.The upper limit of the size of the transmitted data is SOCKET_BUFFER_MAX_LENGTH (= 1400).
- flags
-
[in] Please specify 0.
Return value
The following values will be returned.Value | Description |
---|---|
SOCK_ERR_NO_ERROR | Succeeded |
M2M_ERR_SLEEP_FAIL | Initialize with SysWLANInit function. |
Other than the above | Failed |
Remarks
Send using TCP socket.Only available on TCP sockets.
The processing request of this function is processed asynchronously. The processing result is received by the callback function specified by the pfAppSocketCb parameter of the RegSocketCallbackSc function. The following values are passed to the parameters of the callback function.
- sock
- Socket descriptor
- u8Msg
- SOCKET_MSG_SEND
- pvMsg
-
A pointer to a short type variable that stores the processing result. The values of the variables are:
Value Description Sent data size Succeeded Negative value Failed
Requirements
Header file:
lib.hLibrary file:
libSTARTUPOPH5000.a
Sample
Last updated: 2020/10/14