Page 1 of 1

How to change BLE Connection interval

Posted: Mon Aug 02, 2021 3:50 pm
by dougconran
The MP 1.16 uBluetooth document lists an irq connection update event

Code: Select all

    elif event == _IRQ_CONNECTION_UPDATE:
        # The remote device has updated connection parameters.
        conn_handle, conn_interval, conn_latency, supervision_timeout, status = data
Is there any way (preferably using aioble) that I can change the interval? A quick grep of CONNECTION_UPDATE doe not return anything. Failing an existing method, is there any other way that I can change the interval?

Re: How to change BLE Connection interval

Posted: Wed Aug 04, 2021 5:57 am
by jimmo
dougconran wrote:
Mon Aug 02, 2021 3:50 pm
Is there any way (preferably using aioble) that I can change the interval?
Unfortunately not in 1.16 -- I have a WIP implementation of this but it requires more testing. I'm not sure I'll be able to get it done for 1.17 sorry.

It's very simple to change -- in modbluetooth_nimble.c we set
.itvl_min = BLE_GAP_INITIAL_CONN_ITVL_MIN,
.itvl_max = BLE_GAP_INITIAL_CONN_ITVL_MAX,

if you want to compile your own firmware you can change those values.

Re: How to change BLE Connection interval

Posted: Wed Aug 04, 2021 10:14 pm
by dougconran
Thanks for this. I've found .../modbluetooth_nimble.c but can't (yet) find where the constants are set. However, at this stage, recompiling MP is probably beyond me and so I'll explore other options first :)