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

Notification timing not correct.

Hello Devzone,

I've been working on a system to set notifications on time ready for transmission.

The client sends a WWR package to my peripheral and I want my peripheral to send a notification back in the same connection interval.

The client and peripheral both have a 7.5ms min and max connection interval.

To my knowledge a notification has to be set before the transmission moment occurs.

My approach is to have one free running timer captured as soon as I get the WWR message, I'll add that captured value with x (roughly 6ms in timer ticks) to a new compare register to create an event to set a notification ready for the next connection interval.

When the compare event strikes I do a sd_ble_gatts_hvx(....) and set my notification ready.

I've added a picture to help understand what I'm trying to achieve. 

The problem I'm having is that the notification is not send as I pictured here.

Instead the notification is set at the right time but instead of being transmitted in the following connection interval, it is being transmitted in the connection interval after the intended interval.

I've tried changing the time for when the notification is set ready for transmission but this either resulted in ERROR_NO_RESOURCES or in the same behavior.

When I change the WWR and notification time so it is transmitted every 15ms instead of 7.5ms I get the following behavior.

This is really bugging me and I cannot find what I'm doing wrong here.  

Can anyone help me with my struggles?

Kind regards

  • I am not sure where to go from here. Is there some way for me to reproduce what you are seeing? 

    You would need to zip your project. Due to limited staffing I don't have time to develop this myself based on a description. I need to see exactly what you are seeing. So if you zip the central and the peripheral project, and attach it here, together with a short description on how to reproduce it and what to look for, then I can have a look.

    If that is not possible, the only thing I can say is that if you queue a packet too late, then the softdevice will not have time to set it up before the next connection interval, and it will be sent the one after that.

    BR,

    Edvin

Related