nn::cec::CTR Namespace

Description

Namespace for the CEC library.
(This namespace can also be written without the ::CTR portion.)

CTR StreetPass is an improved and easier-to-use iteration of a similar Nintendo DS feature called Chance Encounter Communication (CEC).
Because the system performs the communication in the background, sending and receiving data can be performed simply by preparing the send data, regardless of the application running or its status. However, because an application's original communication processes cannot be implemented, there is a chance that implementation of send/receive methods that require special conditions may not be possible.

StreetPass communication is enabled by creating a StreetPass box in the area prepared by the system and registering StreetPass data as the message to send in it. This allows the system to automatically send/receive StreetPass data with communication partners.
There are 12 StreetPass boxes available. In principle, one application can exclusively own one StreetPass box. If all StreetPass boxes are already in use, no new StreetPass boxes can be created until the user deletes unnecessary StreetPass settings on the StreetPass management screen in the system settings.
The StreetPass box contains a send box and a receive box. Each is allocated as a region to register StreetPass data to be sent and as a region to store received StreetPass data, respectively.
When two units that can perform StreetPass near each other and discover each other, the StreetPass box in the other unit's system region is scanned first. If there is a StreetPass box created with the same application (title ID) in the other's unit, communication begins only for the portion required for StreetPass send and receive data. When StreetPass data from several StreetPass boxes is to be sent, the data is sent from the smallest in size. But the communication partners may not remain in an area where they communicate long enough for all of the StreetPass send and receive data to be completed. When they are in the communication area for a short time, it is possible only the smallest data sent initially may be successfully communicated to the first person. For this reason, it is effective to keep the StreetPass data size as small as possible to increase the communication success rate. In addition, if they are not grouped, only one block of StreetPass data can be sent from one StreetPass box.
Depending on the settings, StreetPass data that can only be received can be saved, but be aware that StreetPass will not occur between receive-only data units. This situation also applies to StreetPass data that can only be sent. Specifically, if the first registered data is fixed as receiving or sending only, StreetPass data will never occur, no matter how much time passes.
StreetPass with the same partner will not occur again until an average of 4 hours or a maximum of 8 hours elapses.

Classes

nn::cec::CTR::CecControl Changes StreetPass (CEC) status and gets the information.
nn::cec::CTR::Message Class that handles CEC Message objects.
nn::cec::CTR::MessageBox Class for accessing CEC MessageBox objects.
nn::cec::CTR::MessageBoxInfoReader Gets the header information for a box's message. It can be used in cases such as when getting a list of messages.
nn::cec::CTR::MessageId Message ID

Structures

nn::cec::CTR::CecNotificationParam Receive information for each box.
nn::cec::CTR::CecNotificationData Receive information.

Enumerated Types

CecBoxDataType Indicates the types of data associated with boxes.
CecBoxType Types used for inboxes and outboxes.

typedef Definitions

MessageBoxFlag
MessageBoxFlag Flag that indicates MessageBox attributes.
SendMode
SendMode The sending mode for messages. Specified in a message.
MessageTypeFlag
MessageTypeFlag Flag for switching messages depending on the recipient. Specified in a message.
MessageExHeaderType
MessageExHeaderType Data types for a message's extended header.
Other
TitleId StreetPass ID format. This 32-bit value can be generated with the MakeCecTitleId function.

Constants

MessageBoxFlag
S MESSAGE_BOX_FLAG_APPLICATION The value is specified by default for general applications.
SendMode
S SENDMODE_RECV Receiving only.
S SENDMODE_SEND Sending only.
S SENDMODE_SENDRECV Sending and receiving.
S SENDMODE_EXCHANGE Exchange.
MessageTypeFlag
S MESSAGE_TYPEFLAG_NON_FRIEND Non-friends can receive the message.
S MESSAGE_TYPEFLAG_FRIEND Friends can receive the message.
MessageExHeaderType
S MESSAGE_EXHEADER_TYPE_ICON The icon for each message.
S MESSAGE_EXHEADER_TYPE_INFO The data description for each message.
Send Count and Propagation Count
S MESSAGE_SENDCOUNT_ONCE Specifies the number of times to send. The message is sent only once.
S MESSAGE_SENDCOUNT_UNLIMITED Specifies the number of times to send. It does not set a limit on the send count.
S MESSAGE_PROPAGATIONCOUNT_ONCE Specifies the number of times to propagate. It does not initiate propagation.
Other
S CEC_SIZEOF_MESSAGEID MessageId size.
S MESSAGE_BODY_SIZE_MAX Maximum size of the body of the message.

Functions

Initialize/Finalize
Initialize Connects to the CEC daemon. This must be called first to allow access to the CEC MessageBox.
Finalize Finalizes access to the CEC daemon.
Receipt notification
GetCecRecvEventHandle Specifies the Event object to receive reception notifications.
GetCecInfoBuffer Gets information about a message received in the previous communication.
Other
MakeCecTitleId Generates a 32-bit StreetPass ID (CecTitleId) that is used in StreetPass from a 20-bit unique ID.

Revision History

2010/08/16
Initial version.

CONFIDENTIAL