I am having a hard time finding a MBED OS BLE central function example. If anyone knows of a suitable example that can provide filter scanning (i.e. filter for a specific advertising service UUID), in particular, please let me know.
What I’ve seen so far on the MBED GitHub repository is not great. Most examples are for peripheral device functionality. The closest if this BLE GAP example, but this example simply rotates through different GAP modes and only provides GAP type information on duration and interval data, as per this output:
Starting next GAP demo mode
DEVICE MAC ADDRESS: :::::
Scanning started (interval: 100ms, window: 62ms, timeout: 3000ms).
Stopped scanning early due to timeout parameter
We have scanned for 3182ms with an interval of 160 timeslots and a window of 100 timeslots
We have been listening on the radio for at least 1937ms
Starting next GAP demo mode
DEVICE MAC ADDRESS: :::::
Scanning started (interval: 100ms, window: 25ms, timeout: 0ms).
We have scanned for 5999ms with an interval of 160 timeslots and a window of 40 timeslots
We have been listening on the radio for at least 1475ms
Starting next GAP demo mode
DEVICE MAC ADDRESS: :::::
Scanning started (interval: 312ms, window: 6ms, timeout: 0ms).
We have scanned for 5999ms with an interval of 500 timeslots and a window of 10 timeslots
We have been listening on the radio for at least 118ms
Starting next GAP demo mode
DEVICE MAC ADDRESS: :::::
Advertising started (type: 0x0, interval: [25 : 50]ms)
We have advertised for 5999ms with an interval of at least 80 timeslots
We created at least 0 tx and rx events
Starting next GAP demo mode
DEVICE MAC ADDRESS: :::::
Advertising started (type: 0x2, interval: [62 : 125]ms)
Advertiser xAdvertising started (type: 0x2, interval: [62 : 125]ms)
… etc.
It’s also rather difficult to actually work out how to get the MBED BLE central function firmware to connect to a peripheral device and bond, if necessary.
But for now I simply wish to parse out scan results and analyse UUID and UUID data/payload (e.g. create a Beacon scanner).