1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     cec_Types.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: 47558 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_CEC_CTR_CEC_TYPES_H_
17 #define NN_CEC_CTR_CEC_TYPES_H_
18 
19 #include <nn/types.h>
20 #include <nn/fnd.h>
21 #include <nn/cec/CTR/cec_Const.h>
22 #include <nn/cec/CTR/cec_MessageId.h>
23 
24 namespace nn {
25 namespace cec {
26 namespace CTR {
27     /* Please see man pages for details
28 
29     */
30     typedef u32 TitleId;
31     typedef u32 GroupId;
32     typedef bit64 SenderId;
33 
34     //
35     //
36     /* Please see man pages for details
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60      */
61     typedef u8 SendMode;
62 
63         /* Please see man pages for details
64 
65                */
66         static const SendMode SENDMODE_RECV           = 0x1;
67         /* Please see man pages for details
68 
69                */
70         static const SendMode SENDMODE_SEND           = 0x2;
71         /* Please see man pages for details
72 
73                */
74         static const SendMode SENDMODE_SENDRECV       = 0x3;
75         /* Please see man pages for details
76 
77                */
78         static const SendMode SENDMODE_EXCHANGE       = 0x0;
79 
80         static const SendMode CEC_SENDMODE_RECV       = SENDMODE_RECV;
81         static const SendMode CEC_SENDMODE_SEND       = SENDMODE_SEND;
82         static const SendMode CEC_SENDMODE_SENDRECV   = SENDMODE_SENDRECV;
83         static const SendMode CEC_SENDMODE_EXCHANGE   = SENDMODE_EXCHANGE;
84     //
85 
86 
87     //
88     //
89 
90     /* Please see man pages for details
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110      */
111     typedef u8 MessageTypeFlag;
112 
113     /* Please see man pages for details
114 
115                */
116     static const MessageTypeFlag MESSAGE_TYPEFLAG_NON_FRIEND     = 0x1;
117     /* Please see man pages for details
118 
119                */
120     static const MessageTypeFlag MESSAGE_TYPEFLAG_FRIEND         = 0x2;
121     /* Please see man pages for details
122 
123                */
124     static const MessageTypeFlag MESSAGE_TYPEFLAG_ANYONE         = MESSAGE_TYPEFLAG_NON_FRIEND|MESSAGE_TYPEFLAG_FRIEND;
125 
126     typedef MessageTypeFlag CecMessageTypeFlag;
127     //
128 
129 
130     //
131     //
132 
133     /* Please see man pages for details
134 
135      */
136     typedef u32 MessageExHeaderType;
137 
138         static const MessageExHeaderType MESSAGE_EXHEADER_TYPE_MFILTER  = 0x00000001;   // ModuleFilter
139         static const MessageExHeaderType MESSAGE_EXHEADER_TYPE_ICON     = 0x00000002;   //
140         static const MessageExHeaderType MESSAGE_EXHEADER_TYPE_NAME     = 0x00000003;   // アプリ名
141         static const MessageExHeaderType MESSAGE_EXHEADER_TYPE_INFO     = 0x00000004;   //
142         static const MessageExHeaderType MESSAGE_EXHEADER_TYPE_REGION   = 0x00000005;   // REGION
143 
144     typedef MessageExHeaderType CecMessageExHeaderType;
145     //
146 
147     static const u16 MESSAGE_MAGIC     = 0x6060;
148     static const u32 MESSAGE_VERSION   = 0x00000000;
149     typedef struct CecMessageHeader
150     {
151         u16 magic16;                //
152         NN_PADDING2;
153 
154         u32 messSize;               //
155         u32 headerSize;             //
156         u32 bodySize;                //
157 
158         u32 cecTitleId;                 //
159         u32 cecTitleId_reserve;         //
160         u32 groupId;                //
161         u32 sessionId;              //
162         u8  messageId[CEC_SIZEOF_MESSAGEID];          //
163         u32 messVersion;            //
164         u8  messageId_pair[CEC_SIZEOF_MESSAGEID];     //
165         u8  messageTypeFlag;        //
166         u8  sendMode;               //
167         bit8    flagUnread;                 //
168         bit8    flagNew;                    //
169         u64  senderId;              //
170         u64  senderId2;             //
171         nn::fnd::DateTimeParameters     sendDate;               //
172         nn::fnd::DateTimeParameters     recvDate;               //
173         nn::fnd::DateTimeParameters     createDate;             //
174         u8  sendCount;              //
175         u8  propagationCount;       //
176         bit16   tag;                //
177         //u32   PAD[4]; // 16 bytes
178     } CecMessageHeader;
179 
180 
181 } // namespace CTR
182 } // namespace cec
183 } // namespace nn
184 
185 #endif  //NN_CEC_CTR_CEC_TYPES_H_
186