nn::cec::CTR::MessageBox::WriteMessage Member Functionnn::Result WriteMessage( const Message & cecMessage, const CecBoxType boxType, MessageId & messageIdOut ); nn::Result WriteMessage( const Message & cecMessage, const CecBoxType boxType, MessageId & messageIdOut, bool withWriteBoxInfo );
WriteMessage(const Message &, const CecBoxType, MessageId &)
|
Writes a message to the system save region. |
WriteMessage(const Message &, const CecBoxType, MessageId &, bool)
|
Writes a message to the system save region. |
WriteMessage(const Message &, const CecBoxType, MessageId &)The message cannot be written if it is larger than 100 KB (including data such as the header and icon) or if it would exceed the box's maximum storage capacity or maximum number of messages. Because NAND memory (the save region) uses a block size of 4 KB, for some message sizes it may be impossible to write up to the maximum storage capacity. After writing, the written data is committed when the CloseMessageBox or CommitMessageBox function is called.
When this function writes a message it checks the agreed EULA version. If no icon file (ICN file) is configured in the ROM, this function returns ResultNotAgreeEula in that situation also.
You must initialize the FS library before calling this function because the check uses FS library features.
nn::Result result = WriteMessage();
if(result.IsFailure())
{
if(result == nn::cec::ResultNotAgreeEula())
{
// The user has not agreed to the EULA.
}
else if(result == nn::cec::ResultParentalControlCec())
{
// Not permitted by Parental Controls.
}
else if(result == nn::cec::ResultNotAuthorized())
{
// Box is not open
// --> OpenMessageBox
}
else if(result == nn::cec::ResultBoxSizeFull() || result == nn::cec::ResultBoxMessNumFull())
{
// Outbox capacity overflow
// You must delete some outbox messages → DeleteMessage/DeleteAllMessages
}
else if(result == nn::cec::ResultMessTooLarge() || result == nn::cec::ResultNoData()
|| result == nn::cec::ResultInvalidCombination() )
{
// Invalid message
}
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
{
// Error
}
return result; // Failure
}
return result; // Success
WriteMessage(const Message &, const CecBoxType, MessageId &, bool)The message cannot be written if it is larger than 100 KB (including data such as the header and icon) or if it would exceed the box's maximum storage capacity or maximum number of messages. Because NAND memory (the save region) uses a block size of 4 KB, for some message sizes it may be impossible to write up to the maximum storage capacity. After writing, the written data is committed when the CloseMessageBox or CommitMessageBox function is called.
If you set withWriteBoxInfo equal to false, updates to the internal message list are skipped. This allows you to shorten the amount of time to write multiple consecutive messages. Note that the GetMessageBoxXXX functions are unable to get accurate information if the list has not been updated.
When this function writes a message it checks the agreed EULA version. If no icon file (ICN file) is configured in the ROM, this function returns ResultNotAgreeEula in that situation also.
You must initialize the FS library before calling this function because the check uses FS library features.
nn::Result result = WriteMessage();
if(result.IsFailure())
{
if(result == nn::cec::ResultNotAgreeEula())
{
// The user has not agreed to the EULA.
}
else if(result == nn::cec::ResultParentalControlCec())
{
// Not permitted by Parental Controls.
}
else if(result == nn::cec::ResultNotAuthorized())
{
// Box is not open
// --> OpenMessageBox
}
else if(result == nn::cec::ResultBoxSizeFull() || result == nn::cec::ResultBoxMessNumFull())
{
// Outbox capacity overflow
// You must delete some outbox messages → DeleteMessage/DeleteAllMessages
}
else if(result == nn::cec::ResultMessTooLarge() || result == nn::cec::ResultNoData()
|| result == nn::cec::ResultInvalidCombination() )
{
// Invalid message
}
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
{
// Error
}
return result; // Failure
}
return result; // Success
CONFIDENTIAL