summaryrefslogtreecommitdiff
path: root/extmod/modbluetooth_nimble.c
diff options
context:
space:
mode:
authorAndrew Leech <andrew.leech@planetinnovation.com.au>2019-09-02 15:40:31 +1000
committerJim Mussared <jim.mussared@gmail.com>2019-10-01 09:51:02 +1000
commiteb1b6858a2c5454f84ab4bb0b854b96d234995c8 (patch)
treeca489baf8c3f531f06cecb5d1f0a00f4e5bce098 /extmod/modbluetooth_nimble.c
parent5dc592d117b68455e8b1c1ef9230090c143358dc (diff)
extmod/modbluetooth: Allow MP_BLUETOOTH_MAX_ATTR_SIZE in board config.
Diffstat (limited to 'extmod/modbluetooth_nimble.c')
-rw-r--r--extmod/modbluetooth_nimble.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/extmod/modbluetooth_nimble.c b/extmod/modbluetooth_nimble.c
index 21d71e3c9..959360cee 100644
--- a/extmod/modbluetooth_nimble.c
+++ b/extmod/modbluetooth_nimble.c
@@ -301,6 +301,11 @@ STATIC void sync_cb(void) {
assert(rc == 0);
}
+ if (MP_BLUETOOTH_MAX_ATTR_SIZE > 20) {
+ rc = ble_att_set_preferred_mtu(MP_BLUETOOTH_MAX_ATTR_SIZE+3);
+ assert(rc == 0);
+ }
+
ble_svc_gap_device_name_set(MICROPY_PY_BLUETOOTH_DEFAULT_NAME);
ble_state = BLE_STATE_ACTIVE;