extmod/bluetooth: Support active scanning in BLE.gap_scan().

This adds an additional optional parameter to gap_scan() to select active
scanning, where scan responses are returned as well as normal scan results.
This parameter is False by default which retains the existing behaviour.
This commit is contained in:
Andrew Leech
2020-08-14 11:49:41 +10:00
committed by Damien George
parent 0bc2c1c105
commit a80a146858
5 changed files with 14 additions and 9 deletions

View File

@@ -215,7 +215,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, int32_t interval_us, int32_t window_us);
int mp_bluetooth_gap_scan_start(int32_t duration_ms, int32_t interval_us, int32_t window_us, bool active_scan);
// Stop discovery (if currently active).
int mp_bluetooth_gap_scan_stop(void);