CC2642R:Impact of broadcast data on existing Bluetooth connection

Part Number: CC2642R

Tool/software:

Hi,

1. Through a 1s period software timer, different broadcast data is reloaded once a second, and the connection parameters of an established connection (as the host) are updated to: Interval-1s, Timeout-8s, Latency-0. Through simulation, it is known that GAP_LINK_PARAM_UPDATE_EVENT has been received, but no data packets are sent out in the subsequent connection events as the host, resulting in a connection timeout disconnection.

2. On the basis of 1, the timer period for reloading broadcast data is set to 2s, or the connection interval is updated to 625ms, so that after the connection parameters are updated, data packets are sent out and the connection can be maintained. However, data packets cannot be sent out for each connection event. Generally, it takes 2 to 3 connection intervals to send a data packet.

3. When broadcasting is enabled only at the beginning without reloading broadcast data, the connection can be maintained after the above connection parameters are updated, and the packet sending of the connection event is relatively complete.

Could you please help analyze the reasons for the impact of the above-mentioned heavy broadcast data on existing connections and provide any suggestions on how to avoid it?

  • Good morning.

    Thanks for reaching out. Could you please specify the SDK version you are using and if this is based on an out of the box example from the SDK? Could you please take a look at the return status of the functions you are using to transmit the data (GATT writes, notifications?), I would suspect a "bleNoResources" return status. In addition, how much broadcasting data is being reallocated and how are you doing this (loading by buffer / loading my handle?). I see a sniffer log attached, it would be useful if you can share the log file itself as well.

    BR,

    David.

  • 嗨,

    1. SDK version: simplelink_cc13x2_26x2_sdk_5_20_00_52

        在项目实例的基础上:简单的

    2.为广播转换尝试了以下两种方法:

    GapAdv_disable( advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX, 0 );

    GapAdv_loadByHandle(advHandleLegacy,GAP_ADV_DATA_TYPE_ADV,sizeof( advDataXpNormal ), advDataXpNormal );

    GapAdv_enable( advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX, 0 );

    GapAdv_prepareLoadByBuffer( advertData, FALSE );

    Len=Sizeof(提前数据);

    (d)管理信息系统;

    缓冲区(Len,广告数据);

    3.我们实际上不需要发送数据,但是它在连接中的作用是GAP_程序中心,所以在正常情况下它应该发送一个空包。从日志来看,我们的主机似乎没有发送空包,这导致了连接的时间中断。

    Hi,
    Some additional information:
    1. Today, I tried to turn on/off broadcast or reload broadcast data every time a connection event was completed. I found that once the broadcast was turned on/off or reloaded, the host could not send an empty packet in the next connection interval and had to wait until the next connection interval to send it.
    2. As you can see from the log below, when the connection interval is 30ms, it actually takes 60ms to interact once; when the connection interval is updated to 1s, it actually takes 2s to interact once.
  • Hello Mo,

    Thanks for the additional information. I am not sure what example is it or what return status are those (not in English).

    How are you modifying the advertisement data (where in the code)? How many max connections do you have set? I see a "remote user terminated connection" which is a disconnection due to the central after running a "Master Connection parameter request" where you are updating the parameters, if you don't execute this, do you still see a disconnection? Who is your central, is it a mobile application?

    BR,

    David.

  • Hi,

    1. This is a master-slave application. In the connection, CC2642 is central and periphera is another CC2642 device.

    2. The maximum number of connections is 3.

    3. If you turn off broadcasting in this function and then turn it on again, you will find that there is no packet in the next connection interval of the existing connection.

    When the connection interval is 1s, there will be a connection event every 2s.

    When the connection interval is 30ms, there will be a connection event every 60ms.

    The screenshot is from this log.

  • Hello Mo,

    I see. This could be because the stack doesn't have enough time to enable/disable broadcast in between connection events and it is queuing up the data and it is send at the next connection event. May I ask if this is negatively impacting the application? If you further increase the connection time do you see the same issue?

    BR,

    David.

  • 1.When the connection interval is updated to 1s, and the broadcast needs to be closed and opened within 1s each time, there will be no connection events, and then the connection will time out and disconnect.

    2.This seems to be affected by the action of turning on the broadcast, because the two connection events are separated by 1 second, which should be enough time.

  • Hello Mo,

    I would suggest taking a look at the Connection Fairness section of the documentation. You could try increasing the fairness priority of the connection event if loosing connection events over broadcasting is an issue here.

    BR,

    David.

  • Hi,

    I called the following function during initialization, and the problem still exists.

    HCI_EXT_SetQOSDefaultParameters(LL_QOS_HIGH_PRIORITY,
    LL_QOS_TYPE_PRIORITY,
    LL_QOS_CONN_TASK_TYPE);
    HCI_EXT_SetQOSDefaultParameters(LL_QOS_LOW_PRIORITY,
    LL_QOS_TYPE_PRIORITY,
    LL_QOS_ADV_TASK_TYPE);

    Will the action of enabling broadcasting necessarily cause the next connection event of the central role to be lost? Will this be the case with this version of the SDK?

  • Hello Mo,

    This could be a matter of resources then, because both tasks are executing around the same time. Could you share a bit more (code snippet if possible) about how you are enabling/disabling the broadcast data every x_interval?

    BR,

    David.

  • Hi,

    static void SimplePeripheral_processConnEvt( Gap_ConnEventRpt_t* pReport )

    Each time a connection event arrives, the following operations will be performed in this function:

    GapAdv_disable( advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX, 0 );

    GapAdv_enable( advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX, 0 );

  • Hello Mo,

    May I ask what is the use case? Why is the advertisement is being disable and enable at every connection event? When are you modifying the broadcast data? From my understanding the GapAdv_disable() uses only the handler as a parameter.

    BR,

    David.

  • Hi,

    Since there are two different broadcast data that need to be switched at a period of 1 second, but it is found that there will be no connection event when the connection interval is updated to 1 second, so in order to facilitate the operation of disabling and then enabling the broadcast or updating the broadcast data, a connection event will be lost, and then these operations are performed in the function(static void SimplePeripheral_processConnEvt( Gap_ConnEventRpt_t* pReport )).

    GapAdv_disable( advHandleLegacy);

    GapAdv_enable( advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX, 0 );

    or

    GapAdv_disable( advHandleLegacy);

    GapAdv_loadByHandle(advHandleLegacy,GAP_ADV_DATA_TYPE_ADV,sizeof( advertData), advertData);

    GapAdv_enable( advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX, 0 );

    or

    GapAdv_prepareLoadByBuffer( advertData, FALSE );

    GapAdv_loadByHandle(advHandleLegacy,GAP_ADV_DATA_TYPE_ADV,sizeof( advertData), advertData);

    Regardless of whether these programs are executed in this function(static void SimplePeripheral_processConnEvt( Gap_ConnEventRpt_t* pReport )), the connection event loss problem will occur.

  • Hello Mo,

    Would it be possible to try modifying the advertisement data (running GapAdv_disable / GapAdv_enable) when an advertisement stops at GAP_EVT_ADV_END instead at a connection event? For this you could use a timer like Clock or GPTimer to only modify the advertisement data inside the GAP_EVT_ADV_END after 1 second. Make sure you have more than 1 connection enabled so that the device keeps advertising even after the established connection.

    BR,

    David.

  • Hi,

    This method has been tried, and there is also the problem of lost connection events.

  • Hello Mo,

    Is this also the case when the frequency of updating the advertisement data is different to the one of the connection events (1 sec)?

    BR,

    David.

  • Hi,

    This has been tried, and the loss of connection events still occurs. When the broadcast data update frequency is 1s, some connection events will be lost when the connection interval is 625ms, more connection events will be lost when the connection interval is 800ms, and all connection events will be lost when the connection interval is greater than or equal to 1s.