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

nrf52832 ble_uart project - sending all data received on uart over BLE

Hi

I have problem because i dont get all data which are in FIFO uart  on my smartphone via BLE. Nrf as i can see in example sends data where data[index-1] == 0x0d || data[index-1] == 0x0a.

Becase not all message which nrf52832 get via uart ending with 0x0d or 0x0a i dont receive on my smartphone.

I want that every byte nrf52832 get on uart it sends over ble. I have tried with smaller buffer and changing/adding conditions in 

but nothing help with that. When messages are ended with 0x0d 0x0a i dont see on my smartphone 0x0a.

  • it doent get in error. It behave like nothing happend like it doent receive more bytes to uart 

  • everything is ok on every baudrate when i use default settings in main.c  that nrf sends over ble to smartphone message when on uart is received 0x0a or 0x0d but that its not fine with me i want to every byte which is received over uart immediately sends over ble to smartphone because  for protocol which is used on smartphone and device on which nrf52s uart is connected it never should pass more than 1500ms  between two character/messages( some messages is almost 512 bytes) till end of communication session.

  • Maybe you can try to start an app_timer on the first byte and then send the whole message when it times out? Note that you won't be able to send the whole 512bytes in one go, it will cut up in chunks.

  • This size of 512 bytes is only important when is ble_uart default setting that it sends data only when over uart receive 0x0a  or 0x0d.

     when it sends byte by byte  is best solution for me but that for some reason doesnt work on bigger baudrate (code which i have posted above in this topic) 

  • Have anybody some suggestion how to achieve that this work on bigger baudrate on uart?

1 2 3