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 Parameter Change

Hi guys,

I'm writing four characteristics ,19 bytes each, from a central device to a peripheral and I changed the connection interval parameter to increase the throughput. I put it to the minimum value (7.5 ms) for both the maximum connection interval and minimum connection interval parameters. I understand that the connection interval is the time between two connection events so I'm trying to calculate it using the packet sniffer by checking the time difference between two physical channels (which correspond to two connection events) but the value I get is larger than the one I put in the code. Please have a look at the below figure. Channel 0x0B of this connection event is taking around 102 ms.

I thought it should be around 7 ms, What am I missing here?

Thanks a lot

  • Hi Hafiz,

    How did you update the parameters? It does look like you have 100ms interval.

    - If you updated using the slave update param request, note that the change will take effect some events in the future. Perhaps as  much as 300. In this case, did you see the parameter update request in the log?

    - If you updated the preferred central device parameters it should take effect the instant you connect. What is the Interval parameter of the ADV_CONNECT_REQ packet?

    Best regards,
    Aslak 

  • Hi Aslak,

    I set the maximum and minimum connection interval in the code to 6 (7.5 ms) as shown below

    #define DEFAULT_UPDATE_MIN_CONN_INTERVAL      6

    #define DEFAULT_UPDATE_MAX_CONN_INTERVAL      6

    but when I checked the interval parameter on the ADV_CONNECT_REQ packet I found it to be (00x50)  which is 80 units (125 ms)  as shown in the below snapshot 

    shouldn't it be 6 ?


    Thanks for your reply,

    Hafiz

  • Hi Hafiz,

    It seems like you have updated the code in the peripheral device. Anyway, if you did it on the central device code the difference is the same, because as you can see from the comment above the define:

    // Minimum connection interval (units of 1.25ms) if automatic parameter update request is enabled
    #define DEFAULT_UPDATE_MIN_CONN_INTERVAL 400

    Thus, without knowing more about how you connect, I can offer you a couple of pointers

    - In the case that you are modifying the code of an application like simpleBLEPeripheral, either
    -- a) Change the default params as you already have done, then change #define DEFAULT_ENABLE_UPDATE_REQUEST FALSE to TRUE, or
    -- b) Change the Connection settings in BTool if that's what you are using, then press Set.

    - In the case that you are using e.g. simpleBLECentral
     Then the params above do not have any effect, and you will need to set the two parameters below, as found in gap.h

    #define TGAP_CONN_EST_INT_MIN 21 //!< Minimum Link Layer connection interval, when using Connection Establishment proc (n * 1.25 mSec)
    #define TGAP_CONN_EST_INT_MAX 22 //!< Maximum Link Layer connection interval, when using Connection Establishment proc (n * 1.25 mSec)

    You do this similar to other parameter changes as seen in the function SimpleBLECentral_Init, namely by calling
    GAP_SetParamValue( TGAP_CONN_EST_INT_MIN, 6);

    However, be aware that using a value of 6 makes the timing extremely tight, and any processing that you do on either side of the link must be carefully designed to not interfere with connection events.

    Best regards,
    Aslak

  • Hi Aslak,

    I changed those parameters and now I'm able to change the connection interval.

    Thanks a lot.

  • Nice!

    Since this apparently answered your question, please press Verify Answer to keep the forum tidy and so I can get my sweet sweet points :)

    Best regards,
    Aslak 

  • Hi Aslak,

    I have another question which I hope you would be able to answer, I read in the forum that the maximum amount of user data that can be sent in a connection interval is 80 bytes. I tried to send multiple characteristics using the unacknowledged method "GATT_WriteNoRsp" and the maximum number of characteristics I was able to send is 4, even when I changed the size of the characteristic to 10 bytes or even one byte. Someone posted in the forum saying that he was able to send six notifications in a connection event and that as long as the user data is less than 80 bytes you can send as many notifications as you want. My question is: Is the maximum number of characteristics that can be sent in a connection interval is 4? if so, if I have more than 4 characteristics in my application what can I do to send them in different connection events ?

    Thanks,

    Hafiz

  • Hi,

    I don't know, actually. Did you try GATT_Notification? Maybe someone who knows will answer in another thread.

    Also, please post separate questions in separate threads.

    BR,
    Aslak