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.

CC2640R2F: Advertiser long range not advertisement data both advData and ScanRsp

Part Number: CC2640R2F

Tool/software:

Hi,

I need to add advData and scanrsp data in long range in 1 set data. but data not advertisement.

Follow code

        // Use long range params to create long range set #2
        GapAdv_params_t advParamLongRange = GAPADV_PARAMS_AE_LONG_RANGE_CONN;
        advParamLongRange.eventProps = GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_SCANNABLE;

        // Create Advertisement set #2 and assign handle
        status = GapAdv_create(&SimpleSerialSocketServer_advCB, &advParamLongRange,
                               &advHandleLongRange);
        SimpleSerialSocketServer_ASSERT(status == SUCCESS);

        // Load advertising data for set #2 that is statically allocated by the app
        status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_SCAN_RSP,
                                     sizeof(advertData), advertData);
        SimpleSerialSocketServer_ASSERT(status == SUCCESS);

        // Load advertising data for set #2 that is statically allocated by the app
        status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_ADV,
                                     sizeof(ScanRsp), ScanRsp);
        SimpleSerialSocketServer_ASSERT(status == SUCCESS);

        // Set event mask for set #2
        status = GapAdv_setEventMask(advHandleLongRange,
                                     GAP_ADV_EVT_MASK_START_AFTER_ENABLE |
                                     GAP_ADV_EVT_MASK_END_AFTER_DISABLE |
                                     GAP_ADV_EVT_MASK_SET_TERMINATED);

        // Enable long range advertising for set #2
        status = GapAdv_enable(advHandleLongRange, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
        SimpleSerialSocketServer_ASSERT(status == SUCCESS);

In ParmLongRange.eventProps setting 

GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_SCANNABLE;
Or advertising long range can not set both advData and ScanRsp data in 1 set advertisement.
Best regards,
Vasu
  • Hello Vasu,

    Thanks for reaching out. According to the Bluetooth Core Specification Version 5.3 | Vol 4, Part E section 7.8.53: LE Set Extended Advertising Parameters command: "If extended advertising PDU types are being used (bit 4 = 0) then: The advertisement shall not be both connectable and scannable" Therefore, it is not possible to have both in the same mode. You can have Scannable Advertising (only scan responses) or Connectable Advertising (only advertising data).

    Hope this helps.

    David.

  • Hi David,

    Thanks for answer.

    Best regards,
    Vasu