2018-03-07 18:42:36 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Copyright (C) 2016-2018 Maschell
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
#include "CPTCPServer.hpp"
|
2021-09-19 21:16:03 +02:00
|
|
|
#include <netinet/in.h>
|
2018-03-07 18:42:36 +01:00
|
|
|
#include <malloc.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <utils/logger.h>
|
|
|
|
|
|
|
|
CPTCPServer * CPTCPServer::instance = NULL;
|
|
|
|
|
2018-06-20 15:07:15 +02:00
|
|
|
CPTCPServer::CPTCPServer(int32_t port): TCPServer(port,CPTCPServer::getPriority()) {
|
2018-06-19 17:40:02 +02:00
|
|
|
CPTCPServer::AttachDetach(HID_DEVICE_DETACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CPTCPServer::~CPTCPServer() {
|
2018-06-19 17:40:02 +02:00
|
|
|
CPTCPServer::AttachDetach(HID_DEVICE_DETACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
|
2018-06-19 17:40:02 +02:00
|
|
|
void CPTCPServer::AttachDetach(HIDAttachEvent attach) {
|
2018-03-07 18:42:36 +01:00
|
|
|
if(HID_DEBUG) {
|
|
|
|
if(attach) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Network Attach");
|
2018-03-07 18:42:36 +01:00
|
|
|
} else {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Network Detach");
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-20 15:07:15 +02:00
|
|
|
for(int32_t i= 0; i< gHIDMaxDevices; i++) {
|
|
|
|
for(int32_t j= 0; j< HID_MAX_PADS_COUNT; j++) {
|
2018-03-07 18:42:36 +01:00
|
|
|
if(gNetworkController[i][j][NETWORK_CONTROLLER_ACTIVE] > 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Found a registered pad in deviceslot %d and padslot %d! Lets detach it.",i,j);
|
2018-03-07 18:42:36 +01:00
|
|
|
HIDDevice device;
|
|
|
|
memset(&device,0,sizeof(device));
|
|
|
|
|
2018-06-19 17:40:02 +02:00
|
|
|
device.interfaceIndex = 0;
|
2018-03-07 18:42:36 +01:00
|
|
|
device.vid = gNetworkController[i][j][NETWORK_CONTROLLER_VID];
|
|
|
|
device.pid = gNetworkController[i][j][NETWORK_CONTROLLER_PID];
|
|
|
|
device.handle = gNetworkController[i][j][NETWORK_CONTROLLER_HANDLE];
|
2018-06-19 17:40:02 +02:00
|
|
|
device.maxPacketSizeRx = 8;
|
2018-03-07 18:42:36 +01:00
|
|
|
ControllerPatcherHID::externAttachDetachCallback(&device,attach);
|
|
|
|
memset(gNetworkController[i][j],0,sizeof(gNetworkController[i][j]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(HID_DEBUG) {
|
|
|
|
if(attach) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Network Attach DONE!");
|
2018-03-07 18:42:36 +01:00
|
|
|
} else {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Network Detach DONE!");
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CPTCPServer::DetachAndDelete() {
|
2018-06-19 17:40:02 +02:00
|
|
|
CPTCPServer::AttachDetach(HID_DEVICE_DETACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
memset(&gNetworkController,0,sizeof(gNetworkController));
|
|
|
|
}
|
|
|
|
|
2018-06-20 15:07:15 +02:00
|
|
|
BOOL CPTCPServer::whileLoop() {
|
|
|
|
int32_t ret;
|
|
|
|
int32_t clientfd = getClientFD();
|
2018-03-07 18:42:36 +01:00
|
|
|
while (1) {
|
|
|
|
if(shouldExit()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ret = checkbyte(clientfd);
|
|
|
|
if (ret < 0) {
|
2021-09-19 21:16:03 +02:00
|
|
|
if(errno != EWOULDBLOCK) {
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
2018-06-19 17:31:20 +02:00
|
|
|
OSSleepTicks(OSMicrosecondsToTicks(1000));
|
2018-03-07 18:42:36 +01:00
|
|
|
continue;
|
|
|
|
}
|
2020-12-16 02:04:31 +01:00
|
|
|
//DEBUG_FUNCTION_LINE("got byte from tcp! %01X",ret);
|
2018-03-07 18:42:36 +01:00
|
|
|
switch (ret) {
|
|
|
|
case WIIU_CP_TCP_ATTACH: { /*attach */
|
|
|
|
if(gUsedProtocolVersion >= WIIU_CP_TCP_HANDSHAKE_VERSION_1) {
|
2018-06-20 15:07:15 +02:00
|
|
|
int32_t handle;
|
2018-03-07 18:42:36 +01:00
|
|
|
ret = recvwait(clientfd, &handle, 4);
|
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: recvwait handle",WIIU_CP_TCP_ATTACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("got handle %d",handle);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
2018-06-20 15:07:15 +02:00
|
|
|
uint16_t vid = 0;
|
|
|
|
uint16_t pid = 0;
|
2018-03-07 18:42:36 +01:00
|
|
|
ret = recvwait(clientfd, &vid, 2);
|
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: recvwait vid",WIIU_CP_TCP_ATTACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("got vid %04X",vid);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ret = recvwait(clientfd, &pid, 2);
|
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: recvwait pid",WIIU_CP_TCP_ATTACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("got pid %04X",pid);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
HIDDevice device;
|
|
|
|
memset(&device,0,sizeof(device));
|
|
|
|
device.handle = handle;
|
2018-06-19 17:40:02 +02:00
|
|
|
device.interfaceIndex = 0;
|
2018-03-07 18:42:36 +01:00
|
|
|
device.vid = SWAP16(vid);
|
|
|
|
device.pid = SWAP16(pid);
|
2018-06-19 17:40:02 +02:00
|
|
|
device.maxPacketSizeRx = 8;
|
2018-03-07 18:42:36 +01:00
|
|
|
|
|
|
|
my_cb_user * user = NULL;
|
2018-06-19 17:40:02 +02:00
|
|
|
ControllerPatcherHID::externAttachDetachCallback(&device,HID_DEVICE_ATTACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
if((ret = ControllerPatcherUtils::getDataByHandle(handle,&user)) < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: getDataByHandle(%d,%08X).",WIIU_CP_TCP_ATTACH,handle,&user);
|
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: Config for the controller is missing.",WIIU_CP_TCP_ATTACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
if((ret = sendbyte(clientfd, WIIU_CP_TCP_ATTACH_CONFIG_NOT_FOUND) < 0)) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: Sending the WIIU_CP_TCP_ATTACH_CONFIG_NOT_FOUND byte failed. Error: %d.",WIIU_CP_TCP_ATTACH,ret);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if((ret = sendbyte(clientfd, WIIU_CP_TCP_ATTACH_CONFIG_FOUND) < 0)) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: Sending the WIIU_CP_TCP_ATTACH_CONFIG_FOUND byte failed. Error: %d.",WIIU_CP_TCP_ATTACH,ret);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(user != NULL) {
|
|
|
|
if((ret = sendbyte(clientfd, WIIU_CP_TCP_ATTACH_USER_DATA_OKAY) < 0)) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: Sending the WIIU_CP_TCP_ATTACH_USER_DATA_OKAY byte failed. Error: %d.",WIIU_CP_TCP_ATTACH,ret);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = sendwait(clientfd,&user->slotdata.deviceslot,2);
|
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: sendwait slotdata: %04X",WIIU_CP_TCP_ATTACH,user->slotdata.deviceslot);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
ret = sendwait(clientfd,&user->pad_slot,1);
|
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: sendwait pad_slot: %04X",WIIU_CP_TCP_ATTACH,user->pad_slot);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} else {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: invalid user data.",WIIU_CP_TCP_ATTACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
if((ret = sendbyte(clientfd, WIIU_CP_TCP_ATTACH_USER_DATA_BAD) < 0)) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: Sending the WIIU_CP_TCP_ATTACH_USER_DATA_BAD byte failed. Error: %d.",WIIU_CP_TCP_ATTACH,ret);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("attachted to device slot: %d , pad slot is: %d",user->slotdata.deviceslot,user->pad_slot);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gNetworkController[user->slotdata.deviceslot][user->pad_slot][NETWORK_CONTROLLER_VID] = device.vid;
|
|
|
|
gNetworkController[user->slotdata.deviceslot][user->pad_slot][NETWORK_CONTROLLER_PID] = device.pid;
|
|
|
|
gNetworkController[user->slotdata.deviceslot][user->pad_slot][NETWORK_CONTROLLER_ACTIVE] = 1;
|
|
|
|
gNetworkController[user->slotdata.deviceslot][user->pad_slot][NETWORK_CONTROLLER_HANDLE] = handle;
|
|
|
|
|
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("handle %d connected! vid: %02X pid: %02X deviceslot %d, padslot %d",handle,vid,pid,user->slotdata.deviceslot,user->pad_slot);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case WIIU_CP_TCP_DETACH: { /*detach */
|
|
|
|
if(gUsedProtocolVersion >= WIIU_CP_TCP_HANDSHAKE_VERSION_1) {
|
2018-06-20 15:07:15 +02:00
|
|
|
int32_t handle;
|
2018-03-07 18:42:36 +01:00
|
|
|
ret = recvwait(clientfd, &handle, 4);
|
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: recvwait handle",WIIU_CP_TCP_DETACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("got detach for handle: %d",handle);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
my_cb_user * user = NULL;
|
|
|
|
if(ControllerPatcherUtils::getDataByHandle(handle,&user) < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: getDataByHandle(%d,%08X).",WIIU_CP_TCP_DETACH,handle,&user);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(user == NULL) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: invalid user data.",WIIU_CP_TCP_DETACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
2018-06-20 15:07:15 +02:00
|
|
|
int32_t deviceslot = user->slotdata.deviceslot;
|
2018-03-07 18:42:36 +01:00
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("device slot is: %d , pad slot is: %d",deviceslot,user->pad_slot);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
DeviceVIDPIDInfo vidpid;
|
2018-06-20 15:07:15 +02:00
|
|
|
int32_t result;
|
2018-03-07 18:42:36 +01:00
|
|
|
if((result = ControllerPatcherUtils::getVIDPIDbyDeviceSlot(deviceslot,&vidpid)) < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: Couldn't find a valid VID/PID for device slot %d. Error: %d",WIIU_CP_TCP_DETACH,deviceslot,ret);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
HIDDevice device;
|
|
|
|
memset(&device,0,sizeof(device));
|
|
|
|
device.handle = handle;
|
2018-06-19 17:40:02 +02:00
|
|
|
device.interfaceIndex = 0;
|
2018-03-07 18:42:36 +01:00
|
|
|
device.vid = SWAP16(vidpid.vid);
|
|
|
|
device.pid = SWAP16(vidpid.pid);
|
2018-06-19 17:40:02 +02:00
|
|
|
device.maxPacketSizeRx = 14;
|
2018-03-07 18:42:36 +01:00
|
|
|
|
2018-06-19 17:40:02 +02:00
|
|
|
ControllerPatcherHID::externAttachDetachCallback(&device,HID_DEVICE_DETACH);
|
2018-03-07 18:42:36 +01:00
|
|
|
memset(gNetworkController[deviceslot][user->pad_slot],0,sizeof(gNetworkController[deviceslot][user->pad_slot]));
|
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("handle %d disconnected!",handle);
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case WIIU_CP_TCP_PING: { /*ping*/
|
|
|
|
if(gUsedProtocolVersion >= WIIU_CP_TCP_HANDSHAKE_VERSION_1) {
|
|
|
|
if(HID_DEBUG) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Got Ping, sending now a Pong");
|
2018-03-07 18:42:36 +01:00
|
|
|
}
|
2018-06-20 15:07:15 +02:00
|
|
|
int32_t ret = sendbyte(clientfd, WIIU_CP_TCP_PONG);
|
2018-03-07 18:42:36 +01:00
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error in %02X: sendbyte PONG");
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-06-20 15:07:15 +02:00
|
|
|
BOOL CPTCPServer::acceptConnection() {
|
|
|
|
int32_t clientfd = getClientFD();
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("TCP Connection accepted! Sending my protocol version: %d (0x%02X)", (WIIU_CP_TCP_HANDSHAKE - WIIU_CP_TCP_HANDSHAKE_VERSION_1)+1,WIIU_CP_TCP_HANDSHAKE);
|
2018-03-07 18:42:36 +01:00
|
|
|
|
|
|
|
gUDPClientip = getSockAddr().sin_addr.s_addr;
|
|
|
|
UDPClient::createInstance();
|
|
|
|
|
2018-06-20 15:07:15 +02:00
|
|
|
int32_t ret;
|
2018-03-07 18:42:36 +01:00
|
|
|
ret = sendbyte(clientfd, WIIU_CP_TCP_HANDSHAKE); //Hey I'm a WiiU console!
|
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error sendbyte: %02X",WIIU_CP_TCP_HANDSHAKE);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-06-20 15:07:15 +02:00
|
|
|
uint8_t clientProtocolVersion = recvbyte(clientfd);
|
2018-03-07 18:42:36 +01:00
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error recvbyte: %02X",WIIU_CP_TCP_HANDSHAKE);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(clientProtocolVersion == WIIU_CP_TCP_HANDSHAKE_ABORT) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("The network client wants to abort.");
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("received protocol version: %d (0x%02X)",(clientProtocolVersion - WIIU_CP_TCP_HANDSHAKE_VERSION_1)+1,clientProtocolVersion);
|
2018-03-07 18:42:36 +01:00
|
|
|
|
|
|
|
if(clientProtocolVersion >= WIIU_CP_TCP_HANDSHAKE_VERSION_MIN && clientProtocolVersion <= WIIU_CP_TCP_HANDSHAKE_VERSION_MAX) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("We support this protocol version. Let's confirm it to the network client.");
|
2018-03-07 18:42:36 +01:00
|
|
|
gUsedProtocolVersion = clientProtocolVersion;
|
|
|
|
ret = sendbyte(clientfd, clientProtocolVersion);
|
|
|
|
if(ret < 0) {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Error sendbyte: %02X",clientProtocolVersion);
|
2018-03-07 18:42:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} else {
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("We don't support this protocol version. We need to abort =(.");
|
2018-03-07 18:42:36 +01:00
|
|
|
ret = sendbyte(clientfd, WIIU_CP_TCP_HANDSHAKE_ABORT);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-12-16 02:04:31 +01:00
|
|
|
DEBUG_FUNCTION_LINE("Handshake done! Success!");
|
2018-03-07 18:42:36 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CPTCPServer::onConnectionClosed() {
|
|
|
|
gUDPClientip = 0;
|
|
|
|
UDPClient::destroyInstance();
|
|
|
|
CPTCPServer::DetachAndDelete(); //Clear connected controller
|
|
|
|
}
|