mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 10:20:58 +00:00
le_device_db_tlv: log_error if tlv isn't initialized, try not to crash
This commit is contained in:
parent
bc71fcbb5e
commit
dba24ced98
@ -110,6 +110,7 @@ static uint32_t le_device_db_tlv_tag_for_index(uint8_t index){
|
||||
// @returns success
|
||||
// @param index = entry_pos
|
||||
static int le_device_db_tlv_fetch(int index, le_device_db_entry_t * entry){
|
||||
if (!le_device_db_tlv_btstack_tlv_impl) return 0;
|
||||
if (index < 0 || index >= NVM_NUM_DEVICE_DB_ENTRIES){
|
||||
log_error("le_device_db_tlv_fetch called with invalid index %d", index);
|
||||
return 0;
|
||||
@ -122,6 +123,7 @@ static int le_device_db_tlv_fetch(int index, le_device_db_entry_t * entry){
|
||||
// @returns success
|
||||
// @param index = entry_pos
|
||||
static int le_device_db_tlv_store(int index, le_device_db_entry_t * entry){
|
||||
if (!le_device_db_tlv_btstack_tlv_impl) return 0;
|
||||
if (index < 0 || index >= NVM_NUM_DEVICE_DB_ENTRIES){
|
||||
log_error("le_device_db_tlv_store called with invalid index %d", index);
|
||||
return 0;
|
||||
@ -133,6 +135,7 @@ static int le_device_db_tlv_store(int index, le_device_db_entry_t * entry){
|
||||
|
||||
// @param index = entry_pos
|
||||
static int le_device_db_tlv_delete(int index){
|
||||
if (!le_device_db_tlv_btstack_tlv_impl) return 0;
|
||||
if (index < 0 || index >= NVM_NUM_DEVICE_DB_ENTRIES){
|
||||
log_error("le_device_db_tlv_delete called with invalid index %d", index);
|
||||
return 0;
|
||||
@ -158,6 +161,9 @@ static void le_device_db_tlv_scan(void){
|
||||
}
|
||||
|
||||
void le_device_db_init(void){
|
||||
if (!le_device_db_tlv_btstack_tlv_impl) {
|
||||
log_error("btstack_tlv not initialized");
|
||||
}
|
||||
}
|
||||
|
||||
// not used
|
||||
|
Loading…
x
Reference in New Issue
Block a user