This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

add/remove GATT service or characts with bonded device

Hello, I asked a question after this old one : old one and I read other posts on the subject.

I wonder whether explained constraints may have changed or not since I am using SD130 2.0 - SDK11- nRF51422.

My point is that I want my GATT server to create some services only after some app level transaction has passed. For this purpose, I create a transaction service so that a bonded peripheral can play with. Then after the event has occured, I trigger the creation of another applicative Gatt service. ideally, I want all this to be visible only after bonding, that is done with a static passphrase.

My experience is that when my peripheral app () is bonded to a central (Android), If I update my app with new services or remove services and flash the peripheral, my central still sees the same set of services and chars. This is quite annoying. I assumed at first that this would be because the Gatt table would be static in flash within the soft device for a given bond. but then I tried to flash the softdevice itself and I discovered that my Android central still connected and discovered the old set of services. I guess that whatever, if my app changes while GATT table has not, it might crash quite soon when the peripheral wants to access some supervised data. So I have to reset the bond when I change my services set.

  • is it possible to do it without giving up the bond ? (I don't want to disturb user with this static key too often) I guess this is on the android side... but maybe this behavior is linked to some bonding parameter that is set on the peripheral GATT server.

  • I use device manager, would the behavior be different with peer manager ?

Thanks for your help

Parents
  • FormerMember
    0 FormerMember

    As @jfDEVmoto says, service changed should be used indicate to the client that one or more services has been changed.

    When bonding to a device, the client will typically cache the services on the server side. It will therefore not normally do a service discovery upon a re-connection. When the client and server devices are bonded, and the server has changed one or more services, the service changed indication should be transmitted upon a re-connection, and the client should perform a service discovery procedure.

    Service changed is described in the Bluetooth Core Specification v. 4.2, Vol 3, Part G, chapter 7.1.

  • FormerMember
    0 FormerMember in reply to FormerMember

    To make sure that the allocated flash area never gets full, you can make sure to delete old instances after the service changed.

Reply Children
No Data
Related