nn::uds::CTR::ConnectNetwork Function

Syntax

nn::Result ConnectNetwork(
     const NetworkDescription & networkDescription,
     ConnectType type,
     const char passphrase[],
     size_t passphraseLength
);

Arguments

Name Description
in networkDescription Network information. Obtained from scanning results.
in type Connection type.
in passphrase[] 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 between UDS_PASSPHRASE_LENGTH_MIN and UDS_PASSPHRASE_LENGTH_MAX, inclusive.

Return Values

Returns the function's execution result. Returns one of the Result values listed below.
Value Description
Result::IsSuccess Connection succeeded and operations began for the specified connection type.
ResultNotInitialized The library is not initialized. Execute the Initialize function.
ResultNotFoundNetwork The connection target network was not found: Returned when the network has already been destroyed or when it is outside the range of communications.
ResultAlreadyNetworkIsFull The number of network nodes has already reached the maximum number of connections. You will be unable to connect unless you reduce the number of nodes.
ResultDeniedFromMaster Connection was denied by the master. Returned when the master has denied connection. Also returned when the passphrase is in error.
ResultConnectionTimeout A connection was not established within a set time. Returned when the signal strength is bad or when there is excessive load on the master.
ResultInvalidState Not in an executable state. Returned when executed in a state other than STATE_DISCONNECTED.
ResultOutOfRange The specified argument value was not in the valid range for the argument. It is possible it will succeed if you re-execute with an appropriate value for the argument.
ResultWirelessOff Transitioned to wireless-disabled mode. Re-initialization is required.
A value other than the above Failed for reasons other than those given above.

Description

Connects to an existing network.

It takes longer to connect when the signal strength is poor. Up to approximately 800 ms is required until completion.

Revision History

2011/02/21
Added a timing guideline to the Description.
2011/01/25
Changed size of passphrase used from "fewer than 255 (provisional)" to "at least 8 and no more than 255," and confirmed.
2010/10/15
Expanded the information on the return values.
2010/06/14
Initial version.

CONFIDENTIAL