1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     cec_CecSys.h
4 
5   Copyright (C)2009 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: 28664 $
14  *---------------------------------------------------------------------------*/
15 
16 //
17 // このファイルを編集しないでください。
18 // このファイルは自動生成されます。
19 //
20 
21 #ifndef NN_CEC_CTR_CEC_CECSYS_H_
22 #define NN_CEC_CTR_CEC_CECSYS_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 CecSys
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_SET_CEC_TEST_MODE                                = 0x0401,
58             TAG_GET_CEC_INFO_EVENT_HANDLE_SYS                    = 0x0402,
59             TAG_IPC_END
60         };
61 
62     public:
63         static Handle s_Session;
64 
65     public:
CecSys()66         CecSys() {}
67 
68     public:
69         static nn::Result Open( u32 cecTitleId, u32 dataType, u32 option, size_t* filesize );
70         static nn::Result Read( size_t* pReadLen, u8 pReadBuf[], size_t len );
71         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 );
72         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[] );
73         static nn::Result Write( const u8 pWriteBuf[], size_t len );
74         static nn::Result WriteMessage( u32 cecTitleId, u8 in_or_out_box, u8 pMessId[], size_t messIdLen, const u8 pWriteBuf[], size_t len );
75         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[] );
76         static nn::Result Delete( u32 cecTitleId, u32 dataType, u8 in_or_out_box, const u8 pMessId[], size_t messIdLen );
77         static nn::Result SetData( u32 cecTitleId, const u8 pData[], size_t len, u32 option );
78         static nn::Result ReadData( u8 pReadBuf[], size_t len, u32 option, const u8 optionData[], size_t optionDataLen );
79         static nn::Result Start( u32 option );
80         static nn::Result Stop( u32 option );
81         static nn::Result GetCecInfoBuffer( u32 cecTitleId, u8 pCecInfoBuffer[], size_t size );
82         static nn::Result GetCecdState( u32* state );
83         static nn::Result GetCecInfoEventHandle( nn::Handle* pEventHandle );
84         static nn::Result GetChangeStateEventHandle( nn::Handle* pEventHandle );
85         static nn::Result SetCecTestMode( bit8 testMode );
86         static nn::Result GetCecInfoEventHandleSys( nn::Handle* pEventHandle );
87     };
88 
89 } // end of namespace detail
90 } // end of namespace CTR
91 } // end of namespace cec
92 } // end of namespace nn
93 
94 
95 
96 #endif  // ifndef NN_CEC_CTR_CEC_CECSYS_H_
97