mirror of
https://github.com/esphome/esphome.git
synced 2024-12-01 03:04:12 +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);
|
||||
}
|
||||
|
||||
void BLECharacteristic::notify(bool notification) {
|
||||
if (!notification) {
|
||||
ESP_LOGW(TAG, "notification=false is not yet supported");
|
||||
// TODO: Handle when notification=false
|
||||
void BLECharacteristic::notify(bool require_ack) {
|
||||
if (require_ack) {
|
||||
ESP_LOGW(TAG, "require_ack=true is not yet supported (i.e. INDICATE is not yet supported)");
|
||||
// TODO: Handle when require_ack=true
|
||||
}
|
||||
if (this->service_->get_server()->get_connected_client_count() == 0)
|
||||
return;
|
||||
|
|
|
@ -45,7 +45,8 @@ class BLECharacteristic {
|
|||
void set_write_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 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