nn::uds::CTR::CreateNetwork Function

Syntax

nn::Result CreateNetwork(
     u8 subId,
     u8 maxEntry,
     bit32 localId,
     const char passphrase[],
     size_t passphraseLength,
     u8 channel = 0
);

Arguments

Name Description
in subId Communication mode ID. The application can set any arbitrary value for this.
in maxEntry Maximum number of nodes that can connect to the network. This value can be up to 12, including the local device.
in localId The local communication ID. Specify the value generated by CreateLocalCommunicationId.
in passphrase[] String holding the seed of the passphrase to use for wireless layer encryption. With UDS, communication can only be established if uniqueId and passphrase match.
in passphraseLength Passphrase length. Specify a value smaller than 255 (a provisional specification).
in channel The channel to use for communication. Specify channel 0 (automatic), 1, 6, or 11. When this function runs on retail systems, the channel is always selected automatically.

Return Values

Returns the function's execution result. Returns one of the Result values listed below.
Value Description
ResultSuccess Succeeded in creating local communication and began operating as a master.
ResultNotInitialized The library is not initialized. Execute the nn::uds::Initialize function.
ResultInvalidState Not in an executable state. Returned when executed in a state other than STATE_DISCONNECTED.
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

Creates a new network.

Revision History

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

CONFIDENTIAL