nn::cec::CTR::MessageBox::ReadMessage Member Function

Syntax

nn::Result ReadMessage(
     Message & cecMessage,
     void * buf,
     const size_t bufLen,
     const CecBoxType boxType,
     const MessageId & messageId
);

Parameters

Name Description
out cecMessage Object of the Message class where the data should be loaded.
out buf Buffer that stores a Message binary array.
in bufLen Buffer size.
in boxType Inbox and outbox specification.
in messageId Specifies a MessageId.

Return Values

nn::Result

Value Description
Result::IsSuccess Succeeded.
ResultStateBusy Unable to access because the daemon is busy (BUSY state). It may succeed if you wait some time before accessing again.
ResultNotAuthorized The box has not been opened.
ResultInvalidArgument Could not read, because an incorrect argument was specified.
Any other value Process failed.

Description

Reads a message.

Error Handling

The following simplified C++ code provides guidelines for error handling.
    nn::Result result = ReadMessage();
    if(result.IsFailure())
    {
        if(result == nn::cec::ResultNotAuthorized())
        {
            // Box is not open
            //  --> OpenMessageBox
        }
        else if(result == nn::cec::ResultStateBusy() )
        {
            // Daemon is BUSY. This state never occurs normally. It might be possible to succeed by retrying.
        }
        else if(result == nn::cec::ResultInvalidArgument() )
        {
            // Invalid parameter.
        }
        else
        {
            // Reading failed.
        }
        return result;  // Failure
    }
    return result;  // Success

    

Revision History

2011/01/19
Added a description of error handling.
2010/08/16
Initial version.

CONFIDENTIAL