8 Replies Latest reply on Nov 19, 2015 1:08 PM by jota_1939431

    emconninfo_setSlaveLatency()

      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

        • 1. Re: emconninfo_setSlaveLatency()
          JacobT_81

          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

          • 2. Re: emconninfo_setSlaveLatency()

            Hi JacobT_81

             

            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

            • 3. Re: emconninfo_setSlaveLatency()
              JacobT_81

              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

              • 4. Re: emconninfo_setSlaveLatency()

                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

                • 5. Re: emconninfo_setSlaveLatency()

                  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

                  • 6. Re: emconninfo_setSlaveLatency()

                    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

                    • 7. Re: emconninfo_setSlaveLatency()

                      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.

                      • 8. Re: emconninfo_setSlaveLatency()

                        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