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.

CC2650: Low power Sensor Example

Part Number: CC2650

Hi,

Is there any example where upon external interrupt device wakes up and send particular data in advertising mode only?  I have used Simple_peripheral example and am able to put device into standby mode and wakeup upon external interrupt. However this example provides connectable mode.

I just want to send sensor data upon external interrupt on four different channel once and put device back in sleep mode. Is Simple Broadcaster right example to start with?  And how Can I change advertising data each time?

Thanks

  • I would suggest you to use simple_broadcaster to do this.

    1. Stop advertising using:

    uint8_t initial_advertising_enable = FALSE;
    GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),
                             &initial_advertising_enable);

    2. Change advertising data advertData using:

    GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);

    3. Enable advertising again using:

    uint8_t initial_advertising_enable = TRUE;
    GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),
                             &initial_advertising_enable);

  • Ok will try that. One more question: How can I control number of times advertising data broadcasted? That if I want to advertising only once what parameters needs to be configured. And how can I configure to transmit this data on different channels?

  • I tried the same in Simple_Peripheral example but it doen't update the advertising data.

    I set following in one of the callback function

         #define ADV_MAX_LEN 31
         #define ADVDATA_MANUF_DATA_IDX 5
             uint8 i = 0;
             static uint8 advData = 0;

             advertData[i++] = 0x02;   // length of this data
             advertData[i++] = GAP_ADTYPE_FLAGS;
             advertData[i++] = DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED;

             //Setup up custom user data initially
             advertData[i++] = ADV_MAX_LEN - i - 1; // length of this data
             advertData[i++] = GAP_ADTYPE_MANUFACTURER_SPECIFIC; // length of this data

             //populate the remaining with custom ADV data (i.e. 0x00,0x01, 0x02, etc.)
             for(i = ADVDATA_MANUF_DATA_IDX; i < ADV_MAX_LEN; i++)
               advertData[i] = advData++;

             uint8 status1 = GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);

    I got this from here:  but still on my phone scanner raw data is same as that of before. I cleared history and removed  all devices from phone history.

  • Sometimes Smartphone BLE would cache advertising data so you can try to clear caches on your smartphone or stop BLE and restart it again to see if you can get advertising data updated.

  • That was not issue with smartphone but I was updating advertising parameter in pin interrupt callback function. Advertising data needs to be updated from  SimpleBLEPeripheral_taskFxn().  Now I am getting updated advertising packet as expected.

    However when I see raw data on smartphone it contains  Advertising Data + Scan Response Data (Like Name "SimpleBLEPeripheral). Is it normal? I am using BLE Scanner on my android.

    Also is there a way to disable Connection mode in Simple_Peripheral example?

    Thanks

  • 1. I think it's normal to see it contains  Advertising Data + Scan Response Data (Like Name "SimpleBLEPeripheral).

    2. You can use "GAPRole_SetParameter(GAPROLE_ADV_NONCONN_ENABLED, sizeof(uint8_t), &advertEnabled);" instead of "GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &advertReEnable);" to send non-connectable advertising.