This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Data in binary format over UART

Hello. How can I send binary data (in order to not convert it to ASCII string) over UART?

I have sensor data (obtained over BLE). Every measurement is 13 bytes, sample frequency is 2kHz. I need to save it on PC. I decide to work over UART. So if I convert it in normal readable data with float point, then convert to string and then send over UART with 2kHz frequency it will be to fast for max possible uart speed of my nrf52832.
Thats way I want to send it in binary format. How can I do it?
Thanks in advance

Parents
  • Just send it - UART doesn't care what data you send and what format it's in. Just put the data in a buffer in the original binary format, whatever that is, send the buffer using the uart send method. On the other end receive the data and interpret it. You don't need to convert it to a string,  you don't need to do floating point on the nRF side, you just send the bytes. 

Reply
  • Just send it - UART doesn't care what data you send and what format it's in. Just put the data in a buffer in the original binary format, whatever that is, send the buffer using the uart send method. On the other end receive the data and interpret it. You don't need to convert it to a string,  you don't need to do floating point on the nRF side, you just send the bytes. 

Children
Related