Hey ,
Thanks for the support .
I was quite dump . I overthinked a bit , jus serializing class members to and ostream would be enough for me hopefully.
I am in another spot :
I have serialized some data into an ostream to be send over a devicefile., in binary format.
I am getting output like this when printing the contents of ostream which is fine.
Now I need to calculate the checksum using a certain algorithm :
Here is an analogous implementation :
uint8_t Connector::calculateChecksum(uint8_t* data, uint16_t length)
{
uint16_t* checksumData = (uint16_t*) data;
uint8_t ret = 0;
int length16;
if(0 == length%2)
{
length16 = length/2;
}
else
{
length16 = (length/2) + 1;
}
for(int i = 0; i