mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-17 20:42:47 +00:00
att_db: read const value for given handle
This commit is contained in:
parent
6314722e05
commit
6f74cd091e
@ -194,13 +194,27 @@ uint16_t att_uuid_for_handle(uint16_t attribute_handle){
|
||||
att_iterator_t it;
|
||||
int ok = att_find_handle(&it, attribute_handle);
|
||||
if (!ok){
|
||||
return 0;
|
||||
return 0u;
|
||||
}
|
||||
if ((it.flags & (uint16_t)ATT_PROPERTY_UUID128) != 0u){
|
||||
return 0u;
|
||||
}
|
||||
return little_endian_read_16(it.uuid, 0);
|
||||
}
|
||||
|
||||
const uint8_t * gatt_server_get_const_value_for_handle(uint16_t attribute_handle, uint16_t * out_value_len){
|
||||
att_iterator_t it;
|
||||
int ok = att_find_handle(&it, attribute_handle);
|
||||
if (!ok){
|
||||
return 0u;
|
||||
}
|
||||
if ((it.flags & (uint16_t)ATT_PROPERTY_DYNAMIC) != 0u){
|
||||
return 0u;
|
||||
}
|
||||
*out_value_len = it.value_len;
|
||||
return it.value;
|
||||
}
|
||||
|
||||
// end of client API
|
||||
|
||||
static void att_update_value_len(att_iterator_t *it, uint16_t offset, hci_con_handle_t con_handle) {
|
||||
|
@ -298,6 +298,15 @@ uint16_t att_read_callback_handle_byte(uint8_t value, uint16_t offset, uint8_t *
|
||||
*/
|
||||
uint16_t att_uuid_for_handle(uint16_t attribute_handle);
|
||||
|
||||
/**
|
||||
* @brief Get const value for handle
|
||||
* @param attribute_handle
|
||||
* @param out_value_len output variable that hold value len
|
||||
* @return value
|
||||
*/
|
||||
|
||||
const uint8_t * gatt_server_get_const_value_for_handle(uint16_t attribute_handle, uint16_t * out_value_len);
|
||||
|
||||
// experimental GATT Server API
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user