This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Connection interval limits

Hello!
As far as we understand - the minimal interval between packets is ~7.5mS.
We tried to send HOGP packets that simulate mouse movements every ~10mS unsuccessfully.
Can you guide us with the required code modifications in order to improve the interval?
Thanks,
Yuri.
  • Yuri,

    Can you explain more about how you simulated the mouse movement for 10ms interval? What changes did you make in the HOGPDemo?

    Did you use the GAP_LE_Connection_Parameter_Update_Request API? Prototype for this API is defined in the GAPAPI.h file.

    Best regards,

    Vihang

  • Hello,

    My first changes to the HOGP were such that made it send out mouse instead of keyboard notifications.
    i changed the report map and all relevant calls to match the mouse reports which are 3 bytes long.

    Regarding the movement, I have created a function which sends out a mouse notification each time it is called,
    each call the mouse report parameters toggle , for example: the first notification will be Right the second Left the third right and so on.

    this function was added to the scheduler and timed to be called each 10 mS.

    Regarding the API you wrote about - We havent used it.
  • Yuri,

    Depending on whether your device is LE master or slave, the following APIs (prototypes in GAPAPI.h) are responsible for updating LE connection parameters like the connection interval.

    - GAP_LE_Connection_Parameter_Update_Request : This API will need to be called if the local device is LE slave and requesting connection parameter update.
    - GAP_LE_Connection_Parameter_Update_Response : This API will be used in the registered GAP callback when the local device is master and a remote slave requests connection parameter update. Only the LE slave can request connection parameter update, the LE master can only respond to the request.

    If in the slave mode, you can use the first API with the appropriate minimum and maximum connection interval values and use the confirmation in the GAP callback or GAP_LE_Query_Connection_Parameters API to verify that the connection interval is updated to what you specified. Please try this approach before sending mouse notifications every 10ms from the application.

    Best regards,
    Vihang
  • Vihang,

    Thank you for your response.

    I will try this ASAP and write back about the results.

  • Hi Vihang!

    Since the device is an LE Slave in my project i have tried to use the (GAP_LE_Connection_Parameter_Update_Request ) and (GAP_LE_Query_Connection_Parameters ). I have set the interval parameters to the possible minimum (according to the defines in the GAPAPI.h file - which is 8 mS).

    the function (GAP_LE_Connection_Parameter_Update_Request ) returns zero (as it should on successful operations) but the value of the interval remains 49 mS (as its default value from the beginning of the connection with my smartphone).

    Is it possible that the LE Master denies this request? how can i check this? what can i do next?

    thank you,
    Yuri
  • Hi Yuri,

    What is the Central device (Master) in your test? If it is an iOS device, you might want to take a look at this article : 

    1. Yes, the master can reject the update parameter request if it does not comply with its stack requirements. As the documentation for the GAP_LE_Connection_Parameter_Update_Request() API states, this function will return 0 on successful execution but this return value does not indicate whether the Master accepted/updated these parameters or rejected them.

    2. For that, you will need to look for the etLE_Connection_Parameter_Update_Response in your GAP_LE_Event_Callback(). If this case does not exist in your GAP_LE_Event_Callback() function, you might want to add the case etLE_Connection_Parameter_Update_Response under switch(GAP_LE_Event_Data->Event_Data_Type). 

    3. When the GAP_LE_Event_Callback() is called with this event type, the GAP_LE_Event_Data->Event_Data.GAP_LE_Connection_Parameter_Update_Response_Event_Data->Accepted field will show you a Boolean indication whether or not the Master accepted the parameters.

    4. If it did (...->Accepted = 1), then you can call the GAP_LE_Query_Connection_Parameters() to verify that the connection parameters are updated.

    Best regards,

    Vihang

  • Hi Vihang!

    1. My master device is an android - Nexus 5.

    2. I had no case of  "etLE_Connection_Parameter_Update_Response" so i added one as you said.

    Afterwards i tried to do a parameter update with the desired interval parameters --->

    (GAP_LE_Connection_Parameter_Update_Request(ApplicationStateInfo.BluetoothStackID, ApplicationStateInfo.LEConnectionInfo.BD_ADDR,MINIMUM_MINIMUM_CONNECTION_INTERVAL,MINIMUM_MAXIMUM_CONNECTION_INTERVAL,MINIMUM_SLAVE_LATENCY,28000); )

    the value of  (...->Accepted ) was Zero, so i understand the response was negative and therefore nothing changed.

    do you know of any limitation by android that can cause this ?

  • Hi Yuri,

    Searching around the internet, it looks like 11.25ms is the fastest connection interval allowed on android.

    Best regards,
    Vihang
  • Hello Vihang!

    After further testing with higher values of interval i am happy to say this is working.

    i guess that it was androids problem and although the interval now is over 10mS it is still good enough for me.

    I will make some more test and make sure that the change has really taken effect,

    I'll update on this subject as soon as i will do this.

    thanks again,

    Yuri.