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-CC2640R2: How to configure broadcaster and observer timings? Several parameters are not having the desired effect.

Part Number: LAUNCHXL-CC2640R2

Hello, I have a two pronged question here: 

1)

We are having some difficulty understanding how to control the scanning time on an observer (starting from Simple_Observer example).

We set interval and window to be the same so that we are always scanning, and that seems to work, but only with very specific scan duration values. If we set scan duration to 0, then it fails to continuously read (only reads a few packets then stops). Also if we set the value greater than 400ms, it also fails to update. This is counter intuitive as we thought scan duration is how long the device stays in scanning state.

 Can someone advise on how scan duration works, and suggest a value (since 0 doesn’t work)? We want to scan forever, as fast as possible, as we have unlimited power for the observer, but not for the broadcaster, which needs to quickly push data and sleep at a fixed interval.

 2)

We are also having trouble with the broadcaster. We set advertising interval too 500ms, and we generally see updates every 500ms on our observer, but sometimes it increases to 1s or more which seems like dropped packet(s). Having said that, we tried dropping broadcaster power by 11dBm and don’t see any increase in number of packets received, so we don’t think it’s RF related, but more likely the broadcaster is simply not transmitting sometimes. 

The way we configured the broadcaster is using the Simple_Broadcaster example, and then we added a periodic event triggered by a clock. Within the main loop of SimpleBLEBroadcaster_taskFxn we watch for the periodic event and update the payload. 

What we want to do is perform several ADC reads and serial communications to gather data and update the advertdata payload array once every five minutes. Then we want to push 5 identical packets containing the previously captured data every 200ms for 1 minute and then sleep until the next ADC read cycle (i.e. 4 mins – processing time). What is the best way to accomplish this? I.e. what GAP parameters should we be setting, and is a periodic task the recommended way to trigger our ADC and serial comms?

  • Hello Mishca,

    Which SDK is used?

    1)

    Did you read the Simplelink Academy Bluetooth Low Energy Scanning and Advertising lab? It explains the concept.

    "Note that even in indefinite scanning, the number of scanned results will still be limited by DEFAULT_MAX_SCAN_RES."

    " By default, the scanning device will filter (duplicate) advertising data"

     

    You set a sensible scan duration and restart scan in SimpleBLEObserver_processRoleEvent -> case GAP_DEVICE_DISCOVERY_EVENT:

    2)

    Refer to Advertising Task 2 - Change the Advertising Data in the training mentioned above.

    I would stop advertising, change adv interval, then restart in task context.

    GAPRole_SetParameter with GAPROLE_ADVERT_ENABLED, TGAP_GEN_DISC_ADV_INT_MIN, TGAP_GEN_DISC_ADV_INT_MAX, ...

    If the ADC reads are slow periodic you can consider using the sensor controller to save power. 

    https://training.ti.com/simplelink-academy-introduction-sensor-controller 

    Other SC resources:
    1) Help viewer in SCS (F1).
    2) Example code generated from SCS and generated scif_x header/source files.
    3) Several application notes:
    dev.ti.com/.../
    4) Simplelink academy training.