Adding a custom service on ble_peripheral_server_bond

Hello,

I’m strugeling to add a new service on the ble_peripheral_server_bond example from the RSL10,
My goal is to connect a sensor and to send is value every 10s.

I see on the example, theres a counter send every 6s, I manage to change to 10s. I change this parameter tin the main function CUSTOMSS_NotifyOnTimeout(TIMER_SETTING_S(10));

In the function CUSTOMSS_Initialize() I add a new MsgHandler_Add() with a new callback function
(for now this callback function just print something). But the problem is this function is never call.

I also don’t understand where the counter is increment and send. The call back function of the counter is just a print. I think I miss a piece of the puzzle.

Do you have any clue ?

Thanks,
Alban

Use the sample code inside the CMSIS pack mentioned here: FOTA with custom services - #2 by lukas.mandak

This will help you add one more custom service. You will need to modify some parts of the sample code though.

2 Likes

Hello,

I prefer not to touch the RTE files if it’s possible.
In the readMe of the prject they said :

This sample project is equipped with a Bluetooth Low Energy abstraction layer
that provides a higher level application programming interface (API) to
abstract the Bluetooth GAP and GATT layers.

I think it’s defenetly possible to do it but I don’t see how.

I don’t remember all the details but in the ble_peripheral_server_bond example it should be possible to add one more custom service without changing files in RTE folder; that example I linked to should give some ideas on what to do.

Never the less it shouldn’t be a problem changing things inside the RTE files that are local to the project. Just keep a backup of the original file and revert back to the original version if something goes wrong.

2 Likes

Thank’s for your help,

I find were the message is send. It’s in app_customss.c in the function CUSTOMSS_MsgHandler() in the case CUSTOMSS_NTF_TIMEOUT and it’s send and increment the value in the first if case.

1 Like