13GX_CORE_NAMESPACE_BEGIN()
28 GX_RTTI_ABSTRACT_CLASS(GxDebugCommunicationBase,
GxClassBase)
30 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
35#if defined(_PS4) || defined(_PS5) || defined(_XBOX_XS)
39 static constexpr u32 RECEIVE_MAX_SIZE = PACKET_MAX_SIZE;
40#elif defined(_WINDOWS)
44 static constexpr u32 RECEIVE_MAX_SIZE = PACKET_MAX_SIZE;
49 static constexpr u32 RECEIVE_MAX_SIZE = PACKET_MAX_SIZE;
62 typedef void (*PACKET_ANALYSE_CALLBACK)(
const GxPacketHeader& header,
const void* pBody);
72 GxDebugCommunicationBase(
void);
74 ~GxDebugCommunicationBase(
void);
77 virtual b32 initialize(u32 receiveBufferSize = GxDebugCommunicationBase::RECEIVE_MAX_SIZE);
79 virtual void terminate(
void);
88 virtual void update(
void){}
91 virtual b32 send(
const void* =
nullptr, u32 = 0,
b32 =
true){
return false; }
94 static u16 getNetworkToPlatform(u16 value);
96 static s16 getNetworkToPlatform(s16 value);
98 static u32 getNetworkToPlatform(u32 value);
100 static s32 getNetworkToPlatform(s32 value);
102 static u64 getNetworkToPlatform(u64 value);
104 static s64 getNetworkToPlatform(s64 value);
106 static f32 getNetworkToPlatform(f32 value);
108 static f64 getNetworkToPlatform(f64 value);
111 static u16 getPlatformToNetwork(u16 value);
113 static s16 getPlatformToNetwork(s16 value);
115 static u32 getPlatformToNetwork(u32 value);
117 static s32 getPlatformToNetwork(s32 value);
119 static u64 getPlatformToNetwork(u64 value);
121 static s64 getPlatformToNetwork(s64 value);
123 static f32 getPlatformToNetwork(f32 value);
125 static f64 getPlatformToNetwork(f64 value);
134 b32 isConnected(
void)
const {
return _isConnected; }
136 constexpr void setAnalyseCallback(PACKET_ANALYSE_CALLBACK callback) { _pAnalyseCallback = callback; }
145 GX_STR _receiveBuffer;
147 PACKET_ANALYSE_CALLBACK _pAnalyseCallback;
148 u32 _receiveBufferSize;
153#if defined(_WINDOWS) || defined(_XBOX_XS)
157class GxDebugCommunicationPC :
public GxDebugCommunicationBase
165 GX_RTTI_CLASS(GxDebugCommunicationPC, GxDebugCommunicationBase)
171 static constexpr u16 COMMUNICATION_PORT = 5631;
174 class GxReceiveThread :
public GxThread
185 static s32 receive(SOCKET& socket,
void* pData, s32 size);
197 GxDebugCommunicationPC(
void);
200 b32 initialize(u32 receiveBufferSize = GxDebugCommunicationBase::RECEIVE_MAX_SIZE)
override;
202 void terminate(
void)
override;
211 b32 send(
const void* pData, u32 size,
b32 isOutputTrace =
true)
override;
219 GxReceiveThread* _pReceiveThread;
220 b32 _isStopRequestThread;
227#elif defined(_PS4) || defined(_PS5)
231class GxDebugCommunicationPS :
public GxDebugCommunicationBase
239 GX_RTTI_CLASS(GxDebugCommunicationPS, GxDebugCommunicationBase)
245 static constexpr u16 COMMUNICATION_PORT = 5631;
248 class GxReceiveThread :
public GxThread
259 static s32 receive(GxNativeNetworkId& socket,
void* pData, s32 size);
271 GxDebugCommunicationPS(
void);
274 b32 initialize(u32 receiveBufferSize = GxDebugCommunicationBase::RECEIVE_MAX_SIZE)
override;
276 void terminate(
void)
override;
285 b32 send(
const void* pData, u32 size,
b32 isOutputTrace =
true)
override;
288 static void closeConnection(GxNativeNetworkId sid );
291 static s32 controlAddSocket(GxNativeNetworkId eid, GxNativeNetworkId sid, GxNativeNetworkEvent* pEvent );
294 static s32 controlDeleteSocket(GxNativeNetworkId eid, GxNativeNetworkId sid );
297 static s32 doAccept(GxNativeNetworkId eid, GxNativeNetworkEvent* pEvent );
300 static s32 doReceive(GxNativeNetworkId eid, GxNativeNetworkEvent* pEvent,
void* pData, s32 dataSize, s32 receiveFlags = 0 );
308 GxReceiveThread* _pReceiveThread;
309 b32 _isStopRequestThread;
310 GxNativeNetworkId _server;
311 GxNativeNetworkId _socket;
312 GxNativeNetworkId _epollId;
321class GxDebugCommunicationNX :
public GxDebugCommunicationBase
329 GX_RTTI_CLASS(GxDebugCommunicationNX, GxDebugCommunicationBase)
335 static GX_CSTR COMMUNICATION_NAME;
337 static constexpr s32 INVALID_ID = (-1);
340 class GxReceiveThread :
public GxThread
361 GxDebugCommunicationNX(
void);
364 b32 initialize(u32 receiveBufferSize = GxDebugCommunicationBase::RECEIVE_MAX_SIZE)
override;
366 void terminate(
void)
override;
375 b32 send(
const void* pData, u32 size,
b32 isOutputTrace =
true)
override;
378 void HtcsSocketErrorOutput(s32
id);
387 GxReceiveThread* _pReceiveThread;
388 b32 _isStopRequestThread;
399GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
pThis threadMain(pThis->_pIn)
オブジェクト基底クラス
Definition GxBase.h:88
クリティカルセクションクラス
Definition GxThread.h:20
static constexpr u32 VALUE_1K
1K
Definition GxMath.h:129
スレッドクラス
Definition GxThread.h:177
32bitブーリアン
Definition GxDefine.h:173