How to know when set the BT_GATT_SUBSCRIBE_FLAG_VOLATILE

I came across a client example that use the

atomic_set_bit( var_bt_gatt_subscribe_params.flags, BT_GATT_SUBSCRIBE_FLAG_VOLATILE );

I read about BT_GATT_SUBSCRIBE_FLAG_VOLATILE 

If set, indicates that the subscription is not saved
    on the GATT server side. Therefore, upon disconnection,
    the subscription will be automatically removed
    from the client's subscriptions list and
    when the client reconnects, it will have to
    issue a new subscription.

How I know if the subscription is not saved on the GATT server side (which I already developed)?

  • Hi,

    How I know if the subscription is not saved on the GATT server side (which I already developed)?

    In a static server/client configuration where  you have known servers, then you can simply do a smoke test of not  having BT_GATT_SUBSCRIBE_FLAG_VOLATILE set on your client side, disconnect, reconnect and see if the subscription still works. If not, then you know that the server is not saving subscriptions to the client after disconnections. 

    If you want to have a safe implementation, then irrespective of what the server does, then set BT_GATT_SUBSCRIBE_FLAG_VOLATILE in the client side and have a new subscription enrolled after every connection. Just thinking our loud here, since I haven't used this feature directly myself.

Related