Skip to content

Commit 8b07e97

Browse files
author
Abbas Bracken Ziad
committed
Add value handle getter to Gatt Server
1 parent 7389671 commit 8b07e97

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,15 @@ bool GattServer::get_cccd_index_by_value_handle(GattAttribute::Handle_t char_han
15421542
return false;
15431543
}
15441544

1545+
bool GattServer::get_value_handle_by_cccd_handle(GattAttribute::Handle_t cccd_handle, GattAttribute::Handle_t &char_handle) const {
1546+
uint8_t idx;
1547+
if (!get_cccd_index_by_cccd_handle(cccd_handle, idx)) {
1548+
return false;
1549+
}
1550+
char_handle = cccd_handles[idx];
1551+
return true;
1552+
}
1553+
15451554
bool GattServer::is_update_authorized(
15461555
connection_handle_t connection,
15471556
GattAttribute::Handle_t value_handle

connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ class GattServer : public PalSigningMonitor {
293293

294294
bool get_cccd_index_by_value_handle(GattAttribute::Handle_t char_handle, uint8_t &idx) const;
295295

296+
bool get_value_handle_by_cccd_handle(GattAttribute::Handle_t cccd_handle, GattAttribute::Handle_t &char_handle) const;
297+
296298
bool is_update_authorized(connection_handle_t connection, GattAttribute::Handle_t value_handle);
297299

298300
struct alloc_block_t {

0 commit comments

Comments
 (0)