Bluetooth: GATT: Indicate service changes when reconnecting

If peer has previously configure to received service changes indications
any changes to the database during the time it has been disconnected
shall be indicated once it reconnects:

[bt] [DBG] sc_process: (0x004065b4) start 0x000a end 0x0014
[bt] [DBG] sc_save: (0x004065b4) peer b8:8a:60:d8:17:d7 (public)
 start 0x000a end 0x0014
[bt] [DBG] bt_gatt_connected: (0x00405240) conn 0x00405aa0
[bt] [DBG] gatt_ccc_changed: (0x00405240) ccc 0x00400b30 value 0x0002
[bt] [DBG] sc_ccc_cfg_changed: (0x00405240) value 0x0002
[bt] [DBG] sc_restore: (0x00405240) peer b8:8a:60:d8:17:d7 (public)
 start 0x000a end 0x0014
[bt] [DBG] sc_process: (0x004065b4) start 0x000a end 0x0014
[bt] [DBG] gatt_indicate: (0x004065b4) conn 0x00405aa0 handle 0x0008
[bt] [DBG] sc_indicate_rsp: (0x00405240) err 0x00

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2017-07-21 12:49:51 +03:00 committed by Johan Hedberg
commit cf913738c5
2 changed files with 101 additions and 29 deletions

View file

@ -488,14 +488,17 @@ ssize_t bt_gatt_attr_read_chrc(struct bt_conn *conn,
#define BT_GATT_CCC_MAX (CONFIG_BLUETOOTH_MAX_PAIRED + \
CONFIG_BLUETOOTH_MAX_CONN)
/** @brief GATT CCC configuration entry. */
/** @brief GATT CCC configuration entry.
* @param valid Valid flag
* @param peer Remote peer address
* @param value Configuration value.
* @param data Configuration pointer data.
*/
struct bt_gatt_ccc_cfg {
/** Config valid flag. */
u8_t valid;
/** Config peer address. */
bt_addr_le_t peer;
/** Config peer value. */
u16_t value;
u8_t data[4] __aligned(4);
};
/* Internal representation of CCC value */