mgmt: Add function to unregister GATT service

This adds a possibility to unregister GATT SMP service.
Using this function, device can disable Firmware Update
functionality, if not needed.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
Mariusz Skamra 2018-10-31 10:02:51 +01:00 committed by Johan Hedberg
commit 9a69cfbf19
2 changed files with 12 additions and 0 deletions

View file

@ -25,6 +25,13 @@ extern "C" {
*/ */
int smp_bt_register(void); int smp_bt_register(void);
/**
* @brief Unregisters the SMP Bluetooth service.
*
* @return 0 on success; negative error code on failure.
*/
int smp_bt_unregister(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View file

@ -176,6 +176,11 @@ int smp_bt_register(void)
return bt_gatt_service_register(&smp_bt_svc); return bt_gatt_service_register(&smp_bt_svc);
} }
int smp_bt_unregister(void)
{
return bt_gatt_service_unregister(&smp_bt_svc);
}
static int smp_bt_init(struct device *dev) static int smp_bt_init(struct device *dev)
{ {
ARG_UNUSED(dev); ARG_UNUSED(dev);