I wonder which data type is the most suitable for representing bytes I send via Windows API winsock.
I'm currently working on receiving and sending data frames on network sockets, as well as a CAN data stream. Basically I'm receiving data on a CAN stream from a measurement system (eg. bloodpressure, ecg..). Because of the CAN stream API I rely on, the data is received in BYTE (typedef unsigned char BYTE in Windows API minwindef.h).
Now, I'm looking to send the bytes via winsock2 API function WSASendTo, which expects the type LPWSABUF (char*), defined in winsock2.h.
Between receiving (from CAN stream) and sending (with WSA API), I'm doing several operation on the bytes buffer in order to create a suitable frame that can be sent. This includes "cutting" the received buffer, basically splitting the buffer using only payload bytes (e.g. bytes 3-7) and id bytes (e.g. bytes 1-2).
What kind of data type should the byts during extraction of information (creation of suitable frame with id and payload) have? I'm thinking of:
char*std::vector<std::char>std::unique_ptr<byte>std::vector<std::byte>BYTEfromrpcndr.h