Lines Matching refs:ccc

1065 	struct _bt_gatt_ccc *ccc;  in convert_to_id_on_match()  local
1073 ccc = attr->user_data; in convert_to_id_on_match()
1078 for (size_t i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { in convert_to_id_on_match()
1079 if (bt_addr_le_eq(&ccc->cfg[i].peer, match->private_addr)) { in convert_to_id_on_match()
1080 bt_addr_le_copy(&ccc->cfg[i].peer, match->id_addr); in convert_to_id_on_match()
1592 static void gatt_unregister_ccc(struct _bt_gatt_ccc *ccc) in gatt_unregister_ccc() argument
1594 ccc->value = 0; in gatt_unregister_ccc()
1596 for (size_t i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { in gatt_unregister_ccc()
1597 struct bt_gatt_ccc_cfg *cfg = &ccc->cfg[i]; in gatt_unregister_ccc()
2053 struct _bt_gatt_ccc *ccc) in find_ccc_cfg() argument
2055 for (size_t i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { in find_ccc_cfg()
2056 struct bt_gatt_ccc_cfg *cfg = &ccc->cfg[i]; in find_ccc_cfg()
2075 struct _bt_gatt_ccc *ccc = attr->user_data; in bt_gatt_attr_read_ccc() local
2079 cfg = find_ccc_cfg(conn, ccc); in bt_gatt_attr_read_ccc()
2092 struct _bt_gatt_ccc *ccc) in gatt_ccc_changed() argument
2097 for (i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { in gatt_ccc_changed()
2098 if (ccc->cfg[i].value > value) { in gatt_ccc_changed()
2099 value = ccc->cfg[i].value; in gatt_ccc_changed()
2103 LOG_DBG("ccc %p value 0x%04x", ccc, value); in gatt_ccc_changed()
2105 if (value != ccc->value) { in gatt_ccc_changed()
2106 ccc->value = value; in gatt_ccc_changed()
2107 if (ccc->cfg_changed) { in gatt_ccc_changed()
2108 ccc->cfg_changed(attr, value); in gatt_ccc_changed()
2117 struct _bt_gatt_ccc *ccc = attr->user_data; in bt_gatt_attr_write_ccc() local
2136 cfg = find_ccc_cfg(conn, ccc); in bt_gatt_attr_write_ccc()
2146 cfg = find_ccc_cfg(NULL, ccc); in bt_gatt_attr_write_ccc()
2157 if (ccc->cfg_write) { in bt_gatt_attr_write_ccc()
2158 ssize_t write = ccc->cfg_write(conn, attr, value); in bt_gatt_attr_write_ccc()
2176 if (cfg->value != ccc->value) { in bt_gatt_attr_write_ccc()
2177 gatt_ccc_changed(attr, ccc); in bt_gatt_attr_write_ccc()
2642 struct _bt_gatt_ccc *ccc; in notify_cb() local
2650 ccc = attr->user_data; in notify_cb()
2653 if (IS_ENABLED(CONFIG_BT_GATT_SERVICE_CHANGED) && ccc == &sc_ccc) { in notify_cb()
2679 for (i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { in notify_cb()
2680 struct bt_gatt_ccc_cfg *cfg = &ccc->cfg[i]; in notify_cb()
2702 if (ccc->cfg_match && !ccc->cfg_match(conn, attr)) { in notify_cb()
3218 struct _bt_gatt_ccc *ccc; in update_ccc() local
3227 ccc = attr->user_data; in update_ccc()
3229 for (i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { in update_ccc()
3230 struct bt_gatt_ccc_cfg *cfg = &ccc->cfg[i]; in update_ccc()
3264 gatt_ccc_changed(attr, ccc); in update_ccc()
3267 ccc == &sc_ccc) { in update_ccc()
3281 struct _bt_gatt_ccc *ccc; in disconnected_cb() local
3290 ccc = attr->user_data; in disconnected_cb()
3293 if (!ccc->value) { in disconnected_cb()
3300 for (i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { in disconnected_cb()
3301 struct bt_gatt_ccc_cfg *cfg = &ccc->cfg[i]; in disconnected_cb()
3323 if (ccc == &sc_ccc) { in disconnected_cb()
3337 ccc->value = 0U; in disconnected_cb()
3338 if (ccc->cfg_changed) { in disconnected_cb()
3339 ccc->cfg_changed(attr, ccc->value); in disconnected_cb()
3342 LOG_DBG("ccc %p reseted", ccc); in disconnected_cb()
3351 const struct _bt_gatt_ccc *ccc; in bt_gatt_is_subscribed() local
3396 ccc = attr->user_data; in bt_gatt_is_subscribed()
3400 const struct bt_gatt_ccc_cfg *cfg = &ccc->cfg[i]; in bt_gatt_is_subscribed()
3403 (ccc_type & ccc->cfg[i].value)) { in bt_gatt_is_subscribed()
4090 struct bt_gatt_ccc ccc; in parse_read_std_char_desc() member
4109 value.ccc.flags = sys_get_le16(data->value); in parse_read_std_char_desc()
5468 static struct bt_gatt_ccc_cfg *ccc_find_cfg(struct _bt_gatt_ccc *ccc, in ccc_find_cfg() argument
5472 for (size_t i = 0; i < ARRAY_SIZE(ccc->cfg); i++) { in ccc_find_cfg()
5473 if (id == ccc->cfg[i].id && in ccc_find_cfg()
5474 bt_addr_le_eq(&ccc->cfg[i].peer, addr)) { in ccc_find_cfg()
5475 return &ccc->cfg[i]; in ccc_find_cfg()
5493 static void ccc_clear(struct _bt_gatt_ccc *ccc, in ccc_clear() argument
5499 cfg = ccc_find_cfg(ccc, addr, id); in ccc_clear()
5512 struct _bt_gatt_ccc *ccc; in ccc_load() local
5520 ccc = attr->user_data; in ccc_load()
5524 ccc_clear(ccc, load->addr_with_id.addr, load->addr_with_id.id); in ccc_load()
5547 cfg = ccc_find_cfg(ccc, load->addr_with_id.addr, load->addr_with_id.id); in ccc_load()
5549 cfg = ccc_find_cfg(ccc, BT_ADDR_LE_ANY, 0); in ccc_load()
5644 BT_SETTINGS_DEFINE(ccc, "ccc", ccc_set_cb, NULL);
5852 struct _bt_gatt_ccc *ccc; in ccc_save() local
5860 ccc = attr->user_data; in ccc_save()
5863 cfg = ccc_find_cfg(ccc, save->addr_with_id.addr, save->addr_with_id.id); in ccc_save()
6130 struct _bt_gatt_ccc *ccc; in remove_peer_from_attr() local
6138 ccc = attr->user_data; in remove_peer_from_attr()
6141 cfg = ccc_find_cfg(ccc, addr_with_id->addr, addr_with_id->id); in remove_peer_from_attr()