doc-helmut wrote:yes, starting the first char of the array by 0x00 / 0x01 is probably the better choice than starting by 'a'.
Actually, it is probably better practice to use a higher value (more like 'a'), than 0x00 (often interpreted as NULL).
doc-helmut wrote:1) how does the recipient know that the msg he gets has to be interpreted as a 4-byte string what he receives and not 4 single unsigned/signed bytes or one 32-bit long integer or two 16-bit ints (if the sender is transmitting all those different patterns mixed up and garbled)?
The user-code needs to know how to translate the data. There is no magic way of knowing, it's just how you have the receiving NXT assemble the data.
doc-helmut wrote:2) what about sending / receiving floats?
Well, you could format them as a string with n number of digits, and then convert it back once received.
doc-helmut wrote:3) what is the maximum size of transmitted arrays (strings=arrays of char (+ terminating "0x00"?), or arrays of ints, or arrays of long or floats) ?
I think it's around 64 (maybe 63 plus null?).
Once I have finished assembling my array of data, I always flatten it into a string for sending. On the other end, I unflatten the string into an array, and then dis-assemble it however I need to (NXT address, commands, motor powers and directions, etc.).