This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

De-initialisation of custom BLE services

We are looking to implement "dynamic" BLE services that can be configured (i.e. enabled/disabled) externally, however from the examples there appears to be no way of de-initialising a service.

Most services have a *_init function, but no corresponding *_deinit function.

In this case what is the best/"canonical" way of achieving the disabling/enabling of a service without having to restart the device?

  • Hello, 

    Welcome to DevZone. I suggest using our Infocenter to search for information.

    What kind of services are you looking to disable? The S132 SoftDevice is a BluetoothRegistered Low Energy Central and Peripheral protocol stack solution that supports nRF52832. To enable and disable the SoftDevice, please see SoftDevice Manager API.

    There are also several others who have asked similar questions to you, regarding start/stop, enable/disable function, e.g. this thread.

    Please provide some more information, and I will try to give an even more detailed answer. 

    Kind regards,
    Øyvind

  • Hello,

    Thanks for the reply.

    We are working on an application that provides both peripheral and central mode functionality via BLE. We require the SoftDevice to be enabled at all times. We already control the BLE stack as determined by the configuration of the module.

    The nrf52832 device is a slave to the our primary processor. The primary processor provides the configuration with which the nrf module needs to comply.

    When I mentioned BLE services I was referring to the services defined by a GATT profile (peripheral mode functionality, GATT server in the Infocenter language) that needs to be enabled/disabled dynamically as dictated by the current configuration provided by the primary processor.

    In the API for the SoftDevice S132 V6.0.0 GATT server API are there are *_add() and *_get() functions however no mention of removal/clearing/disabling

    As implied in the original question we are looking to have multiple custom services running side-by-side and any one of them can be enabled/disabled as the configuration dictates.

    Kind Regards,

    Alex

  • Hi Alex, 

    Thanks for providing the information! The only way to stop services is to disable the SoftDevice completely, re-enable it and configure it without the service you want to remove. Please see my colleague Torbjørn's answer here.

    Kind regards,
    Øyvind

  • Hi Øyvind,

    Thank you for that.

    Kind Regards,

    Alex

Related