CTR Pia
4.11.3
Game Communication Engine
|
Class for handling the local network. More...
Public Types |
Public Member Functions | |
nn::Result | AllowParticipating () |
Allows new clients to join the network. More... | |
nn::Result | CancelConnectNetworkAsync () |
Cancels ConnectNetworkAsync asynchronous processes. More... | |
nn::Result | CancelScanNetworkAsync () |
Cancels ScanNetworkAsync asynchronous processes. More... | |
void | Cleanup () |
Cleanup process. More... | |
nn::Result | ConnectNetworkAsync (const LocalConnectNetworkSetting *pConnectNetworkSetting) |
Connects to the local network. More... | |
u32 | CreateLocalCommunicationId (u32 uniqueId, bool isTrial=false) const |
Creates a local communication ID from a unique ID. More... | |
nn::Result | CreateNetworkAsync (const LocalCreateNetworkSetting *pCreateNetworkSetting) |
Creates the local network. More... | |
nn::Result | DestroyNetworkAsync () |
Destroys the local network. More... | |
nn::Result | DisallowParticipating (bool isDisallowToReconnect=true) |
Disallows new clients from joining the network. This function does not affect clients that are currently connected. More... | |
nn::Result | DisconnectNetworkAsync () |
Disconnects from the local network. More... | |
void | Finalize () |
Finalizes the instance. More... | |
AllowParticipatingState | GetAllowParticipatingState () const |
Gets the state that indicates whether new participants are allowed or denied. More... | |
nn::Result | GetApplicationData (void *pBuffer, size_t *pDataSize, size_t bufferSize, const LocalNetworkDescription *pNetworkDescription) const |
Gets the beacon data set by the application. More... | |
nn::Result | GetApplicationDataFromBeacon (void *pBuffer, size_t *pDataSize, size_t bufferSize) const |
Gets the data set in the beacon. More... | |
nn::Result | GetApplicationDataSize (size_t *pDataSize, const LocalNetworkDescription *pNetworkDescription) const |
Gets the size of the beacon data set by the application. More... | |
nn::Result | GetApplicationDataSizeFromBeacon (size_t *pDataSize) const |
Gets the size of the data set in the beacon. More... | |
nn::Result | GetAroundNetworkInfoList (LocalAroundNetworkInfo *paLocalAroundNetworkInfoList, u32 *pValidNetworkNum, size_t networkInfoListSize) const |
Gets the information for networks discovered during nearby network search. More... | |
size_t | GetBeaconApplicationDataSizeMax () const |
Gets the largest size of data the application can set in the beacon. More... | |
nn::Result | GetConnectNetworkResult () |
Gets the result of ConnectNetworkAsync asynchronous processing. More... | |
nn::Result | GetCreateNetworkResult () |
Gets the result of CreateNetworkAsync asynchronous processing. More... | |
nn::Result | GetDestroyNetworkResult () |
Gets the result of DestroyNetworkAsync asynchronous processing. More... | |
nn::Result | GetDisconnectNetworkResult () |
Gets the result of DisconnectNetworkAsync asynchronous processing. More... | |
DisconnectReason | GetDisconnectReason () |
Gets the reason for being disconnected from the network. More... | |
u32 | GetFoundNetworkNum () const |
Gets the number of networks discovered. More... | |
u8 | GetLinkLevel () const |
Gets the link level. More... | |
u8 | GetNetworkChannel () const |
Gets the IEEE 802.11b/g wireless channel in use. More... | |
nn::Result | GetNetworkDescription (LocalNetworkDescription *pLocalNetworkDescription, u32 networkDescriptionIndex) |
Gets the local network information. More... | |
nn::Result | GetNetworkDescriptionList (LocalNetworkDescription *paLocalNetworkDescriptionList, u32 *pValidNetworkNum, size_t networkDescriptionListSize) |
Gets the local network information. More... | |
nn::Result | GetRadioStrength (u8 *pRadioStrength, u32 descriptionListIndex) const |
Parses a network and gets the signal strength sent from that network. More... | |
nn::Result | GetScanNetworkResult () |
Gets the result of ScanNetworkAsync asynchronous processing. More... | |
nn::Result | GetStationInfo (LocalStationInfo *pLocalStationInfo, const common::StationAddress &address) const |
Gets information about the specified station. More... | |
nn::Result | GetStationInfoList (LocalStationInfo *paLocalStationInfoList, u8 listLength, u32 networkListIndex) const |
Gets a list of information about the stations participating in the specified network. More... | |
nn::Result | Initialize (const LocalNetworkSetting &setting) |
Initializes the instance. Make this call between the BeginSetup and EndSetup functions. More... | |
bool | IsAroundNetworkSearchActivated () const |
Gets whether nearby network search has begun. More... | |
bool | IsClient () const |
Gets whether the local device is a local network client. More... | |
bool | IsCompletedConnectNetwork () |
Checks the completion of ConnectNetworkAsync asynchronous processing. More... | |
bool | IsCompletedCreateNetwork () |
Checks the completion of CreateNetworkAsync asynchronous processing. More... | |
bool | IsCompletedDestroyNetwork () |
Checks the completion of DestroyNetworkAsync asynchronous processing. More... | |
bool | IsCompletedDisconnectNetwork () |
Checks the completion of DisconnectNetworkAsync asynchronous processing. More... | |
bool | IsCompletedScanNetwork () |
Checks the completion of ScanNetworkAsync asynchronous processing. More... | |
bool | IsConnected () const |
Gets whether there is a connection to the network. More... | |
bool | IsDuringHostMigration () const |
Gets whether local host migration is in progress. More... | |
bool | IsEnableAroundNetworkSearch () const |
Gets whether nearby network search is enabled. More... | |
bool | IsEnableHostMigration () const |
Gets whether local host migration is enabled. More... | |
bool | IsHost () const |
Gets whether the local device is the local network host. More... | |
nn::Result | ScanNetworkAsync (u32 localCommunicationId, u8 subId) |
Scans for nearby local networks. More... | |
nn::Result | SetApplicationDataToBeacon (const void *pData, size_t dataSize) |
Sets data in the beacon. More... | |
nn::Result | SetAroundNetworkSearchSetting (const LocalAroundNetworkSearchSetting &setting) |
Sets the parameters for nearby network search. More... | |
nn::Result | StartAroundNetworkSearch () |
Begins nearby network search. More... | |
nn::Result | Startup () |
Startup process. More... | |
nn::Result | StopAroundNetworkSearch () |
Terminates nearby network search. More... | |
virtual void | Trace (u64 flag) const |
Prints information that is useful for debugging. More... | |
Static Public Member Functions | |
static nn::Result | CreateInstance () |
Creates the LocalNetwork class instance (singleton pattern). More... | |
static void | DestroyInstance () |
Destroys the LocalNetwork class instance (singleton pattern). | |
static LocalNetwork * | GetInstance () |
Gets the LocalNetwork class instance (singleton pattern). More... | |
Class for handling the local network.
2014-10-23 The Initialize
function now stops on an assert if device memory is passed to Pia.
2014-03-03 Initial version.
Represents the state that allows or denies new participants.
Enumerates the reason for the disconnection.
nn::Result nn::pia::local::LocalNetwork::AllowParticipating | ( | ) |
Allows new clients to join the network.
This function re-enables connections from new clients that were denied by the DisallowParticipating
function.
Result
value indicating success on successful completion.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Or, it was disconnected from the local network. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::CancelConnectNetworkAsync | ( | ) |
Cancels ConnectNetworkAsync
asynchronous processes.
This function cancels asynchronous processes started by ConnectNetworkAsync
. The cancel process advances by periodically calling the nn::pia::common::Scheduler::Dispatch
function. The library promptly cancels asynchronous processes after this function is called, but use the IsCompletedConnectNetwork
function to check whether the cancellation has completed.
ConnectNetworkAsync
asynchronous processing. On success, returns a Result
value for which the IsSuccess
function returns true
. If this function call fails, one or more of the following Result
values is returned. ResultInvalidState
Returned when no ConnectNetworkAsync
asynchronous processing is being performed. Programming error. Fix your program so that this error is not returned.nn::Result nn::pia::local::LocalNetwork::CancelScanNetworkAsync | ( | ) |
Cancels ScanNetworkAsync
asynchronous processes.
This function cancels asynchronous processes started by ScanNetworkAsync
. The cancel process advances by periodically calling the nn::pia::common::Scheduler::Dispatch
function. The library promptly cancels asynchronous functions after this function is called, but use the IsCompletedScanNetwork
function to check whether the cancellation has completed.
ScanNetworkAsync
asynchronous processing. On success, returns a Result
value for which the IsSuccess
function returns true
. If this function call fails, one or more of the following Result
values is returned. ResultInvalidState
Returned when no ConnectNetworkAsync
asynchronous processing is being performed. Programming error. Fix your program so that this error is not returned.void nn::pia::local::LocalNetwork::Cleanup | ( | ) |
Cleanup process.
nn::Result nn::pia::local::LocalNetwork::ConnectNetworkAsync | ( | const LocalConnectNetworkSetting * | pConnectNetworkSetting | ) |
Connects to the local network.
Starts an asynchronous process that connects to the local network. The device that connects becomes a local host client. The started process advances by periodically calling the nn::pia::common::Scheduler::Dispatch
function. Use IsCompletedConnectNetwork
to check whether the process has completed and GetConnectNetworkResult
to check the result. You can also cancel the process by calling the CancelConnectNetworkAsync
function during the process. Even if you cancel the process, wait until you confirm the process completion using IsCompletedConnectNetwork
. If you get results that indicate that the process failed (or was canceled), clean up LocalNetwork
and start it again.
[in] | pConnectNetworkSetting | Settings for the network to connect to. |
Result
value for which the IsSuccess
function returns true
if the process is successfully started.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that processes are already running. Alternatively, another asynchronous process is running. Or, the station is already connected. Programming error. Fix your program so that this error is not returned.
ResultDifferentVersion
Indicates a different application version or the local network version of the target network. Perform cleanup.
|
static |
Creates the LocalNetwork
class instance (singleton pattern).
Result
value that indicates success if the instance is created successfully.ResultNotInitialized
Indicates that the local
module is not initialized.
ResultInvalidState
Indicates that the instance was created at the wrong time.
ResultAlreadyExists
Indicates that an instance has already been created.
u32 nn::pia::local::LocalNetwork::CreateLocalCommunicationId | ( | u32 | uniqueId, |
bool | isTrial = false |
||
) | const |
Creates a local communication ID from a unique ID.
This function generates a 32-bit value (the local communication ID) to use for local communication from the 20-bit unique ID (the title-specific ID) assigned by the Nintendo Licensing department. If you have not been assigned a unique ID by the Nintendo Licensing department, use one of the unique IDs for game software prototypes (0xFF000
through 0xFF3FF
).
[in] | uniqueId | Specifies a unique ID. To communicate more than one title, specify the unique ID of any of the titles. |
[in] | isTrial | Specifies the flag for handling cases where the same unique ID is shared by both the final product and trial version. If you do not want the final product and trial version to communicate with each other, specify a value of true for trial versions. Note: Always set this flag to false in retail products. |
nn::Result nn::pia::local::LocalNetwork::CreateNetworkAsync | ( | const LocalCreateNetworkSetting * | pCreateNetworkSetting | ) |
Creates the local network.
Receives the network settings and starts the asynchronous process that creates the local network. The device that creates the network becomes the local network host. The started process advances by periodically calling the nn::pia::common::Scheduler::Dispatch
function. Use IsCompletedCreateNetwork
to check whether the process has completed and GetCreateNetworkResult
to check the result.
[in] | pCreateNetworkSetting | Settings for the network to create. |
Result
value for which the IsSuccess
function returns true
if the process is successfully started.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that processes are already running. Alternatively, another asynchronous process is running. Or, the station is already connected. Programming error. Fix your program so that this error is not returned.
ResultErrorOccurred
Indicates that an internal error occurred. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::DestroyNetworkAsync | ( | ) |
Destroys the local network.
Starts an asynchronous process that destroys the local network. The started process advances by periodically calling the nn::pia::common::Scheduler::Dispatch
function. Use IsCompletedDestroyNetwork
to check whether the process has completed and GetDestroyNetworkResult
to check the result. After the process is completed, clean up LocalNetwork
.
Result
value for which the IsSuccess
function returns true
if the process is successfully started.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that processes are already running. Alternatively, another asynchronous process is running. Alternatively, the device is not the local network host. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::local::LocalNetwork::DisallowParticipating | ( | bool | isDisallowToReconnect = true | ) |
Disallows new clients from joining the network. This function does not affect clients that are currently connected.
This feature is intended to deny connections by new clients attempting to connect during interactive gaming. When you want to allow connections again, call the AllowParticipating
function.
[in] | isDisallowToReconnect | If set to false , only the clients that were disconnected after calling this function can reconnect. |
Result
value indicating success on successful completion.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Or, it was disconnected from the local network. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::DisconnectNetworkAsync | ( | ) |
Disconnects from the local network.
Starts an asynchronous process that disconnects from the local network. When the local device is the local network host, this function succeeds if host migration is enabled, and the manual host migration process starts. The started process advances by periodically calling the nn::pia::common::Scheduler::Dispatch
function. Use IsCompletedDisconnectNetwork
to check whether the process has completed and GetDisconnectNetworkResult
to check the result. After the process is completed, clean up LocalNetwork
.
Result
value for which the IsSuccess
function returns true
if the process is successfully started.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that processes are already running. Alternatively, another asynchronous process is running. Alternatively, the local device is the local network host, but host migration is disabled. Programming error. Fix your program so that this error is not returned.
void nn::pia::local::LocalNetwork::Finalize | ( | ) |
Finalizes the instance.
AllowParticipatingState nn::pia::local::LocalNetwork::GetAllowParticipatingState | ( | ) | const |
Gets the state that indicates whether new participants are allowed or denied.
nn::Result nn::pia::local::LocalNetwork::GetApplicationData | ( | void * | pBuffer, |
size_t * | pDataSize, | ||
size_t | bufferSize, | ||
const LocalNetworkDescription * | pNetworkDescription | ||
) | const |
Gets the beacon data set by the application.
[out] | pBuffer | Buffer that stores the data obtained. |
[out] | pDataSize | Specifies the size of the data obtained. |
[in] | bufferSize | The size of the buffer that stores the data obtained. |
[in] | pNetworkDescription | The information for the network whose data you want to get. |
Result
value indicating success if data was successfully obtained from the network.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultNoData
There was no data to get.
nn::Result nn::pia::local::LocalNetwork::GetApplicationDataFromBeacon | ( | void * | pBuffer, |
size_t * | pDataSize, | ||
size_t | bufferSize | ||
) | const |
Gets the data set in the beacon.
LocalNetwork::IsDuringHostMigration
function returns true
).[out] | pBuffer | Specifies the buffer to write data to. |
[out] | pDataSize | Specifies the length of the retrieved data. |
[in] | bufferSize | Specifies the size of the buffer to write data to. |
Result
value indicating success on successful completion.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
ResultNotInCommunication
In a state where communication is not possible. Either a disconnect will shortly be detected, or host migration is about to begin. The function may succeed if called after host migration completes.
nn::Result nn::pia::local::LocalNetwork::GetApplicationDataSize | ( | size_t * | pDataSize, |
const LocalNetworkDescription * | pNetworkDescription | ||
) | const |
Gets the size of the beacon data set by the application.
[out] | pDataSize | Specifies the size of the beacon data set by the application. |
[in] | pNetworkDescription | The information for the network whose beacon data size you want to get. |
Result
value indicating success if data was successfully obtained from the network.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultNoData
There was no data to get.
nn::Result nn::pia::local::LocalNetwork::GetApplicationDataSizeFromBeacon | ( | size_t * | pDataSize | ) | const |
Gets the size of the data set in the beacon.
LocalNetwork::IsDuringHostMigration
function returns true
).[out] | pDataSize | The size of the data set in the beacon. |
Result
value indicating success on successful completion.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
ResultNotInCommunication
In a state where communication is not possible. Either a disconnect will shortly be detected, or host migration is about to begin. The function may succeed if called after host migration completes.
nn::Result nn::pia::local::LocalNetwork::GetAroundNetworkInfoList | ( | LocalAroundNetworkInfo * | paLocalAroundNetworkInfoList, |
u32 * | pValidNetworkNum, | ||
size_t | networkInfoListSize | ||
) | const |
Gets the information for networks discovered during nearby network search.
Also succeeds if zero networks were discovered. Only succeeds when nearby network search is enabled.
[out] | paLocalAroundNetworkInfoList | The buffer storing the obtained network information. |
[out] | pValidNetworkNum | The number of networks for which network information was obtained. |
[in] | networkInfoListSize | The size of the buffer storing the obtained network information. |
Result
value indicating that information was obtained successfully.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
size_t nn::pia::local::LocalNetwork::GetBeaconApplicationDataSizeMax | ( | ) | const |
Gets the largest size of data the application can set in the beacon.
nn::Result nn::pia::local::LocalNetwork::GetConnectNetworkResult | ( | ) |
Gets the result of ConnectNetworkAsync
asynchronous processing.
This function gets the results after an asynchronous process started by ConnectNetworkAsync
ends.
ConnectNetworkAsync
asynchronous processing. On success, returns a Result
value for which the IsSuccess
function returns true
. If this function call fails, one or more of the following Result
values is returned. ResultNotInitialized
Indicates that the communication library is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Alternatively, results cannot be obtained in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidNetwork
Indicates that the connection target network was not found. Perform cleanup.
ResultNetworkIsFull
The maximum number of connections has already been exceeded. Perform cleanup.
ResultJoinRequestDenied
The host denied the attempt to join. Perform cleanup. Handle appropriately in the application. When an error occurs in Internet communication, If this error occurs during Internet communication, convert to a network error code and display in the error viewer applet/EULA applet. However, during local communication, do not display it as an error with error code in the error viewer applet/EULA applet. Do not use the error/EULA applet (CTR) for local communication errors.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
ResultTimeOut
Timed out. It could also be returned when nn::pia::local::UdsConnectNetworkSetting::m_Passphrase
is incorrect. Perform cleanup.
ResultCancelled
Canceled. Perform cleanup.
ResultErrorOccurred
Indicates that an internal error occurred. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::GetCreateNetworkResult | ( | ) |
Gets the result of CreateNetworkAsync
asynchronous processing.
This function gets the results after an asynchronous process started by CreateNetworkAsync
ends.
CreateNetworkAsync
asynchronous processing. On success, returns a Result
value for which the IsSuccess
function returns true
. If this function call fails, one or more of the following Result
values is returned. ResultNotInitialized
Indicates that the communication library is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Alternatively, results cannot be obtained in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
ResultTimeOut
Timed out. Perform cleanup.
ResultCancelled
Canceled. Perform cleanup.
ResultErrorOccurred
Indicates that an internal error occurred. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::GetDestroyNetworkResult | ( | ) |
Gets the result of DestroyNetworkAsync
asynchronous processing.
This function gets the results after an asynchronous process started by DestroyNetworkAsync
ends.
DestroyNetworkAsync
asynchronous processing. On success, returns a Result
value for which the IsSuccess
function returns true
. If this function call fails, one or more of the following Result
values is returned. ResultNotInitialized
Indicates that the communication library is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Alternatively, results cannot be obtained in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
ResultCancelled
Canceled. Perform cleanup.
ResultErrorOccurred
Indicates that an internal error occurred. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::GetDisconnectNetworkResult | ( | ) |
Gets the result of DisconnectNetworkAsync
asynchronous processing.
This function gets the results after an asynchronous process started by DisconnectNetworkAsync
ends.
DisconnectNetworkAsync
asynchronous processing. On success, returns a Result
value for which the IsSuccess
function returns true
. If this function call fails, one or more of the following Result
values is returned. ResultNotInitialized
Indicates that the communication library is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Alternatively, results cannot be obtained in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
ResultCancelled
Canceled. Perform cleanup.
ResultErrorOccurred
Indicates that an internal error occurred. Perform cleanup.
|
inline |
Gets the reason for being disconnected from the network.
Resets to DISCONNECT_REASON_BEFORE_COMMUNICATION
when Startup
or Cleanup
is called.
|
inline |
Gets the number of networks discovered.
|
inlinestatic |
Gets the LocalNetwork
class instance (singleton pattern).
Returns a NULL
pointer if the instance has not yet been created using the Initialize
function.
LocalNetwork
instance. u8 nn::pia::local::LocalNetwork::GetLinkLevel | ( | ) | const |
Gets the link level.
There are four link levels, from 0
through 3
. 0
: Communication quality is extremely poor, or communication has not been established. 1
: Communication quality is poor. 2
: Communication quality is not very good. 3
: Communication quality is good.
LocalNetwork::IsDuringHostMigration
function returns true
).0
is returned. u8 nn::pia::local::LocalNetwork::GetNetworkChannel | ( | ) | const |
Gets the IEEE 802.11b/g wireless channel in use.
LocalNetwork::IsDuringHostMigration
function returns true
).0
is returned. nn::Result nn::pia::local::LocalNetwork::GetNetworkDescription | ( | LocalNetworkDescription * | pLocalNetworkDescription, |
u32 | networkDescriptionIndex | ||
) |
Gets the local network information.
Gets the local network information discovered by the ScanNetworkAsync
function.
[out] | pLocalNetworkDescription | Specifies the buffer that stores the network information obtained. |
[in] | networkDescriptionIndex | The index of the network information you want to get. |
Result
value indicating success if information was successfully obtained.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::local::LocalNetwork::GetNetworkDescriptionList | ( | LocalNetworkDescription * | paLocalNetworkDescriptionList, |
u32 * | pValidNetworkNum, | ||
size_t | networkDescriptionListSize | ||
) |
Gets the local network information.
Gets a list of the local network information discovered by the ScanNetworkAsync
function.
[out] | paLocalNetworkDescriptionList | Specifies the buffer that stores the obtained network information. |
[out] | pValidNetworkNum | The number of networks for which network information was obtained. |
[in] | networkDescriptionListSize | The size of the buffer that stores the obtained network information. |
Result
value indicating success if information was successfully obtained.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Not in a state where data can be retrieved. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::local::LocalNetwork::GetRadioStrength | ( | u8 * | pRadioStrength, |
u32 | descriptionListIndex | ||
) | const |
Parses a network and gets the signal strength sent from that network.
There are four levels of signal strength, from 0
through 3
. 0
: Communication quality is extremely poor, or communication has not been established. 1
: Communication quality is poor. 2
: Communication quality is not very good. 3
: Communication quality is good.
ScanNetworkAsync
is executed. To get the saved local network information list, use the GetNetworkDescriptionList
function.[out] | pRadioStrength | Specifies a pointer to the variable that records the signal strength. The data is stored only if the network can be analyzed correctly. |
[in] | descriptionListIndex | Specifies the variable for specifying the network to parse. Specify the network number you want to analyze by index, starting from 0 for the first entry in the local network information list. |
Result
value indicating success on successful completion.ResultInvalidState
No information is stored in the local network information list. Alternatively, data cannot be obtained in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::local::LocalNetwork::GetScanNetworkResult | ( | ) |
Gets the result of ScanNetworkAsync
asynchronous processing.
This function gets the results after an asynchronous process started by ScanNetworkAsync
ends.
ScanNetworkAsync
asynchronous processing. On success, returns a Result
value for which the IsSuccess
function returns true
. If this function call fails, one or more of the following Result
values is returned. ResultNotInitialized
Indicates that the communication library is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Alternatively, results cannot be obtained in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
ResultNegligibleFault
Canceled.
ResultErrorOccurred
Indicates that an internal error occurred. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::GetStationInfo | ( | LocalStationInfo * | pLocalStationInfo, |
const common::StationAddress & | address | ||
) | const |
Gets information about the specified station.
[out] | pLocalStationInfo | Specifies the buffer that stores the station information obtained. |
[in] | address | The address of the station whose information you want to get. |
Result
value indicating success if information was successfully obtained.ResultNotInitialized
Indicates LocalNetwork
has not been started. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultNotFound
The target station was not found. You might have been disconnected.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::GetStationInfoList | ( | LocalStationInfo * | paLocalStationInfoList, |
u8 | listLength, | ||
u32 | networkListIndex | ||
) | const |
Gets a list of information about the stations participating in the specified network.
[out] | paLocalStationInfoList | Specifies the buffer that stores the list of station information obtained. The array length must be equal to or greater than the maximum number of stations that can connect to the specified network. |
[in] | listLength | Specifies the length of the paLocalStationInfoList array. This must be equal to or greater than the maximum number of stations that can connect to the specified network. |
[in] | networkListIndex | The index of the network whose information you want to get. |
Result
value indicating success if information was successfully obtained.ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that no networks are found. Alternatively, data cannot be obtained in this state. Programming error. Fix your program so that this error is not returned.
ResultNoData
Indicates that information could not be obtained.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::Initialize | ( | const LocalNetworkSetting & | setting | ) |
Initializes the instance. Make this call between the BeginSetup
and EndSetup
functions.
LocalNetwork
receive buffer, so common::Initialize
stops on an assert if device memory is passed.[in] | setting | Specifies various settings. |
Result
value for which the IsSuccess
function returns true
if execution succeeds. You must make sure that the implementation of this function in your application does not return any errors.ResultAlreadyInitialized
Indicates that the instance is already initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
bool nn::pia::local::LocalNetwork::IsAroundNetworkSearchActivated | ( | ) | const |
Gets whether nearby network search has begun.
bool nn::pia::local::LocalNetwork::IsClient | ( | ) | const |
Gets whether the local device is a local network client.
bool nn::pia::local::LocalNetwork::IsCompletedConnectNetwork | ( | ) |
Checks the completion of ConnectNetworkAsync
asynchronous processing.
This function checks the completion of asynchronous processes started with ConnectNetworkAsync
.
true
if the asynchronous process has completed; false
otherwise. Returns false
if the asynchronous process has not started or if another asynchronous process has been started.bool nn::pia::local::LocalNetwork::IsCompletedCreateNetwork | ( | ) |
Checks the completion of CreateNetworkAsync
asynchronous processing.
This function checks the completion of asynchronous processes started with CreateNetworkAsync
.
true
if the asynchronous process has completed; false
otherwise. Returns false
if the asynchronous process has not started or if another asynchronous process has been started.bool nn::pia::local::LocalNetwork::IsCompletedDestroyNetwork | ( | ) |
Checks the completion of DestroyNetworkAsync
asynchronous processing.
This function checks the completion of asynchronous processes started with DestroyNetworkAsync
.
true
if the asynchronous process has completed; false
otherwise. Returns false
if the asynchronous process has not started or if another asynchronous process has been started.bool nn::pia::local::LocalNetwork::IsCompletedDisconnectNetwork | ( | ) |
Checks the completion of DisconnectNetworkAsync
asynchronous processing.
This function checks the completion of asynchronous processes started with DisconnectNetworkAsync
.
true
if the asynchronous process has completed; false
otherwise. Returns false
if the asynchronous process has not started or if another asynchronous process has been started.bool nn::pia::local::LocalNetwork::IsCompletedScanNetwork | ( | ) |
Checks the completion of ScanNetworkAsync
asynchronous processing.
This function checks the completion of asynchronous processes started with ScanNetworkAsync
.
true
if the asynchronous process has completed; false
otherwise. Returns false
if the asynchronous process has not started or if another asynchronous process has been started.
|
inline |
Gets whether there is a connection to the network.
false
could be returned during host migration (while the LocalNetwork::IsDuringHostMigration
function returns true
).bool nn::pia::local::LocalNetwork::IsDuringHostMigration | ( | ) | const |
Gets whether local host migration is in progress.
bool nn::pia::local::LocalNetwork::IsEnableAroundNetworkSearch | ( | ) | const |
Gets whether nearby network search is enabled.
bool nn::pia::local::LocalNetwork::IsEnableHostMigration | ( | ) | const |
Gets whether local host migration is enabled.
bool nn::pia::local::LocalNetwork::IsHost | ( | ) | const |
Gets whether the local device is the local network host.
nn::Result nn::pia::local::LocalNetwork::ScanNetworkAsync | ( | u32 | localCommunicationId, |
u8 | subId | ||
) |
Scans for nearby local networks.
Starts an asynchronous process that scans for nearby local networks. Fails if called while connecting to a network. The started process advances by periodically calling the nn::pia::common::Scheduler::Dispatch
function. Use IsCompletedScanNetwork
to check whether the process has completed and GetScanNetworkResult
to check the result. You can also cancel the process by calling the CancelScanNetworkAsync
function during the process. Even if you cancel the process, wait until you can confirm the process completion using IsCompletedScanNetwork
. Use GetNetworkDescriptionList
and GetNetworkDescription
to get information on the local networks that were found through scanning. Use GetStationInfoList
to get information on the connected stations that were found through scanning. Get the strength of the signal sent from the network by calling GetRadioStrength
. These items of information become available after the network scanning ends successfully. If scanning starts again, they can no longer be obtained. The information is also no longer available when you begin the process of creating or connecting to a network.
[in] | localCommunicationId | Specifies the local communication ID. Specify the value generated by CreateLocalCommunicationId . |
[in] | subId | Specifies the ID for identifying the communication mode. The application can set any arbitrary value for this parameter. To search all IDs, specify 0xff . |
Result
value for which the IsSuccess
function returns true
if the process is successfully started.ResultNotInitialized
Indicates that the LocalNetwork
is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that processes are already running. Alternatively, another asynchronous process is running. Alternatively, the system is already connected to the network. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::local::LocalNetwork::SetApplicationDataToBeacon | ( | const void * | pData, |
size_t | dataSize | ||
) |
Sets data in the beacon.
Only the local network host can execute this function.
LocalNetwork::IsDuringHostMigration
function returns true
).[in] | pData | Specifies a pointer to the data to set. |
[in] | dataSize | Specifies the size of the data to set. The size must be no greater than the value that can be obtained with GetBeaconApplicationDataSizeMax . |
Result
value indicating success on successful completion.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
ResultInvalidArgument
Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.
ResultInvalidConnection
Indicates that the device entered wireless off mode. Or, it was disconnected from the local network. Perform cleanup.
nn::Result nn::pia::local::LocalNetwork::SetAroundNetworkSearchSetting | ( | const LocalAroundNetworkSearchSetting & | setting | ) |
Sets the parameters for nearby network search.
Settings are not shared with other stations. To do so, configure each and every station. Only succeeds when nearby network search is enabled.
[in] | setting | The parameters for nearby network search. |
Result
value indicating a successful setting was made.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::local::LocalNetwork::StartAroundNetworkSearch | ( | ) |
Begins nearby network search.
Only the local network host can execute this function. Only succeeds when nearby network search is enabled. After this API is called, start notification is also sent to the clients.
Result
value indicating a successful start to nearby network search.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::local::LocalNetwork::Startup | ( | ) |
Startup process.
Result
value for which the IsSuccess
function returns true
if execution succeeds.ResultInvalidConnection
Indicates that the device entered wireless off mode. Perform cleanup.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
nn::Result nn::pia::local::LocalNetwork::StopAroundNetworkSearch | ( | ) |
Terminates nearby network search.
Only the local network host can execute this function. Only succeeds when nearby network search is enabled. After termination, any discovered networks are no longer available. After this API is called, termination notification is also sent to the clients.
Result
value indicating a successful termination to nearby network search.ResultNotInitialized
Indicates that the instance is not initialized. Programming error. Fix your program so that this error is not returned.
ResultInvalidState
Indicates that the function cannot be executed in this state. Programming error. Fix your program so that this error is not returned.
|
virtual |
Prints information that is useful for debugging.
[in] | flag | Specifies the bitwise OR of trace flags. For more information, see the TraceFlag type. |