nn::uds::CTR::Scan Function

Syntax

nn::Result Scan(
     void * pBuffer,
     size_t bufferSize,
     u8 subId,
     bit32 localId
);

Arguments

Name Description
out pBuffer Discovered network information storage location. Stored in order of received signal strength, from strongest to weakest.
in bufferSize Buffer size. Estimate roughly 1KB per network.
in subId Communication mode ID. Can be freely set by the application. Specify 0xff to search all sub IDs.
in localId The local communication ID. Specify the value generated by CreateLocalCommunicationId.

Return Values

Returns the function's execution result. Returns one of the Result values listed below.

Value Description
Result::IsSuccess Succeeded in creating local communication, and the network information found in the buffer was stored.
ResultNotInitialized The library is not initialized. Execute the 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 the specifiable range. It is possible it will succeed if you re-execute with an appropriate value for the argument.
ResultWirelessOff Entered wireless-disabled mode. Re-initialization is required.
A value other than the above Failed for reasons other than those given above.

Description

Scans for nearby networks.

By default, this requires 330 ms to complete.

This function is thread-safe.

Revision History

2012/04/13
Added note that the network information is stored in order of received signal strength, from strongest to weakest.
2011/09/07
Standardized notation for wireless-disabled mode.
2011/02/21
Added the default time to the Description.
2011/01/25
Restricted function to automatically scan all channels. The previous function can still be used as is for backwards compatibility, but note that connectivity can be substantially impaired if only one channel has been scanned in a production version.
2010/10/15
Expanded the information on the return values. Revised the Description to make it easier to understand.
2010/06/14
Initial version.

CONFIDENTIAL