cec - cec_demo2 Demo

Description

This sample runs the daemon for communication via StreetPass.
The demo sets data in the StreetPass box, searches for a StreetPass partner, and exchanges data.
At least two CTR systems are required to run this demo.
Whereas cec_demo1 is used to verify each API operation separately, cec_demo2 is an application sample to send and receive simple messages using StreetPass.

Required Environment

None.

How to Use


StreetPass Box Generation Screen
Input Operation
A Button. Creates the StreetPass box.
Transitions to the Write Send Message screen.
Close the system. The system will enter Sleep Mode. Opening the system restores it to the waking state.

Write Send Message screen
Input Operation
A Button. Adds a message to the outbox.
Transitions to the Read Received Message screen.
B Button. Deletes the StreetPass box.
Transitions to the Create StreetPass Box screen.
+Control Pad Left/Right Select the title and body to write to the send message.

Read Received Message screen
Input Operation
B Button. Deletes all messages in the outbox.
Transitions to the Write Send Message screen.
X Button. Deletes all read messages in the inbox.
Y Button. Loads a message from the inbox.
Deletes sent messages from the outbox.
+Control Pad Up/Down Selects a read message from the inbox.
The title and content of the selected message are displayed.

Notes

Use the CecLotcheckTool included in the CTR-SDK to reset the list of the CTRs that are performing StreetPass.

Execution Procedure

This section describes the procedure required when using two CTR systems. Perform the same steps on both systems. The following Create StreetPass Box Screen is displayed when the demo is run. If a StreetPass Box has already been created, then the screen transitions to the Write Send Message Screen.

PRESS A TO CREATE MESSAGEBOX


















A:CREATE_BOX

When the A Button is pressed on the Create StreetPass Box Screen, a new StreetPass box is created. If a StreetPass Box already exists, the existing box is used. When processing completes, the Write Send Message Screen is displayed as shown below. If there already is a message written in the outbox, then the screen transitions to the Write Received Message Screen.

AT FIRST,  PRESS LEFT/RIGHT TO SELECT CONTENT
AT SECOND, PRESS A TO SET SEND MESSAGE









TITLE:Japan
-----------------BODY-----------------
AREA       377,887 sq km
POPULATION 127,508,000
CAPITAL    Tokyo
LANGUAGE   Japanese
CURRENCY   yen

A:SET MESSAGE B:DELETE_BOX
LEFT/RIGHT:SELECT_CONTENT

An outbox and inbox exist in the StreetPass Box. With the Write Send Message Screen, a message is written to the outbox. A message can be selected by pressing the LEFT/RIGHT buttons on the +Control Pad and then written to the outbox by pressing the A button. When finished writing, the following Read Received Message Screen is displayed. The B Button can also be pressed to delete the StreetPass Box and return to the Create StreetPass Box Screen.

----------------------------------INBOX
TITLE         ReceiveDate





--------------------------------OUTBOX
TITLE         CreateDate
Japan         20xx/xx/xx xx:xx xx.xxx
TITLE:
-----------------BODY-----------------






Y:RECEIVE_MESSAGE X:DELETE_MESSAGE
B:BACK UP/DOWN:SELECT_MESSAGE

In the Read Received Message Screen, messages in the inbox are read. The upper screen displays a list of read messages and messages written to the outbox. The lower screen shows the content of the received message. With the Read Received Message Screen displayed, the following alert is displayed on the lower screen when discovering a partner's CTR and then communicating with it. This alert is a notification that a message is in the inbox.

TITLE:
-----------------BODY-----------------


          ///NEW MESSAGE///
      PRESS Y TO RECEIVE MESAGE


A:SET MESSAGE B:DELETE_BOX
LEFT/RIGHT:SELECT_CONTENT

If the Y button is pressed while the alert is displayed, the message in the inbox is loaded to the demo application and then can be displayed in the inbox list. At the same time, the message in the inbox is deleted. Messages in the outbox are also updated, and messages that have been sent are deleted. When the B Button is pressed to return to the Write Send Message Screen, the message in the outbox is deleted at the same time.
By writing a message to the outbox from the Write Send Message Screen, StreetPass communication is performed again. However, you must wait up to 8 hours to exchange data again with the same communication peer. Switch to debugging mode to verify if StreetPass is working in a shorter amount of time. (See the Notes section.)
When there are two or more messages in the received list, the UP/DOWN buttons on the +Control Pad can be used to select and confirm message content from the inbox list. For messages in rows displayed in green in the message list, the content is shown on the lower screen, a description of the message in TITLE, and the data in BODY.

----------------------------------INBOX
TITLE         ReceiveDate
Italy         20xx/xx/xx xx:xx xx.xxx
France        20xx/xx/xx xx:xx xx.xxx
United States 20xx/xx/xx xx:xx xx.xxx
--------------------------------OUTBOX TITLE CreateDate Japan 20xx/xx/xx xx:xx xx.xxx
TITLE:United States
-----------------BODY-----------------
AREA       9,826,630 sq km
POPULATION 291,512,000
CAPITAL    Washington D.C.
LANGUAGE   English, Spanish
CURRENCY   US dollar

A:SET MESSAGE B:DELETE_BOX
LEFT/RIGHT:SELECT_CONTENT

Press the X Button to delete all received messages that have been read. The demo application can only handle a maximum of 25 messages, so delete them periodically.

Revision History

2011/04/14
Added explanation that StartScanning(true) is enabled in debugging mode.
2011/03/09
Updated documentation to match the latest sample messages.
2011/02/16
Initial version.

CONFIDENTIAL