1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     cec_DataTypes.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: 24970 $
14  *---------------------------------------------------------------------------*/
15 #ifndef NN_CEC_CTR_CEC_DATA_TYPES_H_
16 #define NN_CEC_CTR_CEC_DATA_TYPES_H_
17 
18 namespace nn {
19 namespace cec {
20 namespace CTR {
21    #if 1
22 #define MESSAGE_MAGIC       (0x6060)
23 #define MESSAGE_VERSION     (0x00000000)
24 struct CecMessageHeader
25 {
26     u16 magic16;                //!< マジックコード。固定値。
27     NN_PADDING2;
28 
29     u32 messSize;               //!< メッセージ全体のサイズ  (messSize = headerSize + bodySize + hashSize)
30     u32 headerSize;             //!< ヘッダのサイズ(ExHeaderを含む)
31     u32 bodySize;                //!< Message 本文のサイズ
32 
33     u32 cecTitleId;                 //!< Title固有ID
34     u32 cecTitleId_reserve;         //!< Title固有ID(予備)
35     u32 groupId;                //!< Title固有サブID
36     u32 sessionId;              //!< 送信時に付与されるID(同時に送信されたMessageは同じIDになる)
37     u8  messageId[CEC_SIZEOF_MESSAGEID];          //!< メッセージ固有ID
38     u32 messVersion;            //!< Messageバージョン
39     u8  messageId_pair[CEC_SIZEOF_MESSAGEID];     //!< メッセージ交換をした場合、対になるメッセージのID
40     u8  messageTypeFlag;        //!< Friend/Anybody
41     u8  sendMode;               //!< 送信/受信
42     bit8    flagUnread;                 //!< フラグ1
43     bit8    flagNew;                    //!< フラグ2
44     u64  senderId;              //!< 送信者のID
45     u64  senderId2;             //!< 送信者のID(予備)
46     nn::fnd::DateTimeParameters     sendDate;               //!< 送信日時(ms)
47     nn::fnd::DateTimeParameters     recvDate;               //!< 受信日時(ms)
48     nn::fnd::DateTimeParameters     createDate;             //!< 作成日時(ms)
49     u8  sendCount;              //!< 送信回数
50     u8  propagationCount;       //!< 伝播回数
51     bit16   tag;                //!< タグ
52     //CecMessageExHeader* ExHeader;        // 拡張ヘッダ
53 };
54 
55 
56 #endif
57 
58 
59 }
60 }
61 }
62 
63 #endif  //NN_CEC_CTR_CEC_DATA_TYPES_H_
64