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