Skip to content

Commit f2bbe5a

Browse files
authored
Merge pull request adafruit#6614 from litui/litui-espressif-bleiofix
Fixed empty characteristic issue with bleio+nimble.
2 parents 6154686 + 868a03f commit f2bbe5a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/espressif/common-hal/_bleio/Connection.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,11 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t
394394
? service->end_handle
395395
: next_characteristic->def_handle - 1;
396396

397+
// Pre-check if characteristic is empty so descriptor discovery doesn't fail
398+
if (end_handle <= characteristic->handle) {
399+
continue;
400+
}
401+
397402
_last_discovery_status = BLE_ERR_SUCCESS;
398403
CHECK_NIMBLE_ERROR(ble_gattc_disc_all_dscs(self->conn_handle, characteristic->handle,
399404
end_handle,

0 commit comments

Comments
 (0)