This function sends a socket.(UDP compatible)

Syntax

int SyncSendtoSc(
  SOCKET sock, 
  void *pvSendBuffer, 
  unsigned short u16SendLength, 
  struct sockaddr_in *pstrDestAddr
);

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).
pstrDestAddr
[in]A pointer to the sockaddr_in structure.

Return value

The following values will be returned.
ValueDescription
Positive number Send size
0 Sent
If UDP callbacks have been disabled
SOCK_ERROR Socket error
Please recreate the socket.
M2M_ERR_SLEEP_FAIL Initialize with SysWLANInit function.
Other than the above Failed

Remarks

Performs socket transmission (UDP compatible).

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Last updated: 2020/10/14