18 #define UDS_MAX_NODES 0x10
20 #define UDS_BROADCAST_NODE_ID 0xFFFF
104 uint16_t networkNodeId,
106 uint32_t recvBufferSize) asm("Attach__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe18EndpointDescriptorUsUcUi");
160 uint32_t localCommunicationId,
161 const
char *passphrase,
162 uint32_t passphraseSize,
163 uint8_t channel) asm("CreateNetwork__Q3_2nn3uds4CafeFUcT1UiPCcT3T1");
198 uint32_t localCommunicationId,
199 const
char *passphrase,
200 uint32_t passphraseSize,
203 uint32_t appDataSize) asm("CreateNetwork__Q3_2nn3uds4CafeFUcT1UiPCcT3T1PCvT3");
241 uint32_t localCommunicationId,
242 const
char *passphrase,
243 uint32_t passphraseSize,
247 uint32_t appDataSize) asm("CreateNetwork__Q3_2nn3uds4CafeFUcT1UiPCcT3bT1PCvT3");
280 EjectClient(uint16_t networkNodeId) asm("EjectClient__Q3_2nn3uds4CafeFUs");
309 uint32_t size) asm("GetApplicationDataFromBeacon__Q3_2nn3uds4CafeFPvPUiUi");
318 GetChannel(uint8_t *channel) asm("GetChannel__Q3_2nn3uds4CafeFPUc");
351 Initialize(
void *workMemory, uint32_t workMemorySize) asm("Initialize__Q3_2nn3uds4CafeFPvUi");
367 uint32_t workMemorySize,
368 nn::cfg::CTR::UserName *username) asm("Initialize__Q3_2nn3uds4CafeFPvUiPQ4_2nn3cfg3CTR8UserName");
404 uint32_t *receivedSize,
405 uint16_t *networkNodeId,
407 uint8_t flags) asm("ReceiveFrom__Q3_2nn3uds4CafeFRCQ4_2nn3uds4Cafe18EndpointDescriptorPvPUiPUsUiUc");
430 uint32_t *receivedSize,
432 uint8_t flags) asm("Receive__Q3_2nn3uds4CafeFRCQ4_2nn3uds4Cafe18EndpointDescriptorPvPUiUiUc");
461 uint8_t flags) asm("SendTo__Q3_2nn3uds4CafeFRCQ4_2nn3uds4Cafe18EndpointDescriptorPCvUiUsUcT5");
Result value type used by nn libraries.
#define UDS_MAX_NODES
Theoretical supported maximum number of nodes connected to a network, including the host.
nn::Result GetChannel(uint8_t *channel) asm("GetChannel__Q3_2nn3uds4CafeFPUc")
Gets the network channel.
nn::Result GetConnectionStatus(ConnectionStatus *status) asm("GetConnectionStatus__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe16ConnectionStatus")
Retrieves the connection status of the network.
nn::Result AllowToSpectate() asm("AllowToSpectate__Q3_2nn3uds4CafeFv")
Allows clients to spectate the network.
uint16_t networkNodeId
The network node ID of this device.
nn::Result AllowToConnect() asm("AllowToConnect__Q3_2nn3uds4CafeFv")
Allows clients to connect to the network.
nn::Result Initialize(void *workMemory, uint32_t workMemorySize) asm("Initialize__Q3_2nn3uds4CafeFPvUi")
Initializes UDS.
nn::Result DestroyNetwork() asm("DestroyNetwork__Q3_2nn3uds4CafeFv")
Destroys the previously created network.
nn::Result CreateEndpoint(EndpointDescriptor *fd) asm("CreateEndpoint__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe18EndpointDescriptor")
Creates a new endpoint.
nn::Result SendTo(const EndpointDescriptor &fd, const void *buf, uint32_t size, uint16_t destNodeId, uint8_t dataChannel, uint8_t flags) asm("SendTo__Q3_2nn3uds4CafeFRCQ4_2nn3uds4Cafe18EndpointDescriptorPCvUiUsUcT5")
Sends data to the specified node ID through the given data channel.
nn::Result EjectClient(uint16_t networkNodeId) asm("EjectClient__Q3_2nn3uds4CafeFUs")
Ejects the specified client from the network.
nn::Result EjectSpectator() asm("EjectSpectator__Q3_2nn3uds4CafeFv")
Ejects all spectators from the network.
@ UDS_POLL_NONBLOCK
Prevents PollStateChange from blocking if no new data is available.
nn::Result Attach(EndpointDescriptor *fd, uint16_t networkNodeId, uint8_t dataChannel, uint32_t recvBufferSize) asm("Attach__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe18EndpointDescriptorUsUcUi")
Attaches an endpoint to a specified node.
uint32_t reason
The reason why the status has changed.
nn::Result PollStateChange(uint8_t flags) asm("PollStateChange__Q3_2nn3uds4CafeFUc")
Checks if new data can be retrieved through GetConnectionStatus, and waits until new data is availabl...
static constexpr uint32_t kWorkMemorySize
Recommended size to use for work memory buffer.
nn::Result CreateNetwork(uint8_t id8, uint8_t maxNodes, uint32_t localCommunicationId, const char *passphrase, uint32_t passphraseSize, uint8_t channel) asm("CreateNetwork__Q3_2nn3uds4CafeFUcT1UiPCcT3T1")
Creates a new network with the given parameters.
nn::Result DisallowToConnect(bool unknown) asm("DisallowToConnect__Q3_2nn3uds4CafeFb")
Prevents clients from connecting to the network.
nn::Result ReceiveFrom(const EndpointDescriptor &fd, void *buf, uint32_t *receivedSize, uint16_t *networkNodeId, uint32_t size, uint8_t flags) asm("ReceiveFrom__Q3_2nn3uds4CafeFRCQ4_2nn3uds4Cafe18EndpointDescriptorPvPUiPUsUiUc")
Receives data from the specified endpoint.
@ UDS_RECEIVE_NONBLOCK
Prevents Receive from blocking if no new data is available.
uint16_t changedNodes
Bitmask of nodes that have changed.
uint16_t nodes[UDS_MAX_NODES]
Array of nodes connected to the network.
uint8_t maxNodes
Maximum number of nodes that can connect to the network, including the host.
uint32_t EndpointDescriptor
Describes a network endpoint.
nn::Result GetApplicationDataFromBeacon(void *appData, uint32_t *readSize, uint32_t size) asm("GetApplicationDataFromBeacon__Q3_2nn3uds4CafeFPvPUiUi")
Gets the application data from the network.
uint32_t CreateLocalCommunicationId(uint32_t uniqueId, bool unknown) asm("CreateLocalCommunicationId__Q3_2nn3uds4CafeFUib")
Creates a local communication ID based on the given paramaters.
nn::Result SetApplicationDataToBeacon(const void *appData, uint32_t size) asm("SetApplicationDataToBeacon__Q3_2nn3uds4CafeFPCvUi")
Sets the application data to the network.
nn::Result GetNodeInformation(NodeInformation *info, uint16_t networkNodeId) asm("GetNodeInformation__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe15NodeInformationUs")
Gets information about a specified node.
nn::Result DestroyEndpoint(EndpointDescriptor *fd) asm("DestroyEndpoint__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe18EndpointDescriptor")
Destroys the given endpoint.
void Finalize() asm("Finalize__Q3_2nn3uds4CafeFv")
Finalizes UDS.
uint32_t status
The network status.
nn::Result Receive(const EndpointDescriptor &fd, void *buf, uint32_t *receivedSize, uint32_t size, uint8_t flags) asm("Receive__Q3_2nn3uds4CafeFRCQ4_2nn3uds4Cafe18EndpointDescriptorPvPUiUiUc")
Receives data from the specified endpoint.
uint16_t nodeBitmask
Bitmask of nodes connected to the network.
uint8_t totalNodes
Total amount of nodes connected to the network.
Stores the connection status of the network.