nn::ndm Namespace

Description

The namespace of the network daemon control library.

A daemon is a static module that processes autonomously in the background of the application. CTR has a number of daemons for network processes.
ndm (Network Daemon Manager) is a special daemon that manages the daemons performing network processes. The ndm library is a library for controlling this special daemon.

The Need for Daemon Control

The application runs on the CPU's application core, while the daemons run in parallel on the CPU's system core. Accordingly, the daemons do not directly take away from the application's CPU time.
On the other hand, the application and the daemons share the network and NAND. For this reason, the activities of the daemons can in some cases affect the performance of the application.

If a decline in network or NAND performance is fatal to the application, the ndm library can halt the operations of the various communication modules.
(For example, when a network multiplayer mode requiring low latency is started or when the scene switches to a scene that loads a large volume of data from NAND.)

When switching to local communications or another communications mode, the various communications libraries control the daemons automatically by using the ndm library.
The application developer does not have to worry about anything other than performance.

Daemons Under Control of the ndm Library

Daemons can be freely stopped, but the different daemons all have their roles to play, so there are various restrictions on the stopping of daemons. It is important to understand how the stopping of any particular daemon affects the system.

StreetPass Daemon (nn::ndm::CTR::DN_CEC)

This daemon carries out StreetPass communication (nn::cec). Stopping this daemon completely shuts down StreetPass communications being performed in the background of the application. Operations where the application does something like access the StreetPass message box can be performed as usual.

SpotPass Daemon (nn::ndm::CTR::DN_BOSS and nn::ndm::DN_NIM)

This daemon performs SpotPass communication (nn::boss). Stopping this daemon completely shuts down SpotPass communications being performed in the background of the application.
Operations by the application, such as registering tasks, immediate execution in the foreground, and accessing storage, can be performed as usual.

nn::ndm::CTR::DN_NIM is a supplemental module for executing system processes. We recommend that when you stop nn::ndm::CTR::DN_BOSS, you also stop nn::ndm::DN_NIM.

Friend Presence Daemon (nn::ndm::CTR::DN_FRIENDS)

This daemon manages the friend presence feature (nn::friends). Stopping this daemon halts autonomous log on in the background of the application. Operations by applications such as accessing friend information, or explicit logon processes can be performed as usual.

Note that autonomous log on is not carried out during sleep either, and functionality may appear the same as when a stop command has been issued.

Reference Predicted Impacts of Daemons on Applications
Daemon
(nn::ndm::CTR::DaemonName)
Effect on NetworkEffect on NAND
DN_CEC None
(Infrastructure communications are not used)
Moderate
(Approximately 10 KB to 10 MB of NAND is accessed when StreetPass is being established.)
DN_FRIENDS Low
(UDP communications occur when disconnecting)
Low
DN_BOSS High
(HTTP communications occur when the task executes)
High
(NAND write occurs when the task executes)
DN_NIM High
(HTTP communications occur when the task executes)
High
(NAND write occurs when the task executes)

Operations During Sleep

Daemon operations cannot be controlled during sleep. Even if the application issues a stop command, functionality is exactly the same as during sleep while the daemon has not been stopped. When the system recovers from sleep, it returns to the state before sleep. You must take into account the fact that the daemon state, such as receiving new data, has changed when recovering from sleep even if the daemon is stopped.

Namespace

nn::ndm::CTR The namespace of the CTR network daemon control library. (This namespace can also be written without the ::CTR portion.)

Functions

IsDaemonStartEnable Determines whether daemon operations are enabled by activating wireless communication. Even if IsDaemonStartEnable returns true, daemon operations do not work if they are explicitly stopped with functions like SuspendDaemons or SuspendScheduler.
Initialize Initializes the network daemon control library.
Finalize Finalizes the network daemon control library.
SuspendDaemons Suspends autonomous operation of all network daemons.
ResumeDaemons Resumes autonomous operation of all network daemons.
Suspend Suspends autonomous operation of a network daemon.
Resume Resumes autonomous operation of a network daemon.
SuspendScheduler Suspends the daemon manager that handles scheduling for all network daemons.
ResumeScheduler Resumes daemon scheduling.
SetupDaemonsDefault Reverts network daemon operating permissions to the SDK defaults.

Revision History

2012/12/04
Revised information about the SpotPass communication daemon.
2010/12/10
Updated and added information about daemons.
2010/09/17
Initial version.

CONFIDENTIAL