mirror of
https://github.com/esphome/esphome.git
synced 2025-07-31 07:36:35 +00:00
preen
This commit is contained in:
parent
a06c4e1d56
commit
535e995c75
@ -105,7 +105,12 @@ void BluetoothConnection::send_service_for_discovery_() {
|
|||||||
return;
|
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
|
// Reserve space and process characteristics
|
||||||
service_resp.characteristics.reserve(total_char_count);
|
service_resp.characteristics.reserve(total_char_count);
|
||||||
uint16_t char_offset = 0;
|
uint16_t char_offset = 0;
|
||||||
@ -173,7 +178,6 @@ void BluetoothConnection::send_service_for_discovery_() {
|
|||||||
desc_offset++;
|
desc_offset++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end else if (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