Hi there,
I was just wondering whether the s140 supports adding, inserting and removing BLE service and characteristics at run time. if yes, what should I pay attention to when doing so?
Thanks in advance!
Hi there,
I was just wondering whether the s140 supports adding, inserting and removing BLE service and characteristics at run time. if yes, what should I pay attention to when doing so?
Thanks in advance!
Hi
If you use the 'service changed' characteristic in the GATT service you can add services dynamically, and alert the connected BLE device that the services have changed, but removing services dynamically is not supported.
The only way to remove a service dynamically is to disable the SoftDevice completely, re-enable it, and configure it without the service you want to remove.
This will obviously require any running Bluetooth connections to be taken down, and re-established once you have rebooted and reconfigured the SoftDevice.
Best regards
Torbjørn
Thank you for the clear answer!
If I was going to disable and re-enable the SoftDevice, is there any defective effect to the openthread functionality?
Hi
I am pretty sure you would have to disable openthread before disabling the SoftDevice, as the openthread stack depends on the timeslot API of the SoftDevice to schedule the thread activities alongside BLE.
I have asked the thread developers for a confirmation on this, and will get back to you when I hear from them.
Best regards
Torbjørn
Thank you so much for your patient support!
Best regards,
guohui
Thank you so much for your patient support!
Best regards,
guohui
Hi
The thread developers confirmed my suspicion.
If you disable the SoftDevice without first disabling the thread stack then the stack will crash.
You should be able to disable the thread stack first, then disable the SoftDevice, change the services, and then re-enable everything, but this will be a quite slow process.
If you can accept to drop out of the thread-network for several minutes it might be an acceptable solution.
Best regards
Torbjørn
Gotcha! Thank you so much!
You welcome