nn::ir::CTR Namespace

Description

The namespace of the CTR library for infrared communication between systems.
(This namespace can also be written without the ::CTR portion.)

Note: Supporting Sleep Mode
When the system transitions to Sleep Mode while the IR library is in use, the ongoing connection status and any ongoing connection authentication is forced to terminate. In addition, any unsent packets and any data not yet processed by the Receive function are destroyed.
If the system was in the connected state, that means that no disconnection request was sent to the communication partner, so if necessary call the Disconnect function and confirm that the function has completed before transitioning to Sleep Mode.

Note: Handling Malfunctions
If there is a possibility that the IR is malfunctioning, all functions that return Result will invariably return ResultFatalError (with the exception of the Finalize function). IR communication becomes unusable after this, so finalize the IR library.
Although there is a possibility that the IR module is malfunctioning, it may recover if the user turns the system off and on again. For this reason, we recommend you display a message to the user explaining the possibility of a malfunction and what to do about it.

Classes

nn::ir::CTR::Communicator Class that supports IR communication between CTR systems.
nn::ir::CTR::ResultNotInitialized Indicates that the IR library has not been initialized.
nn::ir::CTR::ResultAlreadyInitialized Indicates that the IR library has already been initialized.
nn::ir::CTR::ResultInvalidSize Indicates that the size of an argument value is incorrect.
nn::ir::CTR::ResultInvalidEnumValue Indicates that an argument value exceeds the range.
nn::ir::CTR::ResultOutOfRange Indicates that a parameter specification is out of range.
nn::ir::CTR::ResultNoData Indicates that there are no values to be gotten.
nn::ir::CTR::ResultOutOfResource Indicates a resource insufficiency.
nn::ir::CTR::ResultFatalError Indicates that the IR module may be malfunctioning.
nn::ir::CTR::ResultPerformanceError Indicates that an error related to system performance or CTR performance at a high baud-rate setting occurred.
nn::ir::CTR::ResultFramingError Indicates that a receive data framing error occurred.
nn::ir::CTR::ResultOverrunError Indicates that the receiving process could not keep pace with the device's data receive speed.
nn::ir::CTR::ResultModuleOtherError Indicates that some other unknown error relating to the IR module occurred.
nn::ir::CTR::ResultMachineSleep Indicates sleeping because the system is in Sleep Mode.
nn::ir::CTR::ResultSignatureNotFound Could not find signature in the received data indicating the start of the packet.
nn::ir::CTR::ResultdifferentSessionId The packet's session ID is not correct.
nn::ir::CTR::ResultInvalidCrc Indicates an incorrect result from verifying the CRC of the received data.
nn::ir::CTR::ResultFollowingDataNotExist Indicates that the subsequent data necessary for parsing the packet does not exist.
nn::ir::CTR::ResultAlreadyConnected Already in the connected state.
nn::ir::CTR::ResultAlreadyTryingToConnect In the process of connecting.
nn::ir::CTR::ResultNotConnected Not connected.
nn::ir::CTR::ResultBufferFull Buffer is full.
nn::ir::CTR::ResultPacketFull Packet is full.
nn::ir::CTR::ResultBufferInsufficient Buffer is not large enough.
nn::ir::CTR::ResultTimeout A timeout has occurred.
nn::ir::CTR::ResultPeripheral Error from the communication partner.
nn::ir::CTR::ResultCannotConfirmId Could not confirm ID of communication partner.
nn::ir::CTR::ResultInvalidData Invalid data.

Enumerated Types

BaudRate Enumerated type that represents the baud rates that can be used for infrared communication.
ConnectionStatus Enumerated type that represents the connection status with another device.
TryingToConnectStatus Enumerated type that represents the status of the connection authentication process with another device.
MachineId Enumerated type that represents the IDs assigned to devices.
ConnectionRole Enumerated type that represents whether the local system is server or client in the established connection.

Constants

FREE_PACKET_BORDER_SIZE const size_t Threshold value at which the total size of the header and footer appended to the data in a packet changes. When equal to or greater than this, the header size becomes FREE_PACKET_HEADER_FOOTER_SIZE_OVER_BORDER. When less than this, the header size becomes FREE_PACKET_HEADER_FOOTER_SIZE_UNDER_BORDER.
FREE_PACKET_HEADER_FOOTER_SIZE_UNDER_BORDER const size_t The total size of the header and footer appended to the data in a packet when the data size is less than FREE_PACKET_BORDER_SIZE.
FREE_PACKET_HEADER_FOOTER_SIZE_OVER_BORDER const size_t The total size of the header and footer appended to the data in a packet when the data size is equal to or larger than FREE_PACKET_BORDER_SIZE.
PAYLOAD_SIZE_MAX const size_t The maximum amount of data that can be sent or received.
NECESSARY_BUFFER_SIZE_FOR_CONNECTION const size_t The required size of the receive (or send) buffer in order to connect.
CONNECTION_REQUEST_PACKET_SIZE const size_t The size of the connection-request packet.
CONNECTION_REPLY_PACKET_SIZE const size_t The size of the connection-reply packet.
MANAGEMENT_BUFFER_ALLIGNMENT_SIZE const size_t The per-entry size in the packet management table.

Revision History

2011/08/30
Initial version.

CONFIDENTIAL