Remove some debugging printouts in Network Client and Server code

This commit is contained in:
Adam Honse 2020-07-17 22:10:53 -05:00
parent 5ce6ec9ea7
commit 0ccf2d0c33
3 changed files with 0 additions and 33 deletions

View file

@ -352,8 +352,6 @@ void NetworkClient::ListenThreadFunction()
} while(bytes_read != sizeof(header) - sizeof(header.pkt_magic)); } while(bytes_read != sizeof(header) - sizeof(header.pkt_magic));
//printf( "Client: Received header, now receiving data of size %d\r\n", header.pkt_size);
//Header received, now receive the data //Header received, now receive the data
if(header.pkt_size > 0) if(header.pkt_size > 0)
{ {
@ -376,21 +374,14 @@ void NetworkClient::ListenThreadFunction()
} while (bytes_read < header.pkt_size); } while (bytes_read < header.pkt_size);
} }
//printf( "Client: Received header and data\r\n" );
//printf( "Client: Packet ID: %d \r\n", header.pkt_id);
//Entire request received, select functionality based on request ID //Entire request received, select functionality based on request ID
switch(header.pkt_id) switch(header.pkt_id)
{ {
case NET_PACKET_ID_REQUEST_CONTROLLER_COUNT: case NET_PACKET_ID_REQUEST_CONTROLLER_COUNT:
printf( "Client: NET_PACKET_ID_REQUEST_CONTROLLER_COUNT\r\n" );
ProcessReply_ControllerCount(header.pkt_size, data); ProcessReply_ControllerCount(header.pkt_size, data);
break; break;
case NET_PACKET_ID_REQUEST_CONTROLLER_DATA: case NET_PACKET_ID_REQUEST_CONTROLLER_DATA:
printf( "Client: NET_PACKET_ID_REQUEST_CONTROLLER_DATA\r\n");
ProcessReply_ControllerData(header.pkt_size, data, header.pkt_dev_idx); ProcessReply_ControllerData(header.pkt_size, data, header.pkt_dev_idx);
break; break;
} }
@ -453,8 +444,6 @@ void NetworkClient::ProcessReply_ControllerData(unsigned int data_size, char * d
new_controller->ReadDeviceDescription((unsigned char *)data); new_controller->ReadDeviceDescription((unsigned char *)data);
printf("Received controller: %s\r\n", new_controller->name.c_str());
if(dev_idx >= server_controllers.size()) if(dev_idx >= server_controllers.size())
{ {
server_controllers.push_back(new_controller); server_controllers.push_back(new_controller);

View file

@ -427,8 +427,6 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
} while(bytes_read != sizeof(header) - sizeof(header.pkt_magic)); } while(bytes_read != sizeof(header) - sizeof(header.pkt_magic));
//printf( "Server: Received header, now receiving data of size %d\r\n", header.pkt_size);
//Header received, now receive the data //Header received, now receive the data
if(header.pkt_size > 0) if(header.pkt_size > 0)
{ {
@ -451,30 +449,22 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
} while (bytes_read < header.pkt_size); } while (bytes_read < header.pkt_size);
} }
//printf( "Server: Received header and data\r\n" );
//printf( "Server: Packet ID: %d \r\n", header.pkt_id);
//Entire request received, select functionality based on request ID //Entire request received, select functionality based on request ID
switch(header.pkt_id) switch(header.pkt_id)
{ {
case NET_PACKET_ID_REQUEST_CONTROLLER_COUNT: case NET_PACKET_ID_REQUEST_CONTROLLER_COUNT:
//printf( "NET_PACKET_ID_REQUEST_CONTROLLER_COUNT\r\n" );
SendReply_ControllerCount(client_sock); SendReply_ControllerCount(client_sock);
break; break;
case NET_PACKET_ID_REQUEST_CONTROLLER_DATA: case NET_PACKET_ID_REQUEST_CONTROLLER_DATA:
//printf( "NET_PACKET_ID_REQUEST_CONTROLLER_DATA\r\n" );
SendReply_ControllerData(client_sock, header.pkt_dev_idx); SendReply_ControllerData(client_sock, header.pkt_dev_idx);
break; break;
case NET_PACKET_ID_SET_CLIENT_NAME: case NET_PACKET_ID_SET_CLIENT_NAME:
printf( "NET_PACKET_ID_SET_CLIENT_NAME\r\n" );
ProcessRequest_ClientString(client_sock, header.pkt_size, data); ProcessRequest_ClientString(client_sock, header.pkt_size, data);
break; break;
case NET_PACKET_ID_RGBCONTROLLER_RESIZEZONE: case NET_PACKET_ID_RGBCONTROLLER_RESIZEZONE:
//printf( "NET_PACKET_ID_RGBCONTROLLER_RESIZEZONE\r\n" );
if((header.pkt_dev_idx < controllers.size()) && (header.pkt_size == (2 * sizeof(int)))) if((header.pkt_dev_idx < controllers.size()) && (header.pkt_size == (2 * sizeof(int))))
{ {
int zone; int zone;
@ -488,8 +478,6 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
break; break;
case NET_PACKET_ID_RGBCONTROLLER_UPDATELEDS: case NET_PACKET_ID_RGBCONTROLLER_UPDATELEDS:
//printf( "NET_PACKET_ID_RGBCONTROLLER_UPDATELEDS\r\n" );
if(header.pkt_dev_idx < controllers.size()) if(header.pkt_dev_idx < controllers.size())
{ {
controllers[header.pkt_dev_idx]->SetColorDescription((unsigned char *)data); controllers[header.pkt_dev_idx]->SetColorDescription((unsigned char *)data);
@ -498,8 +486,6 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
break; break;
case NET_PACKET_ID_RGBCONTROLLER_UPDATEZONELEDS: case NET_PACKET_ID_RGBCONTROLLER_UPDATEZONELEDS:
//printf( "NET_PACKET_ID_RGBCONTROLLER_UPDATEZONELEDS\r\n" );
if(header.pkt_dev_idx < controllers.size()) if(header.pkt_dev_idx < controllers.size())
{ {
int zone; int zone;
@ -512,8 +498,6 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
break; break;
case NET_PACKET_ID_RGBCONTROLLER_UPDATESINGLELED: case NET_PACKET_ID_RGBCONTROLLER_UPDATESINGLELED:
//printf( "NET_PACKET_ID_RGBCONTROLLER_UPDATESINGLELED\r\n" );
if(header.pkt_dev_idx < controllers.size()) if(header.pkt_dev_idx < controllers.size())
{ {
int led; int led;
@ -526,8 +510,6 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
break; break;
case NET_PACKET_ID_RGBCONTROLLER_SETCUSTOMMODE: case NET_PACKET_ID_RGBCONTROLLER_SETCUSTOMMODE:
//printf( "NET_PACKET_ID_RGBCONTROLLER_SETCUSTOMMODE\r\n" );
if(header.pkt_dev_idx < controllers.size()) if(header.pkt_dev_idx < controllers.size())
{ {
controllers[header.pkt_dev_idx]->SetCustomMode(); controllers[header.pkt_dev_idx]->SetCustomMode();
@ -535,8 +517,6 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
break; break;
case NET_PACKET_ID_RGBCONTROLLER_UPDATEMODE: case NET_PACKET_ID_RGBCONTROLLER_UPDATEMODE:
//printf( "NET_PACKET_ID_RGBCONTROLLER_UPDATEMODE\r\n" );
if(header.pkt_dev_idx < controllers.size()) if(header.pkt_dev_idx < controllers.size())
{ {
controllers[header.pkt_dev_idx]->SetModeDescription((unsigned char *)data); controllers[header.pkt_dev_idx]->SetModeDescription((unsigned char *)data);

View file

@ -990,8 +990,6 @@ void RGBController::SetModeDescription(unsigned char* data_buf)
new_mode->colors.push_back(new_color); new_mode->colors.push_back(new_color);
} }
printf("read data ptr %d\r\n", data_ptr);
} }
unsigned char * RGBController::GetColorDescription() unsigned char * RGBController::GetColorDescription()