Skip to content

Commit

Permalink
Merge pull request #6614 from litui/litui-espressif-bleiofix
Browse files Browse the repository at this point in the history
Fixed empty characteristic issue with bleio+nimble.
  • Loading branch information
dhalbert authored Jul 20, 2022
2 parents 6154686 + 868a03f commit f2bbe5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ports/espressif/common-hal/_bleio/Connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t
? service->end_handle
: next_characteristic->def_handle - 1;

// Pre-check if characteristic is empty so descriptor discovery doesn't fail
if (end_handle <= characteristic->handle) {
continue;
}

_last_discovery_status = BLE_ERR_SUCCESS;
CHECK_NIMBLE_ERROR(ble_gattc_disc_all_dscs(self->conn_handle, characteristic->handle,
end_handle,
Expand Down

0 comments on commit f2bbe5a

Please sign in to comment.