wut
v1.7.0
Wii U Toolchain
|
Data Structures | |
struct | ConnectionStatus |
Stores the connection status of the network. More... | |
struct | NodeInformation |
Stores information about a node. More... | |
struct | ScrambledLocalFriendCode |
Stores data about the scrambled local friend code of a node. More... | |
Typedefs | |
using | EndpointDescriptor = uint32_t |
Describes a network endpoint. More... | |
Enumerations | |
enum | PollStateChangeFlags : uint8_t { UDS_POLL_NONBLOCK = 1 << 0 } |
enum | ReceiveFlags : uint8_t { UDS_RECEIVE_NONBLOCK = 1 << 0 } |
Functions | |
nn::Result | AllowToConnect () asm("AllowToConnect__Q3_2nn3uds4CafeFv") |
Allows clients to connect to the network. More... | |
nn::Result | AllowToSpectate () asm("AllowToSpectate__Q3_2nn3uds4CafeFv") |
Allows clients to spectate the network. More... | |
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. More... | |
uint32_t | CreateLocalCommunicationId (uint32_t uniqueId, bool unknown) asm("CreateLocalCommunicationId__Q3_2nn3uds4CafeFUib") |
Creates a local communication ID based on the given paramaters. More... | |
nn::Result | CreateEndpoint (EndpointDescriptor *fd) asm("CreateEndpoint__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe18EndpointDescriptor") |
Creates a new endpoint. More... | |
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. More... | |
nn::Result | CreateNetwork (uint8_t id8, uint8_t maxNodes, uint32_t localCommunicationId, const char *passphrase, uint32_t passphraseSize, uint8_t channel, const void *appData, uint32_t appDataSize) asm("CreateNetwork__Q3_2nn3uds4CafeFUcT1UiPCcT3T1PCvT3") |
Creates a new network with the given parameters. More... | |
nn::Result | CreateNetwork (uint8_t id8, uint8_t maxNodes, uint32_t localCommunicationId, const char *passphrase, uint32_t passphraseSize, bool unused, uint8_t channel, const void *appData, uint32_t appDataSize) asm("CreateNetwork__Q3_2nn3uds4CafeFUcT1UiPCcT3bT1PCvT3") |
Creates a new network with the given parameters. More... | |
nn::Result | DestroyEndpoint (EndpointDescriptor *fd) asm("DestroyEndpoint__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe18EndpointDescriptor") |
Destroys the given endpoint. More... | |
nn::Result | DestroyNetwork () asm("DestroyNetwork__Q3_2nn3uds4CafeFv") |
Destroys the previously created network. More... | |
nn::Result | DisallowToConnect (bool unknown) asm("DisallowToConnect__Q3_2nn3uds4CafeFb") |
Prevents clients from connecting to the network. More... | |
nn::Result | EjectClient (uint16_t networkNodeId) asm("EjectClient__Q3_2nn3uds4CafeFUs") |
Ejects the specified client from the network. More... | |
nn::Result | EjectSpectator () asm("EjectSpectator__Q3_2nn3uds4CafeFv") |
Ejects all spectators from the network. More... | |
void | Finalize () asm("Finalize__Q3_2nn3uds4CafeFv") |
Finalizes UDS. More... | |
nn::Result | GetApplicationDataFromBeacon (void *appData, uint32_t *readSize, uint32_t size) asm("GetApplicationDataFromBeacon__Q3_2nn3uds4CafeFPvPUiUi") |
Gets the application data from the network. More... | |
nn::Result | GetChannel (uint8_t *channel) asm("GetChannel__Q3_2nn3uds4CafeFPUc") |
Gets the network channel. More... | |
nn::Result | GetConnectionStatus (ConnectionStatus *status) asm("GetConnectionStatus__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe16ConnectionStatus") |
Retrieves the connection status of the network. More... | |
nn::Result | GetNodeInformation (NodeInformation *info, uint16_t networkNodeId) asm("GetNodeInformation__Q3_2nn3uds4CafeFPQ4_2nn3uds4Cafe15NodeInformationUs") |
Gets information about a specified node. More... | |
nn::Result | Initialize (void *workMemory, uint32_t workMemorySize) asm("Initialize__Q3_2nn3uds4CafeFPvUi") |
Initializes UDS. More... | |
nn::Result | Initialize (void *workMemory, uint32_t workMemorySize, nn::cfg::CTR::UserName *username) asm("Initialize__Q3_2nn3uds4CafeFPvUiPQ4_2nn3cfg3CTR8UserName") |
Initializes UDS with the given username. More... | |
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 available if specified. More... | |
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. More... | |
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. More... | |
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. More... | |
nn::Result | SetApplicationDataToBeacon (const void *appData, uint32_t size) asm("SetApplicationDataToBeacon__Q3_2nn3uds4CafeFPCvUi") |
Sets the application data to the network. More... | |
Variables | |
static constexpr uint32_t | kWorkMemorySize = 0x14000 |
Recommended size to use for work memory buffer. More... | |
struct nn::uds::Cafe::ConnectionStatus |
Data Fields | ||
---|---|---|
uint32_t | status | The network status. |
uint32_t | reason | The reason why the status has changed. |
uint16_t | networkNodeId | The network node ID of this device. |
uint16_t | changedNodes | Bitmask of nodes that have changed. |
uint16_t | nodes[UDS_MAX_NODES] | Array of nodes connected to the network. |
uint8_t | totalNodes | Total amount of nodes connected to the network. |
uint8_t | maxNodes | Maximum number of nodes that can connect to the network, including the host. |
uint16_t | nodeBitmask | Bitmask of nodes connected to the network. |
struct nn::uds::Cafe::NodeInformation |
Stores information about a node.
Definition at line 16 of file NodeInformation.h.
Data Fields | ||
---|---|---|
ScrambledLocalFriendCode | scrambledLocalFriendCode | The scrambled local friend code of the node. |
UserName | username | The node username. |
uint16_t | networkNodeId | The network node ID. |
struct nn::uds::Cafe::ScrambledLocalFriendCode |
Stores data about the scrambled local friend code of a node.
Definition at line 14 of file ScrambledLocalFriendCode.h.
using EndpointDescriptor = uint32_t |
enum PollStateChangeFlags : uint8_t |
enum ReceiveFlags : uint8_t |
nn::Result nn::uds::Cafe::AllowToConnect | ( | ) |
Allows clients to connect to the network.
nn::Result nn::uds::Cafe::AllowToSpectate | ( | ) |
Allows clients to spectate the network.
nn::Result nn::uds::Cafe::Attach | ( | EndpointDescriptor * | fd, |
uint16_t | networkNodeId, | ||
uint8_t | dataChannel, | ||
uint32_t | recvBufferSize | ||
) |
Attaches an endpoint to a specified node.
fd | The endpoint descriptor. |
networkNodeId | The network node ID. Use UDS_BROADCAST_NODE_ID to attach to all nodes. |
dataChannel | Data channel to attach to. Must not be 0. |
recvBufferSize | Size to be allocated for the internal buffer for receiving data. Must be greater or equal than 1536 bytes. |
uint32_t nn::uds::Cafe::CreateLocalCommunicationId | ( | uint32_t | uniqueId, |
bool | unknown | ||
) |
Creates a local communication ID based on the given paramaters.
uniqueId | A unique identifier of the current title. This is truncated to 20 bits on the created ID. |
unknown | Enables or disables a flag on the created ID. |
nn::Result nn::uds::Cafe::CreateEndpoint | ( | EndpointDescriptor * | fd | ) |
Creates a new endpoint.
fd | A pointer where the endpoint descriptor is written. |
nn::Result nn::uds::Cafe::CreateNetwork | ( | uint8_t | id8, |
uint8_t | maxNodes, | ||
uint32_t | localCommunicationId, | ||
const char * | passphrase, | ||
uint32_t | passphraseSize, | ||
uint8_t | channel | ||
) |
Creates a new network with the given parameters.
id8 | ID8 to be used on the network. Must not be 0xFF. |
maxNodes | The maximum amount of nodes that will be able to connect to the network, including the host. Must be a number between 2 and 9 inclusively. |
localCommunicationId | Local communication ID used for identifying the network. |
passphrase | Passphrase to be used for the network. |
passphraseSize | Size of the passphrase, including NULL termination. Must be greater than 8 characters and lower than 255 characters inclusively. |
channel | Channel to use for hosting the network. Use 0 to choose a channel automatically. Must be either 0, 1, 6 or 11. |
nn::Result nn::uds::Cafe::CreateNetwork | ( | uint8_t | id8, |
uint8_t | maxNodes, | ||
uint32_t | localCommunicationId, | ||
const char * | passphrase, | ||
uint32_t | passphraseSize, | ||
uint8_t | channel, | ||
const void * | appData, | ||
uint32_t | appDataSize | ||
) |
Creates a new network with the given parameters.
id8 | ID8 to be used on the network. Must not be 0xFF. |
maxNodes | The maximum amount of nodes that will be able to connect to the network, including the host. Must be a number between 2 and 9 inclusively. |
localCommunicationId | Local communication ID used for identifying the network. |
passphrase | Passphrase to be used for the network. |
passphraseSize | Size of the passphrase, including NULL termination. Must be greater than 8 characters and lower than 255 characters inclusively. |
channel | Channel to use for hosting the network. Use 0 to choose a channel automatically. Must be either 0, 1, 6 or 11. |
appData | Pointer to application data. |
appDataSize | Size of application data. Must be lower than 200 bytes inclusively. |
nn::Result nn::uds::Cafe::CreateNetwork | ( | uint8_t | id8, |
uint8_t | maxNodes, | ||
uint32_t | localCommunicationId, | ||
const char * | passphrase, | ||
uint32_t | passphraseSize, | ||
bool | unused, | ||
uint8_t | channel, | ||
const void * | appData, | ||
uint32_t | appDataSize | ||
) |
Creates a new network with the given parameters.
id8 | ID8 to be used on the network. Must not be 0xFF. |
maxNodes | The maximum amount of nodes that will be able to connect to the network, including the host. Must be a number between 2 and 9 inclusively. |
localCommunicationId | Local communication ID used for identifying the network. |
passphrase | Passphrase to be used for the network. |
passphraseSize | Size of the passphrase, including NULL termination. Must be greater than 8 characters and lower than 255 characters inclusively. |
unused | This parameter is unused. |
channel | Channel to use for hosting the network. Use 0 to choose a channel automatically. Must be either 0, 1, 6 or 11. |
appData | Pointer to application data. |
appDataSize | Size of application data. Must be lower than 200 bytes inclusively. |
nn::Result nn::uds::Cafe::DestroyEndpoint | ( | EndpointDescriptor * | fd | ) |
Destroys the given endpoint.
fd | The endpoint descriptor. |
nn::Result nn::uds::Cafe::DestroyNetwork | ( | ) |
Destroys the previously created network.
nn::Result nn::uds::Cafe::DisallowToConnect | ( | bool | unknown | ) |
Prevents clients from connecting to the network.
unknown | Triggers an unknown flag. |
nn::Result nn::uds::Cafe::EjectClient | ( | uint16_t | networkNodeId | ) |
Ejects the specified client from the network.
networkNodeId | The network node ID of the client. Use UDS_BROADCAST_NODE_ID to eject all clients. |
nn::Result nn::uds::Cafe::EjectSpectator | ( | ) |
Ejects all spectators from the network.
void nn::uds::Cafe::Finalize | ( | ) |
Finalizes UDS.
nn::Result nn::uds::Cafe::GetApplicationDataFromBeacon | ( | void * | appData, |
uint32_t * | readSize, | ||
uint32_t | size | ||
) |
Gets the application data from the network.
appData | Buffer where the application data is written. |
readSize | Pointer where the size of the application data is written. |
size | Size of the buffer. |
nn::Result nn::uds::Cafe::GetChannel | ( | uint8_t * | channel | ) |
Gets the network channel.
channel | Pointer where the channel is written. |
nn::Result nn::uds::Cafe::GetConnectionStatus | ( | ConnectionStatus * | status | ) |
Retrieves the connection status of the network.
status | Pointer where the connection status is written. |
nn::Result nn::uds::Cafe::GetNodeInformation | ( | NodeInformation * | info, |
uint16_t | networkNodeId | ||
) |
Gets information about a specified node.
info | Output node information. |
networkNodeId | The network node ID. |
nn::Result nn::uds::Cafe::Initialize | ( | void * | workMemory, |
uint32_t | workMemorySize | ||
) |
Initializes UDS.
The username will be set to the Mii name.
workMemory | Pointer to work memory to be used by UDS. |
workMemorySize | Size of work memory. See kWorkMemorySize for a recomended amount of memory. |
nn::Result nn::uds::Cafe::Initialize | ( | void * | workMemory, |
uint32_t | workMemorySize, | ||
nn::cfg::CTR::UserName * | username | ||
) |
Initializes UDS with the given username.
workMemory | Pointer to work memory to be used by UDS. |
workMemorySize | Size of work memory. See kWorkMemorySize for a recomended amount of memory. |
username | The username to be used. If NULL , the username will be set to the Mii name. |
nn::Result nn::uds::Cafe::PollStateChange | ( | uint8_t | flags | ) |
Checks if new data can be retrieved through GetConnectionStatus
, and waits until new data is available if specified.
flags | Flags, see PollStateChangeFlags for all flags. |
nn::Result nn::uds::Cafe::ReceiveFrom | ( | const EndpointDescriptor & | fd, |
void * | buf, | ||
uint32_t * | receivedSize, | ||
uint16_t * | networkNodeId, | ||
uint32_t | size, | ||
uint8_t | flags | ||
) |
Receives data from the specified endpoint.
fd | The endpoint descriptor. |
buf | Output buffer where the data will be written. |
receivedSize | Pointer where the received size is written. |
networkNodeId | Pointer where the incoming node ID is written. |
size | Size of the buffer. Must be 4-byte aligned. |
flags | Flags, see ReceiveFlags for all flags. |
nn::Result nn::uds::Cafe::Receive | ( | const EndpointDescriptor & | fd, |
void * | buf, | ||
uint32_t * | receivedSize, | ||
uint32_t | size, | ||
uint8_t | flags | ||
) |
Receives data from the specified endpoint.
fd | The endpoint descriptor. |
buf | Output buffer where the data will be written. |
receivedSize | Pointer where the received size is written. |
size | Size of the buffer. Must be 4-byte aligned. |
flags | Flags, see ReceiveFlags for all flags. |
nn::Result nn::uds::Cafe::SendTo | ( | const EndpointDescriptor & | fd, |
const void * | buf, | ||
uint32_t | size, | ||
uint16_t | destNodeId, | ||
uint8_t | dataChannel, | ||
uint8_t | flags | ||
) |
Sends data to the specified node ID through the given data channel.
fd | THe endpoint descriptor. |
buf | Buffer which holds the data to be sent. |
size | Size of the buffer. Must be lower or equal than 1478 bytes. |
destNodeId | The destination node ID. |
dataChannel | The destination data channel. |
flags | Unknown flags. |
nn::Result nn::uds::Cafe::SetApplicationDataToBeacon | ( | const void * | appData, |
uint32_t | size | ||
) |
Sets the application data to the network.
appData | Application data. |
size | Size of application data. Must be lower or equal to 200 bytes. |