From 58e5f4f59c77df170c8e9137352f84057d7d8416 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 8 Feb 2024 17:56:53 +0800 Subject: [PATCH] add ble disconnect --- include/zble_module.h | 1 + src/zble_module.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/zble_module.h b/include/zble_module.h index 881bf22..30e6182 100644 --- a/include/zble_module.h +++ b/include/zble_module.h @@ -33,5 +33,6 @@ void zble_module_reglistener(zble_event_listener_t event_listener); void zble_module_start_adv(); void zble_module_stop_adv(); bool zble_module_is_connected(); +bool zble_module_disconnect(); int32_t zble_module_get_mtu_size(); \ No newline at end of file diff --git a/src/zble_module.c b/src/zble_module.c index 963ef8a..022230f 100644 --- a/src/zble_module.c +++ b/src/zble_module.c @@ -448,4 +448,9 @@ void zble_module_init(zble_module_cfg_t *cfg) // zble_module_start_adv(); } -int32_t zble_module_get_mtu_size() { return m_mtu_size; } \ No newline at end of file +int32_t zble_module_get_mtu_size() { return m_mtu_size; } + +bool zble_module_disconnect(){ + ble_conn_state_for_each_connected(disconnect, NULL); + return true; +} \ No newline at end of file