I have a data struct that I am converting to uint8_t and sending it over a tcp socket connection. For the server side I have a python. How do I convert the data and display the struct information.
//data struct
typedef struct {
int enable;
string name;
int numbers[5];
float counter;
}Student;
//convert data to uint8 and send over tcp socket
uint32_t size = sizeof(student);
std:vector<std::uint8_t> data(size);
std::memcpy(data.data(), reinterpret_cast<void*>(&student),size)
sendDataOverTCPSocket(data);
Appreciate an example on how to do this.
Thank you
Used this https://www.digitalocean.com/community/tutorials/python-socket-programming-server-client socket_server.py code as the server application