1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: cec_MessageId.h 4 Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. 5 These coded instructions, statements, and computer programs contain 6 proprietary information of Nintendo of America Inc. and/or Nintendo 7 Company Ltd., and are protected by Federal copyright law. They may 8 not be disclosed to third parties or copied or duplicated in any form, 9 in whole or in part, without the prior written consent of Nintendo. 10 $Rev: 36150 $ 11 *--------------------------------------------------------------------------- 12 13 14 */ 15 #ifndef NN_CEC_CTR_CEC_MESSAGEID_H_ 16 #define NN_CEC_CTR_CEC_MESSAGEID_H_ 17 18 #include <nn/cec/CTR/cec_Const.h> 19 #include <nn/config.h> 20 21 namespace nn { 22 namespace cec { 23 namespace CTR { 24 25 // Retained for compatibility 26 typedef u8 CECMessageId[CEC_SIZEOF_MESSAGEID]; 27 28 /* Please see man pages for details 29 30 31 32 33 34 35 36 37 38 */ 39 class MessageId 40 { 41 public: 42 static const size_t SIZE = CEC_SIZEOF_MESSAGEID; // 8 43 static const size_t ENCODED_SIZE = 12 /*(SIZE * 4 / 3) + (3 - (SIZE * 4 / 3) % 3)*/; 44 45 /* Please see man pages for details 46 47 */ 48 MessageId(void); 49 /* Please see man pages for details 50 51 52 */ 53 explicit MessageId(const u8 msgId[SIZE]); 54 explicit MessageId(const char* msgId); 55 explicit MessageId(CECMessageId msgId);// NN_ATTRIBUTE_DEPRECATED; 56 57 /* Please see man pages for details 58 59 */ 60 const u8* GetBinary(void) const; 61 62 /* Please see man pages for details 63 64 65 */ 66 void GetBinary(u8 msgId[SIZE]) const; 67 /* Please see man pages for details 68 69 70 */ 71 bool IsEqual(const u8 msgId[SIZE]) const; 72 73 /* Please see man pages for details 74 75 76 77 */ 78 bool IsEmpty(void) const; 79 /* Please see man pages for details 80 81 82 83 */ 84 const char* GetString(void) const; 85 /* Please see man pages for details 86 87 88 89 */ 90 const char* GetEncodedString(void) const; 91 92 private: 93 u8 m_data[SIZE]; 94 static char s_buffer[SIZE * 2 + 1]; 95 }; 96 GetBinary(void)97 inline const u8* MessageId::GetBinary(void) const 98 { 99 return m_data; 100 } 101 102 103 } // namespace CTR 104 } // namespace cec 105 } // namespace nn 106 107 108 #endif //NN_CEC_CTR_CEC_MESSAGEID_H_ 109 110