1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     cec_Cec.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_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_IPC_END
58         };
59 
60     public:
61         static Handle s_Session;
62 
63     public:
Cec()64         Cec() {}
65 
66     public:
67         static nn::Result Open( u32 cecTitleId, u32 dataType, u32 option, size_t* filesize );
68         static nn::Result Read( size_t* pReadLen, u8 pReadBuf[], size_t len );
69         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 );
70         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[] );
71         static nn::Result Write( const u8 pWriteBuf[], size_t len );
72         static nn::Result WriteMessage( u32 cecTitleId, u8 in_or_out_box, u8 pMessId[], size_t messIdLen, const u8 pWriteBuf[], size_t len );
73         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[] );
74         static nn::Result Delete( u32 cecTitleId, u32 dataType, u8 in_or_out_box, const u8 pMessId[], size_t messIdLen );
75         static nn::Result SetData( u32 cecTitleId, const u8 pData[], size_t len, u32 option );
76         static nn::Result ReadData( u8 pReadBuf[], size_t len, u32 option, const u8 optionData[], size_t optionDataLen );
77         static nn::Result Start( u32 option );
78         static nn::Result Stop( u32 option );
79         static nn::Result GetCecInfoBuffer( u32 cecTitleId, u8 pCecInfoBuffer[], size_t size );
80         static nn::Result GetCecdState( u32* state );
81         static nn::Result GetCecInfoEventHandle( nn::Handle* pEventHandle );
82         static nn::Result GetChangeStateEventHandle( nn::Handle* pEventHandle );
83     };
84 
85 } // end of namespace detail
86 } // end of namespace CTR
87 } // end of namespace cec
88 } // end of namespace nn
89 
90 
91 
92 #endif  // ifndef NN_CEC_CTR_CEC_CEC_H_
93