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.

CCS/CC2642R: Simple Peripheral Example - Extended Scannable Advertising

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Tool/software: Code Composer Studio 9.3, SimpleLink CC13x2 26x2 SDK v3.40

Using SysConfig Editor, I changed the "RF STACKS -> BLE -> Broadcaster Configuration -> Advertisement Set 2 -> Advertisement Parameters 2 -> Event Properties" from "Connectable advertising" to "Scannable advertising".

Diffing the simple_peripheral.syscfg file, show two additional lines inserted at 139.

// Event Properties - Advertising Event Param Properties
ble.advSet2.advParam2.eventProps = ["GAP_ADV_PROP_SCANNABLE"];

The program compiles without error. However the program does not advance past line 1033 of simple_peripheral.c

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

The output of the unmodified Simple Peripheral example:

*Simple Peripheral

+Set AutoConnect >




====================
Initialized


Adv Set 1 Enabled

ID Addr: 0x806FB01E3F48
RP Addr: 0x616F79533164

 

The output of the extended scannable advertisement:

*Simple Peripheral







====================
Initialized
  • Hi,

    The error you are experiencing is effectively caused by the line you mentioned. Loading advertisement data for extended advertisement set is allowed only if it is not scannable (here you set it as scannable).

    As a result, the error can be corrected by not loading the advertisement data, i.e. by commenting the following lines:

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

    I hope this will help,

    Kind regards,

  • Hi Clément,

    Your proposed code changes allow the code to continue executing. Confirming this is where the code hangs. Alternatively, the following code also works.

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

  • Hi,

    Thank you for sharing, but it is not good practice to load an advertisement set in lieu of a scan response set (and it might not do exactly what you expect).

    [EDIT] Thank you for sharing!

    Kind regards,

  • Hey Clément,

    I modified my prior message to only include loading the scan response data. Is the anything improper about what remains?

    Much appreciated,
    Alex

  • Hi Alex,

    Thanks again for sharing. The code snippet you provided in your message is now perfectly valid!

    Kind regards,