1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: cec_Cec.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 // 17 // Do not edit this file. 18 // This file is automatically generated. 19 // 20 21 #ifndef NN_CEC_CTR_CEC_CEC_H_ 22 #define NN_CEC_CTR_CEC_CEC_H_ 23 24 #include <nn/Handle.h> 25 #include <nn/Result.h> 26 #include <nn/types.h> 27 28 29 30 namespace nn { 31 namespace cec { 32 namespace CTR { 33 namespace detail { 34 35 class Cec 36 { 37 public: 38 enum Tag 39 { 40 TAG_IPC_ERROR, 41 TAG_OPEN = 0x0001, 42 TAG_READ = 0x0002, 43 TAG_READ_MESSAGE = 0x0003, 44 TAG_READ_MESSAGE_WITH_HMAC = 0x0004, 45 TAG_WRITE = 0x0005, 46 TAG_WRITE_MESSAGE = 0x0006, 47 TAG_WRITE_MESSAGE_WITH_HMAC = 0x0007, 48 TAG_DELETE = 0x0008, 49 TAG_SET_DATA = 0x0009, 50 TAG_READ_DATA = 0x000a, 51 TAG_START = 0x000b, 52 TAG_STOP = 0x000c, 53 TAG_GET_CEC_INFO_BUFFER = 0x000d, 54 TAG_GET_CECD_STATE = 0x000e, 55 TAG_GET_CEC_INFO_EVENT_HANDLE = 0x000f, 56 TAG_GET_CHANGE_STATE_EVENT_HANDLE = 0x0010, 57 TAG_OPEN_AND_WRITE_FILE = 0x0011, 58 TAG_OPEN_AND_READ_FILE = 0x0012, 59 TAG_GET_EVENT_LOG = 0x001e, 60 TAG_GET_EVENT_LOG_START = 0x001f, 61 TAG_GET_EVENT_LOG_LENGTH = 0x0020, 62 TAG_CALC_EVENT_LOG_START = 0x0021, 63 TAG_IPC_END 64 }; 65 66 public: 67 static Handle s_Session; 68 69 public: Cec()70 Cec() {} 71 72 public: 73 static nn::Result Open( u32 cecTitleId, u32 dataType, u32 option, size_t* filesize ); 74 static nn::Result Read( size_t* pReadLen, u8 pReadBuf[], size_t len ); 75 static nn::Result ReadMessage( u32 cecTitleId, u8 in_or_out_box, const u8 pMessId[], size_t messIdLen, size_t* pReadLen, u8 pReadBuf[], size_t len ); 76 static nn::Result ReadMessageWithHmac( u32 cecTitleId, u8 in_or_out_box, const u8 pMessId[], size_t messIdLen, size_t* pReadLen, u8 pReadBuf[], size_t len, const u8 pHmacKey[] ); 77 static nn::Result Write( const u8 pWriteBuf[], size_t len ); 78 static nn::Result WriteMessage( u32 cecTitleId, u8 in_or_out_box, u8 pMessId[], size_t messIdLen, const u8 pWriteBuf[], size_t len ); 79 static nn::Result WriteMessageWithHmac( u32 cecTitleId, u8 in_or_out_box, u8 pMessId[], size_t messIdLen, const u8 pWriteBuf[], size_t len, const u8 pHmacKey[] ); 80 static nn::Result Delete( u32 cecTitleId, u32 dataType, u8 in_or_out_box, const u8 pMessId[], size_t messIdLen ); 81 static nn::Result SetData( u32 cecTitleId, const u8 pData[], size_t len, u32 option ); 82 static nn::Result ReadData( u8 pReadBuf[], size_t len, u32 option, const u8 optionData[], size_t optionDataLen ); 83 static nn::Result Start( u32 option ); 84 static nn::Result Stop( u32 option ); 85 static nn::Result GetCecInfoBuffer( u32 cecTitleId, u8 pCecInfoBuffer[], size_t size ); 86 static nn::Result GetCecdState( u32* state ); 87 static nn::Result GetCecInfoEventHandle( nn::Handle* pEventHandle ); 88 static nn::Result GetChangeStateEventHandle( nn::Handle* pEventHandle ); 89 static nn::Result OpenAndWriteFile( const u8 pWriteBuf[], size_t writeBufLen, u32 cecTitleId, u32 dataType, u32 option ); 90 static nn::Result OpenAndReadFile( u8 pReadBuf[], size_t readBufLen, size_t* pReadLen, u32 cecTitleId, u32 dataType, u32 option ); 91 static nn::Result GetEventLog( u8 pCecExchangeEventsBuf[], s32* pEnd, s32 start, s32 length ); 92 static nn::Result GetEventLogStart( s32* pStart ); 93 static nn::Result GetEventLogLength( s32* pLength ); 94 static nn::Result CalcEventLogStart( s32* pNewStart, s32 start, s32 offset ); 95 }; 96 97 } // end of namespace detail 98 } // end of namespace CTR 99 } // end of namespace cec 100 } // end of namespace nn 101 102 103 104 #endif // ifndef NN_CEC_CTR_CEC_CEC_H_ 105