mirror of
https://github.com/esphome/esphome.git
synced 2024-12-01 11:14:13 +01:00
Rework notify notation
This commit is contained in:
parent
7c2bb058a5
commit
55c3b66ed8
2 changed files with 6 additions and 5 deletions
|
@ -84,10 +84,10 @@ void BLECharacteristic::set_value(bool &data) {
|
||||||
this->set_value(temp, 1);
|
this->set_value(temp, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BLECharacteristic::notify(bool notification) {
|
void BLECharacteristic::notify(bool require_ack) {
|
||||||
if (!notification) {
|
if (require_ack) {
|
||||||
ESP_LOGW(TAG, "notification=false is not yet supported");
|
ESP_LOGW(TAG, "require_ack=true is not yet supported (i.e. INDICATE is not yet supported)");
|
||||||
// TODO: Handle when notification=false
|
// TODO: Handle when require_ack=true
|
||||||
}
|
}
|
||||||
if (this->service_->get_server()->get_connected_client_count() == 0)
|
if (this->service_->get_server()->get_connected_client_count() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -45,7 +45,8 @@ class BLECharacteristic {
|
||||||
void set_write_property(bool value);
|
void set_write_property(bool value);
|
||||||
void set_write_no_response_property(bool value);
|
void set_write_no_response_property(bool value);
|
||||||
|
|
||||||
void notify(bool notification = true);
|
void indicate() { this->notify(true); }
|
||||||
|
void notify(bool require_ack = false);
|
||||||
|
|
||||||
void do_create(BLEService *service);
|
void do_create(BLEService *service);
|
||||||
void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
|
void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, esp_ble_gatts_cb_param_t *param);
|
||||||
|
|
Loading…
Reference in a new issue