mirror of
https://github.com/esphome/esphome.git
synced 2025-07-31 07:36:35 +00:00
cleanup
This commit is contained in:
parent
b6e0188c42
commit
8a03e4c2cb
@ -113,6 +113,7 @@ void BluetoothConnection::send_service_for_discovery_() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now process characteristics
|
// Now process characteristics
|
||||||
|
if (char_count_status == ESP_GATT_OK && total_char_count > 0) {
|
||||||
uint16_t char_offset = 0;
|
uint16_t char_offset = 0;
|
||||||
esp_gattc_char_elem_t char_result;
|
esp_gattc_char_elem_t char_result;
|
||||||
while (true) { // characteristics
|
while (true) { // characteristics
|
||||||
@ -153,6 +154,11 @@ void BluetoothConnection::send_service_for_discovery_() {
|
|||||||
this->address_str().c_str(), char_result.char_handle, desc_count_status);
|
this->address_str().c_str(), char_result.char_handle, desc_count_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip descriptor processing if there are no descriptors
|
||||||
|
if (desc_count_status != ESP_GATT_OK || total_desc_count == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Now process descriptors
|
// Now process descriptors
|
||||||
uint16_t desc_offset = 0;
|
uint16_t desc_offset = 0;
|
||||||
esp_gattc_descr_elem_t desc_result;
|
esp_gattc_descr_elem_t desc_result;
|
||||||
@ -179,6 +185,7 @@ void BluetoothConnection::send_service_for_discovery_() {
|
|||||||
desc_offset++;
|
desc_offset++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} // end if (char_count_status == ESP_GATT_OK && total_char_count > 0)
|
||||||
|
|
||||||
// Send the message (we already checked api_conn is not null at the beginning)
|
// Send the message (we already checked api_conn is not null at the beginning)
|
||||||
api_conn->send_message(resp, api::BluetoothGATTGetServicesResponse::MESSAGE_TYPE);
|
api_conn->send_message(resp, api::BluetoothGATTGetServicesResponse::MESSAGE_TYPE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user