From 43467b9c719928ffaf2bc1cb314338bc402914e1 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Mon, 27 Sep 2021 16:27:42 +1000 Subject: extmod/modbluetooth: Add connection interval to gap_connect. This forwards through directly to the NimBLE and BTStack connect functions. Signed-off-by: Jim Mussared --- docs/library/bluetooth.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'docs/library') diff --git a/docs/library/bluetooth.rst b/docs/library/bluetooth.rst index 6ebceeed5..cfec804ea 100644 --- a/docs/library/bluetooth.rst +++ b/docs/library/bluetooth.rst @@ -359,7 +359,7 @@ Central Role A central device can connect to peripherals that it has discovered using the observer role (see :meth:`gap_scan`) or with a known address. -.. method:: BLE.gap_connect(addr_type, addr, scan_duration_ms=2000, /) +.. method:: BLE.gap_connect(addr_type, addr, scan_duration_ms=2000, min_conn_interval_us=None, max_conn_interval_us=None, /) Connect to a peripheral. @@ -367,6 +367,15 @@ A central device can connect to peripherals that it has discovered using the obs On success, the ``_IRQ_PERIPHERAL_CONNECT`` event will be raised. + The device will wait up to *scan_duration_ms* to receive an advertising + payload from the device. + + The connection interval can be configured in **micro**\ seconds using either + or both of *min_conn_interval_us* and *max_conn_interval_us*. Otherwise a + default interval will be chosen, typically between 30000 and 50000 + microseconds. A shorter interval will increase throughput, at the expense + of power usage. + Peripheral Role --------------- -- cgit v1.2.3