From 7292edb8cee47f25210eb3ad1df6224938fc90d8 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 3 Apr 2017 16:57:04 +0200 Subject: [PATCH] Changed the network protocol to repsonse with PONG after a received PING. --- network/TCPServer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network/TCPServer.cpp b/network/TCPServer.cpp index 9a0a6fd..30e401a 100644 --- a/network/TCPServer.cpp +++ b/network/TCPServer.cpp @@ -32,6 +32,7 @@ #define WIIU_CP_TCP_ATTACH 0x01 #define WIIU_CP_TCP_DETACH 0x02 #define WIIU_CP_TCP_PING 0xF0 +#define WIIU_CP_TCP_PONG 0xF1 #define WIIU_CP_TCP_ATTACH_CONFIG_FOUND 0xE0 #define WIIU_CP_TCP_ATTACH_CONFIG_NOT_FOUND 0xE1 @@ -261,6 +262,9 @@ int TCPServer::RunTCP(){ } case WIIU_CP_TCP_PING: { /*ping*/ if(HID_DEBUG) log_printf("TCPServer: GOT PING\n"); + int ret = ControllerPatcherNet::sendbyte(clientfd, WIIU_CP_TCP_PONG); + if(ret < 0){ log_printf("TCPServer::RunTCP() Error in %02X: sendbyte PONG\n"); return -1;} + break; } default: