Lines Matching defs:p_attr
43 static BOOLEAN deallocate_attr_in_db(tGATT_SVC_DB *p_db, void *p_attr);
116 static tGATT_STATUS gatts_check_attr_readability(tGATT_ATTR16 *p_attr,
123 tGATT_PERM perm = p_attr->permission;
166 switch (p_attr->uuid)
193 ** Parameter p_attr: pointer to the attribute to read.
205 static tGATT_STATUS read_attr_value (void *p_attr,
218 tGATT_ATTR16 *p_attr16 = (tGATT_ATTR16 *)p_attr;
227 status = gatts_check_attr_readability((tGATT_ATTR16 *)p_attr, offset, read_long, sec_flag, key_size);
340 tGATT_ATTR16 *p_attr;
350 p_attr = (tGATT_ATTR16 *)p_db->p_attr_list;
352 while (p_attr && p_attr->handle <= e_handle)
354 if (p_attr->uuid_type == GATT_ATTR_UUID_TYPE_16)
357 attr_uuid.uu.uuid16 = p_attr->uuid;
359 else if (p_attr->uuid_type == GATT_ATTR_UUID_TYPE_32)
362 attr_uuid.uu.uuid32 = ((tGATT_ATTR32 *)p_attr)->uuid;
367 memcpy(attr_uuid.uu.uuid128, ((tGATT_ATTR128 *)p_attr)->uuid, LEN_UUID_128);
370 if (p_attr->handle >= s_handle && gatt_uuid_compare(type, attr_uuid))
378 UINT16_TO_STREAM (p, p_attr->handle);
380 status = read_attr_value ((void *)p_attr, 0, &p, FALSE, (UINT16)(*p_len -2), &len, sec_flag, key_size);
384 status = gatts_send_app_read_request(p_tcb, op_code, p_attr->handle, 0, trans_id);
408 *p_cur_handle = p_attr->handle;
412 p_attr = (tGATT_ATTR16 *)p_attr->p_next;
454 tGATT_ATTR16 *p_attr;
466 if ((p_attr = (tGATT_ATTR16 *) allocate_attr_in_db(p_db, &uuid, GATT_PERM_READ)) != NULL)
468 if (copy_extra_byte_in_db(p_db, (void **)&p_attr->p_value, sizeof(tGATT_INCL_SRVC)))
470 p_attr->p_value->incl_handle.s_handle = s_handle;
471 p_attr->p_value->incl_handle.e_handle = e_handle;
472 memcpy(&p_attr->p_value->incl_handle.service_type, &service, sizeof(tBT_UUID));
474 return p_attr->handle;
478 deallocate_attr_in_db(p_db, p_attr);
649 tGATT_ATTR16 *p_attr;
654 p_attr = (tGATT_ATTR16 *)p_db->p_attr_list;
656 while (p_attr && handle >= p_attr->handle)
658 if (p_attr->handle == handle)
660 status = read_attr_value (p_attr, offset, &pp,
666 status = gatts_send_app_read_request(p_tcb, op_code, p_attr->handle, offset, trans_id);
670 p_attr = (tGATT_ATTR16 *)p_attr->p_next;
703 tGATT_ATTR16 *p_attr;
707 p_attr = (tGATT_ATTR16 *)p_db->p_attr_list;
709 while (p_attr && handle >= p_attr->handle)
711 if (p_attr->handle == handle)
713 status = gatts_check_attr_readability (p_attr, 0,
718 p_attr = (tGATT_ATTR16 *) p_attr->p_next;
747 tGATT_ATTR16 *p_attr;
757 p_attr = (tGATT_ATTR16 *) p_db->p_attr_list;
759 while (p_attr != NULL)
761 if (p_attr->handle == handle)
763 perm = p_attr->permission;
769 GATT_TRACE_DEBUG( "gatts_write_attr_perm_check p_attr->permission =0x%04x min_key_size==0x%04x",
770 p_attr->permission,
838 if(p_attr->uuid_type == GATT_ATTR_UUID_TYPE_16)
840 switch (p_attr->uuid)
861 else if (p_attr->uuid_type == GATT_ATTR_UUID_TYPE_128 ||
862 p_attr->uuid_type == GATT_ATTR_UUID_TYPE_32)
877 else if ( (p_attr->uuid_type == GATT_ATTR_UUID_TYPE_16) &&
878 (p_attr->uuid == GATT_UUID_CHAR_CLIENT_CONFIG ||
879 p_attr->uuid == GATT_UUID_CHAR_SRVR_CONFIG) )
901 p_attr = (tGATT_ATTR16 *)p_attr->p_next;
1025 ** p_attr: pointer to the attribute record to be freed.
1030 static BOOLEAN deallocate_attr_in_db(tGATT_SVC_DB *p_db, void *p_attr)
1044 if (p_next == p_attr)
1050 if (p_cur == p_attr && p_cur == p_db->p_attr_list)
1189 tGATT_ATTR16 *p_attr;
1201 if ((p_attr = (tGATT_ATTR16 *)(allocate_attr_in_db(p_db, &uuid, GATT_PERM_READ))) != NULL)
1203 if (copy_extra_byte_in_db (p_db, (void **)&p_attr->p_value, sizeof(tBT_UUID)))
1207 p_attr->p_value->uuid.len = LEN_UUID_16;
1208 p_attr->p_value->uuid.uu.uuid16 = p_service->uu.uuid16;
1212 p_attr->p_value->uuid.len = LEN_UUID_128;
1213 gatt_convert_uuid32_to_uuid128(p_attr->p_value->uuid.uu.uuid128, p_service->uu.uuid32);
1217 p_attr->p_value->uuid.len = LEN_UUID_128;
1218 memcpy(p_attr->p_value->uuid.uu.uuid128, p_service->uu.uuid128, LEN_UUID_128);