mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 23:22:21 +01:00
preen
This commit is contained in:
@@ -105,7 +105,12 @@ void BluetoothConnection::send_service_for_discovery_() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (total_char_count > 0) {
|
||||
if (total_char_count == 0) {
|
||||
// No characteristics, just send the service response
|
||||
api_conn->send_message(resp, api::BluetoothGATTGetServicesResponse::MESSAGE_TYPE);
|
||||
return
|
||||
}
|
||||
|
||||
// Reserve space and process characteristics
|
||||
service_resp.characteristics.reserve(total_char_count);
|
||||
uint16_t char_offset = 0;
|
||||
@@ -173,7 +178,6 @@ void BluetoothConnection::send_service_for_discovery_() {
|
||||
desc_offset++;
|
||||
}
|
||||
}
|
||||
} // end else if (total_char_count > 0)
|
||||
|
||||
// Send the message (we already checked api_conn is not null at the beginning)
|
||||
api_conn->send_message(resp, api::BluetoothGATTGetServicesResponse::MESSAGE_TYPE);
|
||||
|
Reference in New Issue
Block a user