wut  v1.7.0
Wii U Toolchain
Data Structures | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
Cafe.h File Reference
#include <wut.h>
#include <nn/result.h>
#include <nn/uds/NodeInformation.h>
#include <nn/cfg/CTR.h>
Include dependency graph for Cafe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ConnectionStatus
 Stores the connection status of the network. More...
 

Namespaces

 nn
 
 nn::uds
 
 nn::uds::Cafe
 

Macros

#define UDS_MAX_NODES   0x10
 Theoretical supported maximum number of nodes connected to a network, including the host. More...
 
#define UDS_BROADCAST_NODE_ID   0xFFFF
 Broadcast node ID, used for sending data to all nodes in the network. 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...
 

Data Structure Documentation

◆ nn::uds::Cafe::ConnectionStatus

struct nn::uds::Cafe::ConnectionStatus

Stores the connection status of the network.

Definition at line 28 of file Cafe.h.

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.