mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_hid: fixed ble hid battery level setting
This commit is contained in:
parent
4bc762621d
commit
4001888e69
@ -832,12 +832,14 @@ static esp_err_t esp_ble_hidd_dev_battery_set(void *devp, uint8_t level)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
ret = esp_ble_gatts_send_indicate(dev->bat_svc.gatt_if, dev->conn_id, dev->bat_level_handle, 1, &dev->bat_level, dev->bat_ccc.indicate_enable);
|
||||
if (ret) {
|
||||
ESP_LOGE(TAG, "esp_ble_gatts_send_indicate failed: %d", ret);
|
||||
return ESP_FAIL;
|
||||
if (dev->bat_ccc.notify_enable) {
|
||||
ret = esp_ble_gatts_send_indicate(dev->bat_svc.gatt_if, dev->conn_id, dev->bat_level_handle, 1, &dev->bat_level, false);
|
||||
if (ret) {
|
||||
ESP_LOGE(TAG, "esp_ble_gatts_send_notify failed: %d", ret);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
}
|
||||
WAIT_CB(dev);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user