emconninfo_setSlaveLatency()

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

I would like to know what this function does and how it affects the master and slave when in a connection.

Ideally, I would like to not do a connection update request from the slave to speed the connection up but instead use this to fix the slave latency locally from the slave.

Hope that makes sense.

Thanks,

Vincent

0 Likes
1 Solution
Anonymous
Not applicable

Hello Vincent,

Only the Master is allowed to set the Slave Latency.  The slave can request a latency,

You need to change the latency using the bleprofile update parameters:

void bleprofile_SendConnParamUpdateReq(UINT16 minInterval, UINT16 maxInterval, UINT16 slaveLatency, UINT16 timeout)

   if (minInterval > maxInterval)

   return;

Look at the wiced_sense App:

// Request a connection interval that seems to be responsive enough,

bleprofile_SendConnParamUpdateReq(64, 96, 0, 500);

// yet, a bit mindful of power.

This is what you invoke to say what your slave latency needs to be.

You can request 1 slave latency value - You cannot request a range.

Again, the slave latency is set by the Master.  You can request it, but the Master may not give it to you.

Hope this helps.

Thanks

JT

View solution in original post

0 Likes
8 Replies
JacobT_81
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

The slave latency parameter is useless unless the master accepts the parameter. It gives the slave permission to not respond for some number of connection events before the master initiates a disconnect. If you attempt to not respond to connection events more than the agreed upon latency, you'll lose the connection.

Jacob

0 Likes
Anonymous
Not applicable

Hi jakewtorres

So are you saying that the function emconninfo_setSlaveLatency() will eventually general a lel2cap_sendConnParamUpdateReq()?

Here is my use case:

- On connection the master and slave negotiates and establishes a connection interval = 384 and slave latency = 30

- We can see that the slave will transmit with latency = 30.

- On some event, the slave will call emconninfo_setSlaveLatency() with latency = 0.

- What will happen next?

What I would like to do is control the slave latency without kicking off a ConnParamUpdateReq().  Would this be possible?

Thanks,

Vincent

0 Likes

I'll have to check in with the developers about at what point the master is updated with the new parameters; whether _setSlaveLatency() automatically updates the master, I'm unsure.

Calling ConnParamUpdateReq() after _setSlaveLatency() wont't hurt anything besides a minuscule increase in current draw in transmitting. No matter what updating the slave latency locally will have no effect on the system. If _setSlaveLatency doesn't update the master, you'll have to do it manually.

Jacob

0 Likes
Anonymous
Not applicable

Great, thanks for checking with the developers.  I want the slave to control its latency up to the limit established by the master without having to do a

ConnParamUpdateReq(). 


Vincent

0 Likes
Anonymous
Not applicable

Hello Vincent,

The Slave has to ask the Master to make any changes.

It seems like what you want to do is to set the connection interval without telling the Master.

There is no standard method of doing this.

The Master has to tell the slave to make the change and both sides have to be aware of it.

Thanks

JT

0 Likes
Anonymous
Not applicable

Hi JT,

In my example:

- On connection the master and slave negotiates and establishes a connection interval = 384 and slave latency = 30

- We can see that the slave will transmit with latency = 30.

So in this example, the master allows slave latency 0 to 30 without a conn. update and the master will still poll at 384.

Question:  Is there a way to tell the slave to pick a slave latency between 0-30?

Thanks,

Vincent

0 Likes
Anonymous
Not applicable

It may not matter to you but I have found a slave latency greater than 4 or 5 does not seem to be acceptable to iOS BLE. I think I tried 5 and it failed.. But I know 4 works.  Ultimately it depends on the max connection interval and supervision timeout and for larger intervals the max latency is reduced. See the iOS BLE developer guidelines for details.

0 Likes
Anonymous
Not applicable

Hello Vincent,

Only the Master is allowed to set the Slave Latency.  The slave can request a latency,

You need to change the latency using the bleprofile update parameters:

void bleprofile_SendConnParamUpdateReq(UINT16 minInterval, UINT16 maxInterval, UINT16 slaveLatency, UINT16 timeout)

   if (minInterval > maxInterval)

   return;

Look at the wiced_sense App:

// Request a connection interval that seems to be responsive enough,

bleprofile_SendConnParamUpdateReq(64, 96, 0, 500);

// yet, a bit mindful of power.

This is what you invoke to say what your slave latency needs to be.

You can request 1 slave latency value - You cannot request a range.

Again, the slave latency is set by the Master.  You can request it, but the Master may not give it to you.

Hope this helps.

Thanks

JT

0 Likes