1.3.3.28 SYS_NET_RecvMsg Function

C

int32_t SYS_NET_RecvMsg(SYS_MODULE_OBJ obj, void *data, uint16_t len)

Summary

Returns No of Bytes received from peer using the System NET instance.

Description

This function returns the number of bytes received from the peer.

Precondition

SYS_NET_Open should have been called.

Parameters

obj - SYS NET object handle, returned from SYS_NET_Open data - valid data buffer pointer len - length of the data to be transmitted

Returns

SYS_NET_SERVICE_DOWN - Indicates that the System NET instance is not connected to the peer

SYS_NET_GET_NOT_READY - Indicates that the System NET instance No Data to GET

Positive Non-Zero - Indicates the number of bytes received from the peer, which may be less than the "len" of the buffer passed as the param.

Example

// Handle "objSysNet" value must have been returned from SYS_NET_Open.
int32_t len = 32;
uint8_t buffer[32] = {0};
    len = SYS_NET_RecvMsg(objSysNet, buffer, len);
    if(len > 0)
    {
    }

Remarks

None.