Somehow there's always 5-10 new challenges for each one you solve in this field!
I'm reading 4 values from a doppler radar and I want to send the output (see attached image) via UDP protocol.
My first goal was to just sample the data and send average values which works fine.
However, with ALL the data I can actually re-create the tracking of objects on a 2D map, which I think is awesome!
**Is it possible to format all 4 arrays into 1 long string with a delimiter? **
Also, I tested 150 rows * 4 values and is roughly 2,5 kB, I have no idea whether this is a lot to send over UDP.
Why send it as ascii if that if what you intend (not sure)? If you send it as binary it will only be 600 values and you know each value could be 4 bytes long.
Either can be sent via UDP but depending on the what processor you are using buffering may be the issue if you convert it all to ASCII - so you may in that case have to send several smaller packets. Buffering may still be an issue using binary.
Looking back at your data, it could be that you could use a byte for each of the first 3 datatypes and an int (2 bytes) for the last giving you 750 bytes to transmit - but you would need to know the range of each value
Thank you for the answer, countrypaul!
I'm so new to this that I didn't think about sending it as bytes which is of course preferable.
I feel confident that I can decode whatever I get in the receiving end but I have trouble concatenating the arrays into one message in code. Would I need to place delimiters when sending it as bytes?
If sending as bytes you could treat the stream as a collection of fixed length records, each one being say 16bytes long (if using 4 bytes per value), or n bytes long where n is the sum of the length of each datatype (I can only guess since I don't know the ranges). At the receiving end you would have the choice of copying out each m bytes (value of m between 1 & 4) into a suitable variable, or if you were more ambitious you could use a struct with 4 variables and copy the data for the whole struct in one go for example 16bytes into 4 4byte variables. You don't say where the data is going, but if it was, for example, to a PC the PC could have an array of 150 structs and copy all the data directly into that.