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: Long range Test

Part Number: CC2640R2F

Hi,

I  am using  simplelink_cc2640r2_sdk_3_10_00_15 version to implement long range Application,

By making use of example  simple peripheral code , I was testing.

But I was not able to see long range advertisement set. Can anyone please explain how to test this feature.

Code snippet:

static void SimplePeripheral_processGapMessage(gapEventHdr_t *pMsg)
{
  switch(pMsg->opcode)
  {
    case GAP_DEVICE_INIT_DONE_EVENT:
    {
      bStatus_t status = FAILURE;

      gapDeviceInitDoneEvent_t *pPkt = (gapDeviceInitDoneEvent_t *)pMsg;

      if(pPkt->hdr.status == SUCCESS)
      {
        
        // Temporary memory for advertising parameters for set #1. These will be copied
        // by the GapAdv module
       // GapAdv_params_t advParamLegacy = GAPADV_PARAMS_LEGACY_SCANN_CONN;

        // Create Advertisement set #1 and assign handle
       // status = GapAdv_create(&SimplePeripheral_advCallback, &advParamLegacy,
       //                        &advHandleLegacy);
       // SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

        // Load advertising data for set #1 that is statically allocated by the app
      //  status = GapAdv_loadByHandle(advHandleLegacy, GAP_ADV_DATA_TYPE_ADV,
       //                              sizeof(advertData), advertData);
       // SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

        // Load scan response data for set #1 that is statically allocated by the app
        //status = GapAdv_loadByHandle(advHandleLegacy, GAP_ADV_DATA_TYPE_SCAN_RSP,
                                //     sizeof(scanRspData), scanRspData);
        //SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

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

        // Enable legacy advertising for set #1
       // status = GapAdv_enable(advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
       // SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

        // Use long range params to create long range set #2
        GapAdv_params_t advParamLongRange = GAPADV_PARAMS_AE_LONG_RANGE_CONN;
        //advParamLongRange.primPhy = GAP_ADV_PRIM_PHY_CODED_S8;

        // Create Advertisement set #2 and assign handle
        status = GapAdv_create(&SimplePeripheral_advCallback, &advParamLongRange,
                               &advHandleLongRange);
        SIMPLEPERIPHERAL_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(advertData), advertData);
        SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

        // Load scan response data for set #2 that is statically allocated by the app
        status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_SCAN_RSP,
                                     sizeof(scanRspData), scanRspData);
        SIMPLEPERIPHERAL_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);
        SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);

      }

      break;
    }

But If I use  advParamLegacy as  GAPADV_PARAMS_LEGACY_SCANN_CONN I am able to see my device is advertising, But If I go for GAPADV_PARAMS_AE_LONG_RANGE_CONN alone I dont see my device advertising.

Please let me know If i am missing something.

  • Hi,

    What device and configuration are you using to scan for advertisements? 

  • I was using BLE scanner APP in Bluetooth 5 supported mobile(Nokia 6.1 Plus).

  • I tried with simple broadcaster example project to test long range , as my application doesnt want peripheral mode, I see the same issue.

    If I use GAPADV_PARAMS_LEGACY_SCANN_CONN it is advertising ,

    but if I change it to long range (GAPADV_PARAMS_AE_LONG_RANGE_CONN), My device is not at all advertising (I used BLE5 stack simple broad caster project).

    Please let me know what all changes I need to do for long -range if I use simple broadcaster example projcet

    Platform: CC2640r2

    Software: simplelink_cc2640r2_sdk_3_10_00_15

  • Hi,

    The simple peripheral is already advertising with long range as default, 

    GapAdv_create(&SimplePeripheral_advCallback, &advParamLongRange, &advHandleLongRange);

    This functionality is not part of simple broadcaster and needs to be manually enabled.
    Are you sure that the Nokia 6.1 Plus is setup to receive long range beacons?
  • Yes I have changed current configuration of simple broad caster project,

    I have configured like This:

            GapAdv_params_t advParamLongRange= GAPADV_PARAMS_AE_LONG_RANGE_CONN;


            status = GapAdv_create(&SimpleBroadcaster_advCallback, &advParamLongRange,
                                   &advHandleLongRange);
            SIMPLEBROADCASTER_ASSERT(status == SUCCESS);

            status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_ADV,
                                         sizeof(advertData), advertData);
            SIMPLEBROADCASTER_ASSERT(status == SUCCESS);

            // Load scan response data
            status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_SCAN_RSP,
                                         sizeof(scanRspData), scanRspData);
            SIMPLEBROADCASTER_ASSERT(status == SUCCESS);

            // Set event mask
            status = GapAdv_setEventMask(advHandleLongRange,
                                         GAP_ADV_EVT_MASK_START_AFTER_ENABLE |
                                         GAP_ADV_EVT_MASK_END_AFTER_DISABLE |
                                         GAP_ADV_EVT_MASK_SET_TERMINATED);
            SIMPLEBROADCASTER_ASSERT(status == SUCCESS);

            // Enable legacy advertising
            status = GapAdv_enable(advHandleLongRange, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
            SIMPLEBROADCASTER_ASSERT(status == SUCCESS);

    Here GAPADV_PARAMS_AE_LONG_RANGE_CONN is default configuration from gap_advertiser.h,

    1)Do I need to change .eventProps to Scan-able??

    2) I have only enable long range advertisement, I disabled legacy advertisement configs, is that fine?

    3) Can you suggest simple way of testing this(longrange) using some application or tools?

     

    Adding to this I have done few testing with simple broadcaster example.

    Using two launchpads (cc2640r2) i have tested, one with host test application and one board with simple broadcaster application.

    • In simple broadcaster application , I have changed legacy advertisement -->long range advertisement ,other than this no other changes in the both sample code.
    • Using Btool from ble5stack I have scanned for the devices , still I am not able to see long range advertisement

    Please let me know whether my understanding is proper, and using Btool can we test longrange ?(ble5stack)

  • Hi,

    Can you please reply to my above questions?

    If I want to use simple broadcaster example for long range, Please let me know what and all main changes I have to do and how can I test this feature.

    Is it mandatory to enable both legacy and long range advertisement set? or for long range Is it enough to enable only  long range advertisement set.

    And please suggest some tool or device to test this feature.

    Thank you

  • Hi,

    I can only recommend to use simple peripheral as reference.