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

nRF8001 ChangeTimingRequest

The ble-sdk-arduino UART examples (and others?) have a rather convoluted scheme to delay the ChangeTimingRequest until after an ACI_EVT_PIPE_STATUS event indicates that the Pipe is open.

The "System command/System event operating mode dependency" table in the Datasheet shows that ChangeTimingRequest is available only in Active mode, with a note that it is only available after a ConnectedEvent - no mention of any requirement on Pipe status.

So why do the examples have this dependancy on Pipe Status - is there a specific reason for that ?

Parents
  • There are two reasons for this implementation. First we didn't want to change the timing parameters until after the service discovery procedure completed, and waiting until notifications are enabled (will result in the pipe status event) ensures this. The reason we wanted to wait is that we usually use slower parameters after the update procedure, and we have the same scheme for most/all examples.

    The second reason (if I remember correctly) was that iOS wasn't to found of connection parameter update requests being sent to soon after the connection was established. This could in some cases lead to the connection being terminated (I don't remember the exact details).

    Unfortunately there is one problem with this scheme. In case you reconnect to a already bonded device, the bonded device will assume the peer keeps the state of it's CCCD's (as per spec), so we don't necessarily get the pipe status event. So there is a risk the connection parameters might not get updated. A better implementation could be to simply check the timing given when the connection was established and use a timer to trigger the Connection parameter update request.

  • Great - thanks.

    It would be useful if these things were noted in the code.

Reply Children
No Data
Related