nn::uds::CTR::NetworkDescription::GetTemporaryId Member Function

Syntax

u32 GetTemporaryId() const;

Arguments

None.

Return Values

Returns the TemporaryId.

Description

Gets the temporary ID. This ID can be used to identify the network, but instead we recommend that you use the BSSID or the master's NodeInformation.

When a device builds a network and operates as the master, usually a random number is generated and used as the TemporaryID for that network so the network can be distinguished from a network built by the same device and on which local communications have taken place, but on which communications have been broken and resumed.

However, if a TemporaryID is generated every single time a network is built, consider what happens when you implement an algorithm like the one shown below in order to build networks without the end user being aware of whether they are master or client:

1: Become a master (build a network).
2: If cannot find peer to connect with after set period of time, destroy the network.
3: Search for nearby networks, and if a network for the same application exists, connect to that network as a client.
4. If cannot find peer to connect with, repeat these steps.

With this kind of algorithm, devices try to connect based on their search results, but because a TemporaryID is generated every single time a network is built, there are frequent times when peers cannot connect because the master device has rebuilt its network. The upshot is that the implementer is not able to realize the expected behavior.

UDS communication provides for the following exception:

Do not update the TemporaryID when rebuilding the network if no clients are connected and communication between devices has not been established.
(However, if it takes more than 60 seconds to rebuild the network, assume the network being built has no relation to the previous network and go ahead and update the TemporaryID.)


Contact Nintendo if there is a problem implementing this specification in your application.

Revision History

2012/03/13
Added description of time before re-issuing ID to the specification for the TemporaryId.
2012/02/13
Added a specification for TemporaryId.
2011/03/08
Added description of the return value.
2010/06/14
Initial version.

CONFIDENTIAL