mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-13 05:27:56 +00:00
fix(nimble): Reset HID services during deinit
This commit is contained in:
@@ -33,6 +33,7 @@ extern "C" {
|
||||
int ble_svc_bas_battery_level_set(uint8_t level);
|
||||
|
||||
void ble_svc_bas_init(void);
|
||||
void ble_svc_bas_deinit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -115,6 +115,11 @@ ble_svc_bas_battery_level_set(uint8_t level) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
ble_svc_bas_deinit(void)
|
||||
{
|
||||
ble_gatts_free_svcs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the Battery Service.
|
||||
|
||||
@@ -129,7 +129,7 @@ extern struct ble_svc_dis_data ble_svc_dis_data;
|
||||
* Automatically called during package initialisation.
|
||||
*/
|
||||
void ble_svc_dis_init(void);
|
||||
|
||||
void ble_svc_dis_deinit(void);
|
||||
/**
|
||||
* Service initialisation as an included service.
|
||||
*/
|
||||
|
||||
@@ -449,6 +449,12 @@ ble_svc_dis_init_dynamic(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
ble_svc_dis_deinit(void)
|
||||
{
|
||||
ble_gatts_free_svcs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the DIS package.
|
||||
*/
|
||||
|
||||
@@ -111,6 +111,7 @@ struct ble_svc_hid_params{
|
||||
};
|
||||
|
||||
void ble_svc_hid_init(void);
|
||||
void ble_svc_hid_deinit(void);
|
||||
int ble_svc_hid_add(struct ble_svc_hid_params params);
|
||||
void ble_svc_hid_reset(void);
|
||||
|
||||
|
||||
@@ -748,6 +748,12 @@ ble_svc_hid_reset(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ble_svc_hid_deinit(void)
|
||||
{
|
||||
ble_gatts_free_svcs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the HID Service.
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,7 @@ typedef int ble_svc_sps_event_fn(uint16_t scan_interval, uint16_t scan_window);
|
||||
|
||||
void ble_svc_sps_scan_refresh(void);
|
||||
void ble_svc_sps_init(uint16_t scan_itvl, uint16_t scan_window);
|
||||
void ble_svc_sps_deinit(void);
|
||||
void ble_svc_sps_set_cb(ble_svc_sps_event_fn *cb);
|
||||
#if MYNEWT_VAL(BLE_STATIC_TO_DYNAMIC)
|
||||
void ble_svc_sps_reset(void);
|
||||
|
||||
@@ -194,6 +194,13 @@ ble_svc_sps_set_cb(ble_svc_sps_event_fn *cb)
|
||||
ble_svc_sps_cb_fn = cb;
|
||||
}
|
||||
|
||||
void ble_svc_sps_deinit(void)
|
||||
{
|
||||
ble_gatts_free_svcs();
|
||||
ble_scan_itvl = 0;
|
||||
ble_scan_window = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the SPS package.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user