gatt: Allow GATT server to dicate CCC permissions
authorDagan Martinez <dmartinez@starry.com>
Fri, 1 Oct 2021 14:17:18 +0000 (10:17 -0400)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:37 +0000 (19:08 +0530)
commit923e6c1659f58d2094f3d83a420b1793b8650430
tree5bbd4f67d61556a56cafe2f8f61de4847a978723
parentca4e134a03cdeac5818d59d8cc67001359fdadd6
gatt: Allow GATT server to dicate CCC permissions

Allow a GATT server to impose write permissions/restrictions on a CCC by
setting additional `X-notify` and `X-indicate` flags on its associated
characteristic.

This allows a developer to require encryption/authentication in order
for a GATT client to subscribe to server-initiated updates.

```
[bluetooth]# register-characteristic\
4b75f0f8-1f23-46b1-900c-5bbabcd5ca93 encrypt-read,encrypt-notify

[NEW] Characteristic (Handle 0x0000)
        /org/bluez/app/service0/chrc17
        4b75f0f8-1f23-46b1-900c-5bbabcd5ca93
        Vendor specific
[/org/bluez/app/service0/chrc17] Enter value: 42
```

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/gatt-database.c