Lines Matching refs:cp
291 const struct btp_gatt_add_service_cmd *cp = cmd; in add_service() local
297 if ((cmd_len < sizeof(*cp)) || in add_service()
298 (cmd_len != sizeof(*cp) + cp->uuid_length)) { in add_service()
302 if (btp2bt_uuid(cp->uuid, cp->uuid_length, &uuid.uuid)) { in add_service()
318 switch (cp->type) { in add_service()
496 const struct btp_gatt_add_characteristic_cmd *cp = cmd; in add_characteristic() local
501 if ((cmd_len < sizeof(*cp)) || in add_characteristic()
502 (cmd_len != sizeof(*cp) + cp->uuid_length)) { in add_characteristic()
508 cmd_data.permissions = cp->permissions; in add_characteristic()
509 cmd_data.properties = cp->properties; in add_characteristic()
512 if (btp2bt_uuid(cp->uuid, cp->uuid_length, &uuid.uuid)) { in add_characteristic()
517 if (cp->svc_id) { in add_characteristic()
685 const struct btp_gatt_add_descriptor_cmd *cp = cmd; in add_descriptor() local
691 if ((cmd_len < sizeof(*cp)) || in add_descriptor()
692 (cmd_len != sizeof(*cp) + cp->uuid_length)) { in add_descriptor()
703 cmd_data.permissions = cp->permissions; in add_descriptor()
706 if (btp2bt_uuid(cp->uuid, cp->uuid_length, &uuid.uuid)) { in add_descriptor()
711 if (cp->char_id) { in add_descriptor()
756 const struct btp_gatt_add_included_service_cmd *cp = cmd; in add_included() local
766 svc_id = sys_le16_to_cpu(cp->svc_id); in add_included()
884 const struct btp_gatt_set_value_cmd *cp = cmd; in set_value() local
889 if ((cmd_len < sizeof(*cp)) || in set_value()
890 (cmd_len != sizeof(*cp) + sys_le16_to_cpu(cp->len))) { in set_value()
894 attr_id = sys_le16_to_cpu(cp->attr_id); in set_value()
900 cmd_data.value = cp->value; in set_value()
901 cmd_data.len = sys_le16_to_cpu(cp->len); in set_value()
960 const struct btp_gatt_set_enc_key_size_cmd *cp = cmd; in set_enc_key_size() local
965 if (cp->key_size < 0x07 || cp->key_size > 0x0f) { in set_enc_key_size()
969 attr_id = sys_le16_to_cpu(cp->attr_id); in set_enc_key_size()
972 ret = set_attr_enc_key_size(LAST_DB_ATTR, cp->key_size); in set_enc_key_size()
976 server_db[0].handle], cp->key_size); in set_enc_key_size()
1001 const struct btp_gatt_exchange_mtu_cmd *cp = cmd; in exchange_mtu() local
1004 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in exchange_mtu()
1082 const struct btp_gatt_disc_all_prim_cmd *cp = cmd; in disc_all_prim() local
1085 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in disc_all_prim()
1118 const struct btp_gatt_disc_prim_uuid_cmd *cp = cmd; in disc_prim_uuid() local
1121 if ((cmd_len < sizeof(*cp)) || in disc_prim_uuid()
1122 (cmd_len != sizeof(*cp) + cp->uuid_length)) { in disc_prim_uuid()
1126 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in disc_prim_uuid()
1131 if (btp2bt_uuid(cp->uuid, cp->uuid_length, &uuid.uuid)) { in disc_prim_uuid()
1210 const struct btp_gatt_find_included_cmd *cp = cmd; in find_included() local
1213 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in find_included()
1223 discover_params.start_handle = sys_le16_to_cpu(cp->start_handle); in find_included()
1224 discover_params.end_handle = sys_le16_to_cpu(cp->end_handle); in find_included()
1288 const struct btp_gatt_disc_all_chrc_cmd *cp = cmd; in disc_all_chrc() local
1291 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in disc_all_chrc()
1301 discover_params.start_handle = sys_le16_to_cpu(cp->start_handle); in disc_all_chrc()
1302 discover_params.end_handle = sys_le16_to_cpu(cp->end_handle); in disc_all_chrc()
1324 const struct btp_gatt_disc_chrc_uuid_cmd *cp = cmd; in disc_chrc_uuid() local
1327 if ((cmd_len < sizeof(*cp)) || in disc_chrc_uuid()
1328 (cmd_len != sizeof(*cp) + cp->uuid_length)) { in disc_chrc_uuid()
1332 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in disc_chrc_uuid()
1337 if (btp2bt_uuid(cp->uuid, cp->uuid_length, &uuid.uuid)) { in disc_chrc_uuid()
1348 discover_params.start_handle = sys_le16_to_cpu(cp->start_handle); in disc_chrc_uuid()
1349 discover_params.end_handle = sys_le16_to_cpu(cp->end_handle); in disc_chrc_uuid()
1412 const struct btp_gatt_disc_all_desc_cmd *cp = cmd; in disc_all_desc() local
1415 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in disc_all_desc()
1425 discover_params.start_handle = sys_le16_to_cpu(cp->start_handle); in disc_all_desc()
1426 discover_params.end_handle = sys_le16_to_cpu(cp->end_handle); in disc_all_desc()
1526 const struct btp_gatt_read_cmd *cp = cmd; in read_data() local
1529 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in read_data()
1540 read_params.single.handle = sys_le16_to_cpu(cp->handle); in read_data()
1562 const struct btp_gatt_read_uuid_cmd *cp = cmd; in read_uuid() local
1565 if ((cmd_len < sizeof(*cp)) || in read_uuid()
1566 (cmd_len != sizeof(*cp) + cp->uuid_length)) { in read_uuid()
1570 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in read_uuid()
1575 if (btp2bt_uuid(cp->uuid, cp->uuid_length, &uuid.uuid)) { in read_uuid()
1587 read_params.by_uuid.start_handle = sys_le16_to_cpu(cp->start_handle); in read_uuid()
1588 read_params.by_uuid.end_handle = sys_le16_to_cpu(cp->end_handle); in read_uuid()
1608 const struct btp_gatt_read_long_cmd *cp = cmd; in read_long() local
1611 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in read_long()
1622 read_params.single.handle = sys_le16_to_cpu(cp->handle); in read_long()
1623 read_params.single.offset = sys_le16_to_cpu(cp->offset); in read_long()
1644 const struct btp_gatt_read_multiple_cmd *cp = cmd; in read_multiple() local
1649 if ((cmd_len < sizeof(*cp)) || in read_multiple()
1650 (cmd_len != sizeof(*cp) + (cp->handles_count * sizeof(cp->handles[0])))) { in read_multiple()
1654 if (cp->handles_count == 0 || cp->handles_count > ARRAY_SIZE(handles)) { in read_multiple()
1658 for (i = 0; i < cp->handles_count; i++) { in read_multiple()
1659 handles[i] = sys_le16_to_cpu(cp->handles[i]); in read_multiple()
1662 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in read_multiple()
1673 read_params.handle_count = cp->handles_count; in read_multiple()
1695 const struct btp_gatt_read_multiple_var_cmd *cp = cmd; in read_multiple_var() local
1700 if ((cmd_len < sizeof(*cp)) || in read_multiple_var()
1701 (cmd_len != sizeof(*cp) + (cp->handles_count * sizeof(cp->handles[0])))) { in read_multiple_var()
1705 if (cp->handles_count > ARRAY_SIZE(handles)) { in read_multiple_var()
1710 handles[i] = sys_le16_to_cpu(cp->handles[i]); in read_multiple_var()
1713 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in read_multiple_var()
1746 const struct btp_gatt_write_without_rsp_cmd *cp = cmd; in write_without_rsp() local
1749 if (cmd_len < sizeof(*cp) || in write_without_rsp()
1750 cmd_len != sizeof(*cp) + sys_le16_to_cpu(cp->data_length)) { in write_without_rsp()
1754 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in write_without_rsp()
1759 if (bt_gatt_write_without_response(conn, sys_le16_to_cpu(cp->handle), in write_without_rsp()
1760 cp->data, in write_without_rsp()
1761 sys_le16_to_cpu(cp->data_length), in write_without_rsp()
1774 const struct btp_gatt_signed_write_without_rsp_cmd *cp = cmd; in write_signed_without_rsp() local
1777 if (cmd_len < sizeof(*cp) || in write_signed_without_rsp()
1778 cmd_len != sizeof(*cp) + sys_le16_to_cpu(cp->data_length)) { in write_signed_without_rsp()
1782 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in write_signed_without_rsp()
1787 if (bt_gatt_write_without_response(conn, sys_le16_to_cpu(cp->handle), in write_signed_without_rsp()
1788 cp->data, in write_signed_without_rsp()
1789 sys_le16_to_cpu(cp->data_length), in write_signed_without_rsp()
1810 const struct btp_gatt_write_cmd *cp = cmd; in write_data() local
1813 if (cmd_len < sizeof(*cp) || in write_data()
1814 cmd_len != sizeof(*cp) + sys_le16_to_cpu(cp->data_length)) { in write_data()
1818 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in write_data()
1823 write_params.handle = sys_le16_to_cpu(cp->handle); in write_data()
1826 write_params.data = cp->data; in write_data()
1827 write_params.length = sys_le16_to_cpu(cp->data_length); in write_data()
1848 const struct btp_gatt_write_long_cmd *cp = cmd; in write_long() local
1851 if (cmd_len < sizeof(*cp) || in write_long()
1852 cmd_len != sizeof(*cp) + sys_le16_to_cpu(cp->data_length)) { in write_long()
1856 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in write_long()
1861 write_params.handle = sys_le16_to_cpu(cp->handle); in write_long()
1863 write_params.offset = sys_le16_to_cpu(cp->offset); in write_long()
1864 write_params.data = cp->data; in write_long()
1865 write_params.length = sys_le16_to_cpu(cp->data_length); in write_long()
2036 const struct btp_gatt_cfg_notify_cmd *cp = cmd; in config_subscription_notif() local
2038 uint16_t ccc_handle = sys_le16_to_cpu(cp->ccc_handle); in config_subscription_notif()
2041 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in config_subscription_notif()
2046 if (cp->enable) { in config_subscription_notif()
2071 const struct btp_gatt_cfg_notify_cmd *cp = cmd; in config_subscription_ind() local
2073 uint16_t ccc_handle = sys_le16_to_cpu(cp->ccc_handle); in config_subscription_ind()
2076 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in config_subscription_ind()
2081 if (cp->enable) { in config_subscription_ind()
2112 const struct btp_gatt_cfg_notify_mult_cmd *cp = cmd; in notify_mult() local
2120 if ((cmd_len < sizeof(*cp)) || in notify_mult()
2121 (cmd_len != sizeof(*cp) + (cp->cnt * sizeof(cp->attr_id[0])))) { in notify_mult()
2125 if (!IN_RANGE(cp->cnt, min_cnt, max_cnt)) { in notify_mult()
2127 cp->cnt, min_cnt, max_cnt); in notify_mult()
2132 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in notify_mult()
2139 for (uint16_t i = 0U; i < cp->cnt; i++) { in notify_mult()
2140 struct bt_gatt_attr attr = server_db[cp->attr_id[i] - in notify_mult()
2152 err = bt_gatt_notify_multiple(conn, cp->cnt, params); in notify_mult()
2159 LOG_DBG("Send %u notifications", cp->cnt); in notify_mult()
2205 const struct btp_gatt_get_attributes_cmd *cp = cmd; in get_attrs() local
2212 if ((cmd_len < sizeof(*cp)) || in get_attrs()
2213 (cmd_len != sizeof(*cp) + cp->type_length)) { in get_attrs()
2217 start_handle = sys_le16_to_cpu(cp->start_handle); in get_attrs()
2218 end_handle = sys_le16_to_cpu(cp->end_handle); in get_attrs()
2220 if (cp->type_length) { in get_attrs()
2223 if (btp2bt_uuid(cp->type, cp->type_length, &search_uuid.uuid)) { in get_attrs()
2334 const struct btp_gatt_get_attribute_value_cmd *cp = cmd; in get_attr_val() local
2336 uint16_t handle = sys_le16_to_cpu(cp->handle); in get_attr_val()
2339 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in get_attr_val()
2369 const struct btp_gatt_change_db_cmd *cp = cmd; in change_database() local
2374 if (cp->start_handle > 0 || cp->end_handle > 0) { in change_database()
2378 switch (cp->operation) { in change_database()
2416 const struct btp_gatt_eatt_connect_cmd *cp = cmd; in eatt_connect() local
2420 conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, &cp->address); in eatt_connect()
2425 err = bt_eatt_connect(conn, cp->num_channels); in eatt_connect()