Add BT_GATT_CEP and BT_GATT_LONG_DESCRIPTOR so which can be used by
a task to declare long attributes.
Change-Id: I37a0bb1851b60f3cdfa7e2f00ade70d5c344abbf
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Characteristic Extended Properties has 16 bits not 8 bits as value.
Change-Id: I307fd27a6d589d6614829df178ff890301a9b6be
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This introduce a new callback called flush to bt_gatt_attr to indicate
when and attribute can cache data, the data is automatically flushed if
regular write request happens and in case of prepare write it checks if
flush is supported otherwise return an error, then upon receiving an
execute write it perform flush over the entire database and respond
with result:
< ACL Data TX: Handle 42 flags 0x00 dlen 6
ATT: Execute Write Request (0x18) len 1
Flags: Immediately write all pending values (0x01)
> ACL Data RX: Handle 42 flags 0x02 dlen 5
ATT: Execute Write Response (0x19) len 0
Change-Id: I2c47f962858b8a741bf40509a648fe2cd6755691
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes use of new guidelines to document the GATT API.
Change-Id: I5544f449e11dd72c68b0efb15bd06db44ec30279
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The spec says that CCC shall only be persistent accross connection for
bonded devices:
'The Client Characteristic Configuration descriptor value shall be
persistent across connections for bonded devices. The Client Characteristic
Configuration descriptor value shall be set to the default value at each
connection with non-bonded devices'.
To handle this now each configuration has a valid field indicating if the
configuration is valid.
Change-Id: Id74ac54f5e23a7a0b286f90dbc9af4e9ee966dd4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
All public headers should be self-contained. Since gatt.h uses the
ARRAY_SIZE macro it should also include the <misc/util.h> header file
that provides it.
Change-Id: I1fea66d10f452e51d9af5f5c6c345b5bb5a92d00
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This field can be used to set the required permissions for an attribute
which can be checked by Bluetooth core before calling the callback.
Change-Id: Idcab8cdc5744358fab0b3c67b9c0503f1d1d9736
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
bt_gatt_notify can be used to send ATT notifications:
< ACL Data TX: Handle 3585 flags 0x00 dlen 8
ATT: Handle Value Notification (0x1b) len 3
Handle: 0x0010
Data: 64
Change-Id: I908f10f9e60dc7cef221e4b27c3b6e49e7b0cfc9
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
BT_GATT_CCC uses _bt_gatt_ccc internal struct to handle peer
configurations and special helpers to read and write to minimize the
code necessary to handle CCC in the task.
Note this not yet include handling of connection and disconnection but
the idea is that the core would automatically disable the configurations
while disconnected and re-enable once peer connect back.
Change-Id: I89325b8a074766b9fd2423085565df669f7275e1
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
To implement CCC properly it is required to know the remote address since
it is per client, futhermore bt_gatt_notify requires an address where to
send the notification.
Change-Id: I9d9fdf72d668831bed76e2aef06816af3620f4b8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
bt_gatt_foreach_attr iterates over attributes via callback, it will be
used to implement discovery functionality.
Change-Id: Ice66f4b3d0d12b3616986931d5da0fe0f202e533
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds initial API and definitions to create a database.
Change-Id: I69d5b3f5fd2f04cc309c2f76a84581673aa54e7b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>