Add value handle getter to Gatt Server

pull/14506/head
Abbas Bracken Ziad 2021-04-06 17:24:08 +01:00
parent 73896715e6
commit 8b07e97e50
2 changed files with 11 additions and 0 deletions

View File

@ -1542,6 +1542,15 @@ bool GattServer::get_cccd_index_by_value_handle(GattAttribute::Handle_t char_han
return false;
}
bool GattServer::get_value_handle_by_cccd_handle(GattAttribute::Handle_t cccd_handle, GattAttribute::Handle_t &char_handle) const {
uint8_t idx;
if (!get_cccd_index_by_cccd_handle(cccd_handle, idx)) {
return false;
}
char_handle = cccd_handles[idx];
return true;
}
bool GattServer::is_update_authorized(
connection_handle_t connection,
GattAttribute::Handle_t value_handle

View File

@ -293,6 +293,8 @@ private:
bool get_cccd_index_by_value_handle(GattAttribute::Handle_t char_handle, uint8_t &idx) const;
bool get_value_handle_by_cccd_handle(GattAttribute::Handle_t cccd_handle, GattAttribute::Handle_t &char_handle) const;
bool is_update_authorized(connection_handle_t connection, GattAttribute::Handle_t value_handle);
struct alloc_block_t {