Skip to content

Commit

Permalink
extmod/nimble: Automatically notify subscribed connections on gatts_w…
Browse files Browse the repository at this point in the history
…rite().
  • Loading branch information
pi-anl committed Aug 4, 2020
1 parent 9883d8e commit 36ccfa8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extmod/nimble/modbluetooth_nimble.c
Expand Up @@ -582,11 +582,11 @@ int mp_bluetooth_gatts_write(uint16_t value_handle, const uint8_t *value, size_t
if (!mp_bluetooth_is_active()) {
return ERRNO_BLUETOOTH_NOT_ACTIVE;
}
return mp_bluetooth_gatts_db_write(MP_STATE_PORT(bluetooth_nimble_root_pointers)->gatts_db, value_handle, value, value_len);
int ret = mp_bluetooth_gatts_db_write(MP_STATE_PORT(bluetooth_nimble_root_pointers)->gatts_db, value_handle, value, value_len);
ble_gatts_chr_updated(value_handle);
return ret;
}

// TODO: Could use ble_gatts_chr_updated to send to all subscribed centrals.

int mp_bluetooth_gatts_notify(uint16_t conn_handle, uint16_t value_handle) {
if (!mp_bluetooth_is_active()) {
return ERRNO_BLUETOOTH_NOT_ACTIVE;
Expand Down

0 comments on commit 36ccfa8

Please sign in to comment.