att_db_util: Add API to specify next attribute handle. (#647)

Co-authored-by: Alex McHugh <alex.mchugh@allient.com>
This commit is contained in:
Alex McHugh 2024-12-14 03:41:03 +13:00 committed by Matthias Ringwald
parent b7aa69761a
commit 12f6b60600
2 changed files with 12 additions and 0 deletions

View File

@ -89,6 +89,11 @@ void att_db_util_init(void){
att_db_util_set_end_tag();
}
void att_db_util_set_next_handle(uint16_t handle){
btstack_assert(handle >= att_db_next_handle); // do not reuse assigned handles
att_db_next_handle = handle;
}
static bool att_db_util_hash_include_with_value(uint16_t uuid16){
/* «Primary Service», «Secondary Service», «Included Service», «Characteristic», or «Characteristic Extended Properties» */
switch (uuid16){

View File

@ -61,6 +61,13 @@ extern "C" {
*/
void att_db_util_init(void);
/**
* @brief Set handle value for next table entry
* @param handle
* @note new handle must be >= previous to avoid reusing assigned handles
*/
void att_db_util_set_next_handle(uint16_t handle);
/**
* @brief Add primary service for 16-bit UUID
* @param uuid16