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
);

Arguments

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/outbox specification.
in messageId Specifies a MessageId.

Return Values

nn::Result

Value Description
ResultSuccess Process succeeded.
ResultStateBusy Unable to access because the daemon is busy (BUSY state). This 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.
A value other than the above. 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 will never normally occur, but 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 description of error handling.
2010/08/16
Initial version.

CONFIDENTIAL