Send struct int using serialport


@akidou had deleted the contents of his original post. He has been warned that this is at best bad manners and the post has been restired

I assume from the title in that console window that the other side is a 32 bit or 64 bit processor.

What size is int? For which processor?

Kudos for using memcpy. That is the right choice.

are you assuming your int are 4 bytes ? (only 2 bytes on UNO, will be 4 on ARM architecture). Mind also endianness

64 bits, leonardo board
did I made a mistake when declaring the incoming data size 255 ?
i've found that "Person struct" size is 8 thats why I wrote #define BYTE_SIZE 8


have you tried to print the byte stream you get on the Arduino side ?
endianness might come and bite you. Arduino is little endian

@akidou - it is very unhelpful and bad manners to vandalise your original post so that there is no context to the replies. The most recent version of your original post has been restored

Do not vandalise topics

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.