nn::uds::CTR::Attach Function

Syntax

nn::Result Attach(
     EndpointDescriptor * pEndpointDesc,
     u16 srcNodeId,
     u8 port,
     size_t receiveBufferSize = (UDS_PACKET_PAYLOAD_MAX_SIZE *8)
);

Arguments

Name Description
in pEndpointDesc Descriptor indicating the endpoint to use.
in srcNodeId Node ID to attach. When BROADCAST_NODE_ID is specified, all nodes will be attached.
in port Port number to attach. Port number 0x00 is reserved by the system and cannot be used.
in receiveBufferSize Size of the receive buffer to allocate. This is allocated from the memory block allocated by the Initialize function, so take care that the total size of all receive buffers does not exceed the size of this allocated memory block. By default, a size of 8 times the UDS_PACKET_PAYLOAD_MAX_SIZE data is allocated. When specifying the data size, choosing a multiple of 32 will yield the maximum efficiency. (Memory is allocated in 32-byte chunks.)

Return Values

Returns the function's execution result. Returns one of the Result values listed below.
Value Description
ResultSuccess Process was successful.
ResultNotInitialized The library is not initialized. Execute the nn::uds::Initialize function.
ResultInvalidState Not in an executable state.
ResultOutOfResource When there are insufficient system resources, returns that the receive buffer from the buffer specified by the nn::uds::Initialize function is insufficient.
ResultOutOfRange The specified argument was not in a specifiable range. It is possible it will succeed if you re-execute with an appropriate value for the argument.
ResultWirelessOff Transitioned to wireless OFF mode. Re-initialization is required.
A value other than the above. Failed for reasons other than those given above.

Description

Makes the endpoint into a packet-receivable state.

Attaches the specified port and node ID to the endpoint. The system creates a receive buffer, and then becomes able to receive sent packets at a subsequently specified port.

Revision History

2010/10/15
Expanded the information on the return values.
2010/06/14
Initial version.

CONFIDENTIAL