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

I want consistent timing of S132 nus packets

I have an application where I read a IMU at around 60 - 80 hertz.

How should I configure the S132 so I can send my 14 byte string packet with a constant time interval?

I need the packet to be sent immediately and not be buffered an packed with another in a notification time slot.

Is there any configuration needed of ble timer values for ble notification to get this to work?

That is one message sent for every call to the bleuart send systemcalled.

Hope this is a understandable question.

Bo-Erik

  • I'm assuming you are developing a peripheral device.

    This constant time interval would be the connection interval. It is central device that dictates the connection interval, but as a peripheral you can send a connection parameter update request to the central.

    If you want to send packets at 80 Hz you would need a connection interval no smaller than 1/80 = 0.0125 s = 12.5 ms. It depends on the central if it will accept a request for this low a connection interval or not. There are some questions discussing this in here.

    Packets are not sent immediately, packets are sent on every connection interval. So you queue one or more packets, and when a connection event begins as many as possible of the queued packets will be sent to the peer, but sometimes no data packets are sent, because of packet loss or a system packet that occupies the slot.

    You say that you don't want to buffer more than one packet, then you will have to wait for the event that tells you that the packet is sent before you queue a new one. Similar to Variant #2 here.

  • If you want "real time processing" of the packets, I suggest going proprietary protocol like shockburst. If latency is acceptable, why don't you just buffer the packets, and process them in specified interval on the receiver?

  • I did a quick Google, did not find anything on how to use shockburst with linux, windows 10, OSX, IOS or Android. I will need to present solutions for connecting to all platforms, I did not read all of the SDK shockburst info.

  • I think you did not mention you want to connect that with linux/win10/osx/ios/android, and i assumed connection between nRF's.

    So, if you are using devices like that, you will have some delay anyway. You should buffer the samples ex in groups of 10, send them by BLE, and process in constant interval on receiver.

Related