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