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 inquiry

Other Parts Discussed in Thread: CC2540

Hi,

I am using a temperature sensor along with a CC2540 based module that connects to an iOS device and sends out notifications in various times.

Because the update times alter from  20ms to 40 minutes, i issue a connection parameter update request from the CC2540 module, that is using the peripheral profile and i can successfully alter the connection parameters to match mine and Apple's requirements . (Verified with a packet sniffer)

As i am trying to  improve some latency issues and also ensure that some valuable data are sent successfully without being dropped due to big or small connection interval times, i would like out to find out if possible,  when the connection interval occurs in the Link Layer level so i can synchronize my notifications accordingly. 

Best regards,

George

  • Hi George,

    If you wish to send data quickly from the sensor when relevant but save power, use slave latency to skip some of the master's connection events. If you wish to send data quickly (low latency) from the master, you must simply use a faster connection interval.

    You can use the function (albeit a bit undocumented) LL_TimeToNextRfEvent, used in hal_sleep.c in halSleep() to find out how many 32hHz ticks remain until the next scheduled event.

    However, if you use slave latency, an event will, if there is time, be re-scheduled before this when you e.g. send a notification from the application.

    Best regards,
    Aslak

  • Hi Aslak,

    Thank you for your reply. I will look it up.

    Best regards,

    George

  • Hi Aslak,

    After making use of the GAPRole_GetParameter (uint16 param, void *pValue) function to get the connection interval, timeout and slave latency times, i realized that the values returned do not reflect the actual effective values of the connection.

    I was trying on purpose to break a connection between a CC2540 and an iOS device by issuing a connection interval that is below 20ms. When the connection was dropped, i reconnected again from the iOS device and tried to read the connection parameters that were actually the invalid numbers used before.

    Am i missing something or is there another function that returns the actual parameters of the active connection?

    Best regards,

    George

  • Hi George,

    The parameter GAPROLE_CONN_INTERVAL gives the actual connection interval in use after a connection is established, or a parameter update request has been successfully completed. Note that the value will be in 1.25ms steps, so a value of 6 is 7.5ms, ref comments in peripheral.h.

    After a reconnection, this parameter will then most likely reflect the parameters specified in the new connection request made by the Central device, those now being the actual parameters. Unless an update request has been processed before reading the value.

    The same should be true for GAPROLE_CONN_LATENCY and GAPROLE_CONN_TIMEOUT. Do you find this not to be the case?

    Best regards,
    Aslak 

  • Hi Aslak,

    Actually i was doing something wrong and instead of reading the actual connection interval, i was reading the minimum connection interval value.

    I apologize for my previous question and thanks for your help.

    Best regards,

    George