summaryrefslogtreecommitdiff
path: root/extmod/modbluetooth.h
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2019-10-08 14:25:32 +1100
committerJim Mussared <jim.mussared@gmail.com>2019-10-11 13:51:07 +1100
commitb65cc387cd0819ab97a4a8f7ebbc1f6345f65379 (patch)
tree1b8970fb659f91444a1eb01cbd5d950390c5cac5 /extmod/modbluetooth.h
parent06ae818f9360e83284c64614144f1ad00998a739 (diff)
extmod/modbluetooth: Allow config of scan interval/window.
This adds two additional optional kwargs to `gap_scan()`: - `interval_us`: How long between scans. - `window_us`: How long to scan for during a scan. The default with NimBLE is a 11.25ms window with a 1.28s interval. Changing these parameters is important for detecting low-frequency advertisements (e.g. beacons). Note: these params are in microseconds, not milliseconds in order to allow the 625us granularity offered by the spec.
Diffstat (limited to 'extmod/modbluetooth.h')
-rw-r--r--extmod/modbluetooth.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/modbluetooth.h b/extmod/modbluetooth.h
index 9db3bed6c..8f34e3484 100644
--- a/extmod/modbluetooth.h
+++ b/extmod/modbluetooth.h
@@ -186,7 +186,7 @@ int mp_bluetooth_gap_disconnect(uint16_t conn_handle);
#if MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE
// Start a discovery (scan). Set duration to zero to run continuously.
-int mp_bluetooth_gap_scan_start(int32_t duration_ms);
+int mp_bluetooth_gap_scan_start(int32_t duration_ms, int32_t interval_us, int32_t window_us);
// Stop discovery (if currently active).
int mp_bluetooth_gap_scan_stop(void);