Skip to content

Commit

Permalink
change serversocket to not pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
oganigl committed Feb 7, 2025
1 parent 32b086b commit c706017
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Core/Inc/Communication/Communication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Communication{
private:

Data_struct *Data;
ServerSocket *ControlStationSocket;
ServerSocket ControlStationSocket;
DatagramSocket *datagramSocket;
HeapOrder *Enable_Buffer_Order;
HeapOrder *Disable_Buffer_Order;
Expand Down
5 changes: 2 additions & 3 deletions Core/Src/Communication/Communication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ void received_activate_space_vector_callback(){
void received_stop_space_vector_callback(){
Communication::received_stop_space_vector = true;
}
Communication::Communication(Data_struct *data): Data(data){
ControlStationSocket = new ServerSocket(Communication_Data::PCU_IP,Communication_Data::TCP_SERVER);
Communication::Communication(Data_struct *data): Data(data),ControlStationSocket(Communication_Data::PCU_IP,Communication_Data::TCP_SERVER){
datagramSocket = new DatagramSocket(Communication_Data::PCU_IP,Communication_Data::UDP_PORT_PCU,Communication_Data::Backend,Communication_Data::UDP_PORT);
Enable_Buffer_Order = new HeapOrder(Communication_Data::ENABLE_BUFFER_ORDER,&received_enable_buffer_callback);
Disable_Buffer_Order = new HeapOrder(Communication_Data::DISABLE_BUFFER_ORDER,&received_disable_buffer_callback);
Expand All @@ -70,5 +69,5 @@ void Communication::send_UDP_packets(){
}

bool Communication::is_connected(){
return ControlStationSocket->is_connected();
return ControlStationSocket.is_connected();
}

0 comments on commit c706017

Please sign in to comment.