I’m trying to add a custom service to the ble_peripheral_server_hrp_fota_sleep example. From my understanding, GATTM_AddAttributeDatabase can only be called once. Therefore, I temporary commented “DFUS_Initialize()” call in main to avoid the DFU service to be initialized (in the future I will correctly implement it to create my custom service and the DFU service).
I don’t want the heart rate profile server to be created either so I commented HRPS_Setup(). Then I added my custom service initialization and I did the same as bel_dfus.c which is:
Create (and registered) a MsgHandler to receive GAPM_CMP_EVT, GAPC_CONNECTION_REQ_IND, GAPC_DISCONNECT_IND and GATTM_ADD_SVC_RSP events
In this handler, when I receive GAPM_CMP_EVT event, I check the operation, if it’s GAPM_SET_DEV_CONFIG, then I’m calling GATTM_AddAttributeDatabase like below
Ok understood but I commented DFUS_Initialize() just for testing. In the end, I would like to have DFU enabled. Isn’t it possible to have a custom service in addition of the DFU service?
Isn’t it possible to have a custom service in addition of the DFU service?
Answer: It is possible to add custom service in addition of DFU service.
Please refer to the following topics in community forum.
FOTA with custom services
We want to use the FOTA Image system with our custom application. There are custom BLE services in this app. But the FOTA user’s guide indicates:
Is there an example to illustrate how to add custom services and characteristics with FOTA system?
and
Adding Custom Service Support to an RSL10 Firmware that uses the DFU Service (FOTA)
When designing a Bluetooth Low Energy solution on the RSL10, it may be necessary to create your own Custom Service if the standard Profiles are not meeting all of your needs.
On the RSL10, it is required to have only a single Attribute Database that describes all of the various Custom Services that will be passed to the Stack. Therefore, because the DFU Service is also a unique Custom Service, if you are using FOTA as well, you will be required to merge the DFU Service Attribute Database with any other Custom Service Attribute Databases you wish to use.
Is there a sample available that provides an outline/guide on how multiple Custom Services can be supported alongside FOTA?