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.

CC2652R: CC2652

Part Number: CC2652R

Hi Team,

I set up dual broadcasting on cc2652. After I connect it, could you please tell me how the broadcasting end would identify which broadcasting is being connected and how to obtain it?

Kind regards,

Katherine

  • Hey Katherine,

    Can you clarify the use case here? What do you mean by setting up "dual broadcasting"? Which SDK version and example project are you using as a base?

  • Hey Ammar,

    simplelink_cc13x2_26x2_sdk_5_20_00_52_ rtls_demo_patch_v1_0_1,

     GapAdv_create(&multi_role_advCB, &advParams1,
                    &advHandle);
    
      // Load advertising data for set #1 that is statically allocated by the app
      GapAdv_loadByHandle(advHandle, GAP_ADV_DATA_TYPE_ADV,
                          sizeof(advData1), advData1);
    
      // Load scan response data for set #1 that is statically allocated by the app
      GapAdv_loadByHandle(advHandle, GAP_ADV_DATA_TYPE_SCAN_RSP,
                          sizeof(scanResData1), scanResData1);
    
      // Set event mask for set #1
      GapAdv_setEventMask(advHandle,
                          GAP_ADV_EVT_MASK_START_AFTER_ENABLE |
                          GAP_ADV_EVT_MASK_END_AFTER_DISABLE |
                          GAP_ADV_EVT_MASK_SET_TERMINATED);
    
      BLE_LOG_INT_TIME(0, BLE_LOG_MODULE_APP, "APP : ---- GapAdv_enable", 0);
      // Enable legacy advertising for set #1
      status = GapAdv_enable(advHandle, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
      
      
      
      
      
       GapAdv_create(&multi_role_advCB, &advParams2,
                    &advHandle1);
    
      // Load advertising data for set #1 that is statically allocated by the app
      GapAdv_loadByHandle(advHandle1, GAP_ADV_DATA_TYPE_ADV,
                          sizeof(advData2), advData2);
    
      // Load scan response data for set #1 that is statically allocated by the app
      GapAdv_loadByHandle(advHandle, GAP_ADV_DATA_TYPE_SCAN_RSP,
                          sizeof(scanResData2), scanResData2);
    
      GapAdv_setEventMask(advHandle1,
                          GAP_ADV_EVT_MASK_START_AFTER_ENABLE |
                          GAP_ADV_EVT_MASK_END_AFTER_DISABLE |
                          GAP_ADV_EVT_MASK_SET_TERMINATED);
    
      BLE_LOG_INT_TIME(0, BLE_LOG_MODULE_APP, "APP : ---- GapAdv_enable", 0);
    
      status = GapAdv_enable(advHandle1, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);

    According to the customer, two broadcasts are started in this way. After the broadcast is connected, how could the customer identify from broadcast end which broadcast is being connected, and how could the customer distinguish one from the others if there are multiple connections?

    Kind regards,

    Katherine

  • Hey Katherine,

    When an event is passed by the GAP layer (i.e. when multi_role_advCB is triggered), the handle of the advertising set is passed within the structure.

    This can be seen in the out of the box simple_peripheral example, where the function SimplePeripheral_advCallback() enqueues the event SP_ADV_EVT which is handled by SimplePeripheral_processAdvEvent. In SimplePeripheral_processAdvEvent(), you can see the handle of the advertising set being displayed. You can use the same technique to assess which advertising set is triggering multi_role_advCB.

    which broadcast is being connected, and how could the customer distinguish one from the others if there are multiple connections?

    When the advertisement set is terminated due to a connection, the stack will trigger GAP_EVT_ADV_SET_TERMINATED. The payload has the advertisement handle that was terminated, along with a connection handle. If the advertisement ended due to a connection, then you will check the connection handle that is passed in. If it's valid (i.e. not ,LL_INVALID_CONNECTION_ID) you will know which connection terminated the advertisement. Parsing the payloads is shown in simple_peripheral in this case as well.