From ae079c1fc5d990ba55714d4b3a51b19f96edaec4 Mon Sep 17 00:00:00 2001 From: WXK <287788329@qq.com> Date: 星期四, 24 四月 2025 16:01:43 +0800 Subject: [PATCH] 改为中断来低电平触发发送当前扫描数据,3s内扫描不到的会退出,串口来55 AA 75 70 64 61 74 65,进入升级模式 --- 01_SDK/nimble/host/nimble/nimble/host/include/host/ble_store.h | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/01_SDK/nimble/host/nimble/nimble/host/include/host/ble_store.h b/01_SDK/nimble/host/nimble/nimble/host/include/host/ble_store.h index 9689545..b2c305d 100644 --- a/01_SDK/nimble/host/nimble/nimble/host/include/host/ble_store.h +++ b/01_SDK/nimble/host/nimble/nimble/host/include/host/ble_store.h @@ -50,6 +50,11 @@ */ ble_addr_t peer_addr; +#if SMP_MULTI_ADDR_MODE_EN + ble_addr_t own_addr; + uint8_t is_own_addr_valid; +#endif + /** Key by ediv; ediv_rand_present=0 means don't key off ediv. */ uint16_t ediv; @@ -70,6 +75,10 @@ */ struct ble_store_value_sec { ble_addr_t peer_addr; + +#if SMP_MULTI_ADDR_MODE_EN + ble_addr_t own_addr; +#endif uint8_t key_size; uint16_t ediv; @@ -99,6 +108,11 @@ */ ble_addr_t peer_addr; +#if SMP_MULTI_ADDR_MODE_EN + ble_addr_t own_addr; + uint8_t is_own_addr_valid; +#endif + /** * Key by characteristic value handle; * chr_val_handle=0 means don't key off characteristic handle. @@ -115,6 +129,11 @@ */ struct ble_store_value_cccd { ble_addr_t peer_addr; + +#if SMP_MULTI_ADDR_MODE_EN + ble_addr_t own_addr; +#endif + uint16_t chr_val_handle; uint16_t flags; unsigned value_changed:1; @@ -291,13 +310,28 @@ int *out_num_peers, int max_peers); int ble_store_util_delete_all(int type, const union ble_store_key *key); +#if SMP_MULTI_ADDR_MODE_EN +int ble_store_util_delete_peer(const ble_addr_t *peer_id_addr, const ble_addr_t *own_id_addr); +int ble_store_util_delete_oldest_peer(void); +#else int ble_store_util_delete_peer(const ble_addr_t *peer_id_addr); int ble_store_util_delete_oldest_peer(void); +#endif int ble_store_util_count(int type, int *out_count); int ble_store_util_status_rr(struct ble_store_status_event *event, void *arg); int ble_store_iterate_replace_cccd(ble_addr_t* src_addr, ble_addr_t* target_addr); + +#if SMP_MULTI_ADDR_MODE_EN +extern struct ble_store_value_sec *ble_store_config_get_our_secs(uint8_t id); +extern struct ble_store_value_sec *ble_store_config_get_peer_secs(uint8_t id); +extern struct ble_store_value_cccd *ble_store_config_get_cccds(uint8_t id); +extern int ble_store_config_get_our_secs_num(void); +extern int ble_store_config_get_peer_secs_num(void); +extern int ble_store_config_get_cccds_num(void); +#endif + #ifdef __cplusplus } #endif -- Gitblit v1.9.3