nn::friends::CTR::Login Function

Syntax

Result Login(
     os::Event * pEvent
);

Arguments

Name Description
in pEvent Specifies a pointer to nn::os::Event, which signals that asynchronous processing is complete. Initialize this ahead of time using the nn::os::Event::Initialize function.

Return Values

Returns the result of the operation.

Value Description
ResultSuccess Successfully started asynchronous processing.
ResultAlreadyDone Successfully started asynchronous processing.
ResultTemporarilyBusy Failed to start asynchronous processing because the internal state was temporarily busy.
ResultAcNotConnected An AC connection request has not been sent.
ResultInvalidPointer An invalid pointer was passed in as an argument.
ResultInvalidHandle An invalid nn::os::Event handle was passed in as an argument.
ResultNotInitialized The friend presence library has not been initialized.
Other Some other result may be returned as a result of factors such as the daemon's internal state.

Description

Requests a login to the server.

If this function returns successfully asynchronous processing begins. The event nn::os::Event specified in the argument is signaled when asynchronous processing completes. Call the nn::friends::CTR::GetLastResponseResult function to get the result of the asynchronous operation. If this function fails, no asynchronous processing occurs.

You must call nn::ac::Connect or nn::ac::ConnectAsync before this function to establish a connection with an access point. This function returns a value of nn::friends::ResultAcNotConnected if it is called while a connection has not been established with an access point.

When the local host is disconnecting from a server in the background, this function temporarily returns nn::friends::ResultTemporarilyBusy. In such cases, this function may succeed if you call it again after waiting a relatively short period of time.

This function also succeeds if it is called when the local host is already logged in. In such cases, the asynchronous processing instantly completes successfully.

The local host is definitely online when the asynchronous processing succeeds.

Revision History

2011/03/11
Added ConnectAsync as a function that sends an AC connection request.
Added specific examples of return values.
2010/08/16
Initial version.

CONFIDENTIAL