nn::uds::CTR::ReceiveFrom Function

Syntax

nn::Result ReceiveFrom(
     const EndpointDescriptor & endpointDesc,
     void * pBuffer,
     size_t * pReceivedSize,
     u16 * pSrcNodeId,
     size_t bufferSize,
     bit8 option = 0x00
);

Parameters

Name Description
in endpointDesc Descriptor indicating the endpoint to use. The port and sending source must be attached in advance using the Attach function.
out pBuffer Received data storage location. Specify a buffer aligned to 4 bytes.
out pReceivedSize Size of the received data. The UDS maximum received data size is UDS_PACKET_PAYLOAD_MAX_SIZE bytes.
out pSrcNodeId Sending source node ID.
in bufferSize Size of the receive buffer (pBuffer). The size of the receive buffer must be a multiple of 4.
in option Receive options.

Return Values

Returns the function's execution result. Returns one of the Result values listed below.
Value Description
Result::IsSuccess Process was successful.
ResultNotInitialized When the library is not initialized, returns that the specified endpoint does not exist.
ResultInvalidState Not in an executable state. Returns that it was executed in a state where it was not connected to the network.
ResultNotAuthorized Returns that an endpoint that was not attached was specified.
ResultTooLarge Returns that the bufferSize was smaller than the received data. The desired size is UDS_PACKET_PAYLOAD_MAX_SIZE.
ResultOutOfRange The specified argument value was not in the valid range for the argument. It is possible it will succeed if you re-execute with an appropriate value for the argument.
ResultWirelessOff Entered wireless-disabled mode. Re-initialization is required.
ResultMisalignedSize bufferSize is not appropriate. It is possible it will succeed if you re-execute with an appropriate value for the argument.
ResultMisalignedAddress pBuffer is not appropriate. It is possible it will succeed if you re-execute with an appropriate value for the argument.
A value other than the above Failed for reasons other than those given above.

Description

Receives data.

Receives packets sent to an endpoint for which the Attach function was executed. When there are no packets to be received, the function is blocked. (Excluding times when errors occur) when NO_WAIT is specified as an option, it is complete, even when no packets have been received. This function is thread-safe.

Revision History

2011/09/07
Standardized notation for wireless-disabled mode.
2011/03/08
Added a link to UDS_PACKET_PAYLOAD_MAX_SIZE in Return Values.
2010/10/15
Expanded the information on the return values. Revised the Description to make it easier to understand.
2010/09/24
Noted that the buffer specified for pBuffer must be 4-byte aligned.
2010/06/14
Initial version.

CONFIDENTIAL