CTR-Pia  5.4.3
Game Communication Engine
 全て クラス ネームスペース 関数 変数 型定義 列挙型 列挙型の値 ページ
local_Definitions.h
1 /*--------------------------------------------------------------------------------*
2  Copyright (C)Nintendo All rights reserved.
3 
4  These coded instructions, statements, and computer programs contain proprietary
5  information of Nintendo and/or its licensed developers and are protected by
6  national and international copyright laws. They may not be disclosed to third
7  parties or copied or duplicated in any form, in whole or in part, without the
8  prior written consent of Nintendo.
9 
10  The content herein is highly confidential and should be handled accordingly.
11  *--------------------------------------------------------------------------------*/
12 
13 
14 #pragma once
15 
16 #include <nn/pia/pia_Definitions.h>
17 #include <nn/pia/common/common_Trace.h>
18 
19 // Pia ライブラリ開発者用
20 #if NN_PIA_CTR
21 #define NN_PIA_LOCAL_ENABLE_UDS 1
22 #define NN_PIA_LOCAL_ENABLE_LDN 0
23 #elif NN_PIA_NINTENDOSDK
24 #define NN_PIA_LOCAL_ENABLE_UDS 0
25 #define NN_PIA_LOCAL_ENABLE_LDN 1
26 #else
27 #define NN_PIA_LOCAL_ENABLE_UDS 0
28 #define NN_PIA_LOCAL_ENABLE_LDN 0
29 #endif
30 
31 #define NN_PIA_EXPERIMENT_LDN_HOST_MIGRATION 1
32 #define NN_PIA_ENABLE_BACKGROUND_EVENT_CHECK 0
33 
34 namespace nn
35 {
36 namespace pia
37 {
38 namespace local
39 {
40 
41 /*!
42 @brief 通信が切断した理由を表します。
43  */
45 {
46  DisconnectReason_None = 0, //!< まだ通信を開始していない、または接続は維持されています。
47  DisconnectReason_RequestFromMyself, //!< 自身の操作でネットワークから切断しました。
48  DisconnectReason_RequestFromSystem, //!< システムからの要求 (無線オフモードへの遷移、スリープ遷移) でネットワークから切断しました。
49  DisconnectReason_DiscardedFromNetwork, //!< ホストがネットワークを破棄しました。または、ホストからの指示でネットワークから追放されました。または、通信状況が悪化し、ホストの内部状態でクライアントが切断されたことになりました。
50  DisconnectReason_ConnectionLost, //!< 通信状況が悪化し、ホストからのビーコンが一定期間受信できず、接続が維持できなくなりました。
51  DisconnectReason_Unknown //!< 未知の理由で切断されました。
52 };
53 
54 
55 /*!
56 @cond PRIVATE
57 @brief 新規参加許可/拒否の状態を表します。
58  */
59 enum AllowParticipatingState
60 {
61  AllowParticipatingState_None = 0, //!< ネットワークに接続していません。
62  AllowParticipatingState_Allow, //!< 新規参加を許可しています。
63  AllowParticipatingState_Disallow, //!< 新規参加を拒否しています。
64  AllowParticipatingState_AllowOnlyReconnection //!< 再接続のみ許可しています。
65 };
66 //! @endcond
67 
68 /*!
69 @cond PRIVATE
70 */
71 enum InternalRole
72 {
73  InternalRole_None = 0,
74  InternalRole_Host,
75  InternalRole_Client
76 };
77 //! @endcond
78 
79 // Pia ライブラリ開発者用
80 enum LocalFunctionBit
81 {
82  LocalFunctionBit_AroundNetwork = (0x01 << 0),
83  LocalFunctionBit_HostMigration = (0x01 << 1)
84 };
85 
86 #if NN_PIA_LOCAL_ENABLE_LDN
87 const uint32_t MtuSize = 1500;
88 #elif NN_PIA_LOCAL_ENABLE_UDS
89 const uint32_t MtuSize = 1478;
90 #else
91 const uint32_t MtuSize = 0;
92 #endif
93 
94 const uint32_t MaxSilenceTime = 4000; //!< ステーションとの通信が断絶したと判断する無通信時間 [msec] のデフォルト値です。
95 const uint32_t KeepAliveSendingInterval = 400; //!< キープアライブの送信間隔 [msec] のデフォルト値です。
96 const int DefaultRttInitialPulseInterval = 600; //!< 初期段階での RTT 計測パルス送信間隔のデフォルト値です。単位はミリ秒です。
97 }
98 }
99 } // end of namespace nn::pia::local