mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
att_db_util: add functions to create descriptors. document how to calculate cccd attribute handle
This commit is contained in:
parent
b489552907
commit
9f28d85d18
@ -195,6 +195,18 @@ uint16_t att_db_util_add_characteristic_uuid128(uint8_t * uuid128, uint16_t prop
|
|||||||
return value_handle;
|
return value_handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t att_db_util_add_descriptor_uuid16(uint16_t uuid16, uint16_t properties, uint8_t * data, uint16_t data_len){
|
||||||
|
uint16_t value_handle = att_db_next_handle;
|
||||||
|
att_db_util_add_attribute_uuid16(uuid16, properties, data, data_len);
|
||||||
|
return value_handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t att_db_util_add_descriptor_uuid128(uint8_t * uuid128, uint16_t properties, uint8_t * data, uint16_t data_len){
|
||||||
|
uint16_t value_handle = att_db_next_handle;
|
||||||
|
att_db_util_add_attribute_uuid128(uuid128, properties, data, data_len);
|
||||||
|
return value_handle;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t * att_db_util_get_address(void){
|
uint8_t * att_db_util_get_address(void){
|
||||||
return att_db;
|
return att_db;
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,8 @@ void att_db_util_add_service_uuid128(uint8_t * udid128);
|
|||||||
/**
|
/**
|
||||||
* @brief Add Characteristic with 16-bit UUID, properties, and data
|
* @brief Add Characteristic with 16-bit UUID, properties, and data
|
||||||
* @returns attribute value handle
|
* @returns attribute value handle
|
||||||
|
* @note If properties contains ATT_PROPERTY_NOTIFY or ATT_PROPERTY_INDICATE flags, a Client Configuration Characteristic Descriptor (CCCD)
|
||||||
|
* is created as well. The attribute value handle of the CCCD is the attribute value handle plus 1
|
||||||
* @see ATT_PROPERTY_* in ble/att_db.h
|
* @see ATT_PROPERTY_* in ble/att_db.h
|
||||||
*/
|
*/
|
||||||
uint16_t att_db_util_add_characteristic_uuid16(uint16_t udid16, uint16_t properties, uint8_t * data, uint16_t data_len);
|
uint16_t att_db_util_add_characteristic_uuid16(uint16_t udid16, uint16_t properties, uint8_t * data, uint16_t data_len);
|
||||||
@ -82,10 +84,26 @@ uint16_t att_db_util_add_characteristic_uuid16(uint16_t udid16, uint16_t prop
|
|||||||
/**
|
/**
|
||||||
* @brief Add Characteristic with 128-bit UUID, properties, and data
|
* @brief Add Characteristic with 128-bit UUID, properties, and data
|
||||||
* @returns attribute value handle
|
* @returns attribute value handle
|
||||||
|
* @note If properties contains ATT_PROPERTY_NOTIFY or ATT_PROPERTY_INDICATE flags, a Client Configuration Characteristic Descriptor (CCCD)
|
||||||
|
* is created as well. The attribute value handle of the CCCD is the attribute value handle plus 1
|
||||||
* @see ATT_PROPERTY_* in ble/att_db.h
|
* @see ATT_PROPERTY_* in ble/att_db.h
|
||||||
*/
|
*/
|
||||||
uint16_t att_db_util_add_characteristic_uuid128(uint8_t * udid128, uint16_t properties, uint8_t * data, uint16_t data_len);
|
uint16_t att_db_util_add_characteristic_uuid128(uint8_t * udid128, uint16_t properties, uint8_t * data, uint16_t data_len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Add descriptor with 16-bit UUID, properties, and data
|
||||||
|
* @returns attribute value handle
|
||||||
|
* @see ATT_PROPERTY_* in ble/att_db.h
|
||||||
|
*/
|
||||||
|
uint16_t att_db_util_add_descriptor_uuid16(uint16_t uuid16, uint16_t properties, uint8_t * data, uint16_t data_len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Add descriptor with 128-bit UUID, properties, and data
|
||||||
|
* @returns attribute value handle
|
||||||
|
* @see ATT_PROPERTY_* in ble/att_db.h
|
||||||
|
*/
|
||||||
|
uint16_t att_db_util_add_descriptor_uuid128(uint8_t * udid128, uint16_t properties, uint8_t * data, uint16_t data_len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get address of constructed ATT DB
|
* @brief Get address of constructed ATT DB
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user