user3660570
user3660570

Reputation: 337

How does BLE parameter negotiation work?

I'm wondering how the negotiation for parameters work when the "central" and "peripheral" have different parameters set.

I might be mistaken, but from my understanding the peripheral makes an update request when connecting to have it's parameter set for the connection. And then the central decides whether or not to approve them.

What I don't understand is how it is decided if those parameters are approved or not. And I haven't found any code for it.

For example if I have the following settings(just picking random values):

Central: Interval 10ms, Slave latency 0, supervisortimeout 500

Peripheral: Interval 50ms, Slave latency 10, supervisortimeout 3000

How can I know for certain that my peripheral parameters will be used or what are the criteras for them to be approved ?

If someone out there could give a nice explaination I will be very thankful.

Upvotes: 2

Views: 1642

Answers (1)

Nipo
Nipo

Reputation: 2927

Central does what it wants, Peripheral has to abide the parameters, or disconnect.

Peripheral can kindly ask for other parameters that the ones edicted by the Central, but nothing tells they must be approved.

Acceptance criteria from the Central is a mix of constraints:

  • normative (these are constant and global),
  • implementation specific, most of the time, they depend on the Peripheral type / implemented services (Apple explicitly defines some, for instance (see 3.6)),
  • dynamic (if Central is managing multiple connections at the same time, it may prefer to schedule them in a way their respective intervals are multiple of a common base.

While developing a Peripheral, you cannot tell whether the connection parameters you prefer will be used. You have to cope with it. Moreover, some centrals will connect with fixed parameters, issue a connection parameter update just after connection, and then enumerate services and take a decision, so you cannot blindly disconnect when a connection parameter update does not fit your needs.

Upvotes: 4

Related Questions