Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Issue 403 fix #446

Open
wants to merge 2 commits into
base: Dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions esp32/mods/modbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1914,10 +1914,12 @@ STATIC mp_obj_t bt_characteristic_value (mp_uint_t n_args, const mp_obj_t *args)
self->attr_obj.value_len = value_len;
}

bool confirm = self->attr_obj.properties & ESP_GATT_CHAR_PROP_BIT_INDICATE;
if (ESP_OK != esp_ble_gatts_send_indicate(bt_obj.gatts_if, bt_obj.gatts_conn_id, self->attr_obj.handle,
self->attr_obj.value_len, self->attr_obj.value, confirm)) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Erorr while sending BLE indication/notification"));
if(bt_obj.gatts_conn_id != -1) {
bool confirm = self->attr_obj.properties & ESP_GATT_CHAR_PROP_BIT_INDICATE;
if (ESP_OK != esp_ble_gatts_send_indicate(bt_obj.gatts_if, bt_obj.gatts_conn_id, self->attr_obj.handle,
self->attr_obj.value_len, self->attr_obj.value, confirm)) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Error while sending BLE indication/notification"));
}
}
return mp_const_none;
}
Expand Down