Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Should Service Changed Characteristic Be Used

I noticed a lot of the early SDK's 11, 12, 13 examples that had the service changed characteristic enabled.  I'm using SDK 16 and it seems that most examples don't enable the service changed characteristic, is there a reason for this?  We have had a lot of issues with iOS caching the service characteristics until I found this post https://devzone.nordicsemi.com/f/nordic-q-a/6248/what-is-is_srvc_changed_charact_present-for which works well.

Is there any reason I wouldn't want to use the service changed characteristic?  If I use service changed characteristic in the app should I also use it in the DFU bootloader?

Thanks,

Parents
  • Hi,

    Is there any reason I wouldn't want to use the service changed characteristic?

    No, it makes sense in most cases. And it is absolutely needed if you ever want to change the services on a device without having problems with iOS caching. If in doubt, include the service changed characteristic.

    If I use service changed characteristic in the app should I also use it in the DFU bootloader?

    Yes. Though if you use DFU without bonding the bootloader will use a different BLE address, so it does not matter much in this case as the peer will see the it as two devices. It will not harm in this case though. And if you use bonding, and use the same BLE address when in bootloader mode as in normal mode, you must include the service changed characteristic in the bootloader as well. The bootloader will send service changed indication as needed in that case (see implementation in components\libraries\bootloader\ble_dfu\nrf_dfu_ble.c if you are interested).

Reply
  • Hi,

    Is there any reason I wouldn't want to use the service changed characteristic?

    No, it makes sense in most cases. And it is absolutely needed if you ever want to change the services on a device without having problems with iOS caching. If in doubt, include the service changed characteristic.

    If I use service changed characteristic in the app should I also use it in the DFU bootloader?

    Yes. Though if you use DFU without bonding the bootloader will use a different BLE address, so it does not matter much in this case as the peer will see the it as two devices. It will not harm in this case though. And if you use bonding, and use the same BLE address when in bootloader mode as in normal mode, you must include the service changed characteristic in the bootloader as well. The bootloader will send service changed indication as needed in that case (see implementation in components\libraries\bootloader\ble_dfu\nrf_dfu_ble.c if you are interested).

Children
Related