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

Ble client, synchroizing ble packages

Situation:

I'm using a nrf52840 with the nordic sdk 15.2 acting as a Gateway ( Ble Client). On the other side I
have four nrf52832 (sdk 15.2) acting as servers.

My software is based on nordics UART example (sdk 15.2).

Each server is sending sensor data with 100 Hz and a max package size of max 250 bytes via notification.

Problem:
I expected, that the gateway will recieve the ble packages sequentially. But that is not the case.

Example with two ble server:

I expected:

Received data from server 0
Received data from server 1
Received data from server 0
Received data from server 1
Received data from server 0
Received data from server 1
...

The notification handler is notifing this:
<info> app: Received data from server 1
<info> app: Received data from server 1
<info> app: Received data from server 1
<info> app: Received data from server 1
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 0
<info> app: Received data from server 1
<info> app: Received data from server 0
<info> app: Received data from server 1
<info> app: Received data from server 1
<info> app: Received data from server 0

Question:
Is there a way to "synchronize" the received data. So that the notification handler is notifing the data sequentially?

Parents
  • Hi

    The notifications are forwarded as they are received, you don't have any control over this unfortunately. 

    First off if you are sending a lot of data you will typically receive multiple packets pr connection event, which is why you are seeing groups of notifications from the same server. 

    Secondly, if there is any packet loss between one server and the client this will delay the packet transmission, and the server will have to "catch up" on following connection events, leading to a varying number of packets being sent on each event. 

    Best regards
    Torbjørn

Reply
  • Hi

    The notifications are forwarded as they are received, you don't have any control over this unfortunately. 

    First off if you are sending a lot of data you will typically receive multiple packets pr connection event, which is why you are seeing groups of notifications from the same server. 

    Secondly, if there is any packet loss between one server and the client this will delay the packet transmission, and the server will have to "catch up" on following connection events, leading to a varying number of packets being sent on each event. 

    Best regards
    Torbjørn

Children
Related