Ok so I have made some headway & am now sending floats over UDP as binary data (4 bytes), followed by a null packet (1 byte of "\0") but am not sure how to unpack the data into a float in GRC… It's all happening within the same machine on an Intel Mac so there shouldn't be any issues with endianness. Any ideas / suggestions?
Cheers, Mark -- mark.cetilia.org | mem1.com | reduxproject.com On Sep 13, 2011, at 8:24 PM, Mark Cetilia wrote: > Thanks so much Marcus, this makes perfect sense… > > Cheers, > Mark > > -- > mark.cetilia.org | mem1.com | reduxproject.com > > On Sep 13, 2011, at 7:45 PM, Marcus D. Leech wrote: > >>> I'm producing the stream in C++ (using openFrameworks) and sending the data >>> as char arrays, >>> and have confirmed that this is indeed all that is being sent (e.g. "1.25")… >> So, you're sending them in ASCII? As ASCII strings? >> >> GRC/gnuradio has no method for dealing with that. The UDP block assumes >> native machine-binary format for data coming in >> over UDP. Doing it in ASCII (Or Unicode, or whatever) strings will be >> hugely inefficient, both in terms of bandwidth required-- >> it takes many more bytes to represent a floating-point number in ASCII, than >> in the native binary format, and converting from >> strings back into the native binary format is also quite expensive. Since >> UDP is entirely binary transparent, there's no reason >> to send them as ascii strings. The only thing you have to watch out for is >> if the raw floating-point format between your two >> machines is different. But between x86-family machines, it's all the same. >> >> >> >> -- >> Marcus Leech >> Principal Investigator >> Shirleys Bay Radio Astronomy Consortium >> http://www.sbrac.org >> >> > > > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio