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.

LAUNCHXL-CC2650: GAPROLE_ADVERT_OFF_TIME does not work, advertisement keeps running...

Part Number: LAUNCHXL-CC2650
Hello, I an working on simple broadcaster example. 
After starting the broadcast,
I want to turn off broadcasting automatically after 5 second.
So that I can turn it on later when needed.
Thus power can be saved somewhat.

I have used the code below.
But the broadcast seems to be continuous.
I can always pick it from my phone's BLE scanner.

What am I missing here?


uint8_t initial_advertising_enable = TRUE; static uint8 advertData[ADV_MAX_LEN] = { 0x02, GAP_ADTYPE_FLAGS, GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED | GAP_ADTYPE_FLAGS_LIMITED, 0x1B, // length of this data including the data type byte dec--27 GAP_ADTYPE_MANUFACTURER_SPECIFIC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; within broadcaster init function............... uint16_t gapRole_AdvertOffTime = 5000; uint8_t advType = GAP_ADTYPE_ADV_SCAN_IND; // use scannable undirected adv GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &initial_advertising_enable); GAPRole_SetParameter(GAPROLE_ADVERT_OFF_TIME, sizeof(uint16_t), &gapRole_AdvertOffTime); GAPRole_SetParameter(GAPROLE_SCAN_RSP_DATA, sizeof (scanRspData), scanRspData); GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData); GAPRole_SetParameter(GAPROLE_ADV_EVENT_TYPE, sizeof(uint8_t), &advType); } // Set advertising interval { uint16_t advInt = DEFAULT_ADVERTISING_INTERVAL; // set to 160 equivalent of (100 ms) GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, advInt); GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, advInt); GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MIN, advInt); GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MAX, advInt); } // Start the Device VOID GAPRole_StartDevice(&simpleBLEBroadcaster_BroadcasterCBs);