Home | History | Annotate | Download | only in lib

Lines Matching refs:uuid

225 static char *string_lookup_uuid(struct tupla *pt0, const uuid_t* uuid)
229 memcpy(&tmp_uuid, uuid, sizeof(tmp_uuid));
244 * Prints into a string the Protocol UUID
247 static int uuid2str(struct tupla *message, const uuid_t *uuid, char *str, size_t n)
251 if (!uuid) {
256 switch (uuid->type) {
258 str2 = string_lookup(message, uuid->value.uuid16);
262 str2 = string_lookup(message, uuid->value.uuid32);
266 str2 = string_lookup_uuid(message, uuid);
270 snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type);
277 int sdp_proto_uuid2strn(const uuid_t *uuid, char *str, size_t n)
279 return uuid2str(Protocol, uuid, str, n);
282 int sdp_svclass_uuid2strn(const uuid_t *uuid, char *str, size_t n)
284 return uuid2str(ServiceClass, uuid, str, n);
287 int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n)
289 return uuid2str(Profile, uuid, str, n);
293 * convert the UUID to string, copying a maximum of n characters.
295 int sdp_uuid2strn(const uuid_t *uuid, char *str, size_t n)
297 if (!uuid) {
301 switch (uuid->type) {
303 snprintf(str, n, "%.4x", uuid->value.uuid16);
306 snprintf(str, n, "%.8x", uuid->value.uuid32);
316 memcpy(&data0, &uuid->value.uuid128.data[0], 4);
317 memcpy(&data1, &uuid->value.uuid128.data[4], 2);
318 memcpy(&data2, &uuid->value.uuid128.data[6], 2);
319 memcpy(&data3, &uuid->value.uuid128.data[8], 2);
320 memcpy(&data4, &uuid->value.uuid128.data[10], 4);
321 memcpy(&data5, &uuid->value.uuid128.data[14], 2);
330 snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type);
331 return -1; /* Enum type of UUID not set */
338 * Function prints the UUID in hex as per defined syntax -
346 void sdp_uuid_print(const uuid_t *uuid)
348 if (uuid == NULL) {
349 SDPERR("Null passed to print UUID\n");
352 if (uuid->type == SDP_UUID16) {
353 SDPDBG(" uint16_t : 0x%.4x\n", uuid->value.uuid16);
354 } else if (uuid->type == SDP_UUID32) {
355 SDPDBG(" uint32_t : 0x%.8x\n", uuid->value.uuid32);
356 } else if (uuid->type == SDP_UUID128) {
364 memcpy(&data0, &uuid->value.uuid128.data[0], 4);
365 memcpy(&data1, &uuid->value.uuid128.data[4], 2);
366 memcpy(&data2, &uuid->value.uuid128.data[6], 2);
367 memcpy(&data3, &uuid->value.uuid128.data[8], 2);
368 memcpy(&data4, &uuid->value.uuid128.data[10], 4);
369 memcpy(&data5, &uuid->value.uuid128.data[14], 2);
378 SDPERR("Enum type of UUID not set\n");
440 sdp_uuid16_create(&d->val.uuid, bt_get_unaligned((uint16_t *) value));
444 sdp_uuid32_create(&d->val.uuid, bt_get_unaligned((uint32_t *) value));
448 sdp_uuid128_create(&d->val.uuid, value);
595 static void extract_svclass_uuid(sdp_data_t *data, uuid_t *uuid)
609 *uuid = d->val.uuid;
915 u16 = htons(d->val.uuid.value.uuid16);
919 u32 = htonl(d->val.uuid.value.uuid32);
923 src = (unsigned char *) &d->val.uuid.value.uuid128;
1026 int sdp_uuid_extract(const uint8_t *p, int bufsize, uuid_t *uuid, int *scanned)
1038 SDPERR("Unknown data type : %d expecting a svc UUID\n", type);
1046 SDPERR("Not enough room for 16-bit UUID");
1049 sdp_uuid16_create(uuid, ntohs(bt_get_unaligned((uint16_t *) p)));
1054 SDPERR("Not enough room for 32-bit UUID");
1057 sdp_uuid32_create(uuid, ntohl(bt_get_unaligned((uint32_t *) p)));
1062 SDPERR("Not enough room for 128-bit UUID");
1065 sdp_uuid128_create(uuid, p);
1156 SDPDBG("Extracting UUID");
1158 if (sdp_uuid_extract(p, bufsize, &d->val.uuid, len) < 0) {
1164 sdp_pattern_add_uuid(rec, &d->val.uuid);
1492 uuid_t *uuid = value;
1495 sdp_pattern_add_uuid(rec, uuid);
1537 val = &data->val.uuid.value.uuid16;
1540 val = &data->val.uuid.value.uuid32;
1543 val = &data->val.uuid.value.uuid128;
1669 SDPDBG("UUID\n");
1670 sdp_uuid_print(&d->val.uuid);
1848 if (SDP_IS_UUID(seq->dtd) && sdp_uuid_to_proto(&seq->val.uuid) == proto) {
1886 sdp_uuid_to_proto(&seq->val.uuid) == proto)
1954 *u = d->val.uuid;
1980 uuid_t *uuid = (uuid_t *)p->data;
1981 if (uuid)
1982 switch (uuid->type) {
1985 values[i] = &uuid->value.uuid16;
1989 values[i] = &uuid->value.uuid32;
1993 values[i] = &uuid->value.uuid128;
2057 uuid_t *uuid = NULL;
2061 uuid = &seq->val.uuid;
2066 uuid = &puuid->val.uuid;
2071 if (uuid != NULL) {
2073 profDesc->uuid = *uuid;
2076 sdp_uuid_print(&profDesc->uuid);
2145 int sdp_get_service_id(const sdp_record_t *rec, uuid_t *uuid)
2147 get_basic_attr(SDP_ATTR_SERVICE_ID, uuid, uuid);
2150 int sdp_get_group_id(const sdp_record_t *rec, uuid_t *uuid)
2152 get_basic_attr(SDP_ATTR_GROUP_ID, uuid, uuid);
2239 uuid_t *uuid = NULL;
2246 uuid = (uuid_t *) d;
2247 values[pslen] = &uuid->value.uuid16;
2250 uuid = (uuid_t *) d;
2251 values[pslen] = &uuid->value.uuid32;
2254 uuid = (uuid_t *) d;
2255 values[pslen] = &uuid->value.uuid128;
2275 if (uuid)
2276 sdp_pattern_add_uuid(rec, uuid);
2386 * This is the UUID of the service.
2390 void sdp_set_service_id(sdp_record_t *rec, uuid_t uuid)
2392 switch (uuid.type) {
2395 &uuid.value.uuid16);
2399 &uuid.value.uuid32);
2403 &uuid.value.uuid128);
2406 sdp_pattern_add_uuid(rec, &uuid);
2412 * This is the UUID of the group.
2416 void sdp_set_group_id(sdp_record_t *rec, uuid_t uuid)
2418 switch (uuid.type) {
2421 &uuid.value.uuid16);
2425 &uuid.value.uuid32);
2429 &uuid.value.uuid128);
2432 sdp_pattern_add_uuid(rec, &uuid);
2471 switch (profile->uuid.type) {
2474 values[0] = &profile->uuid.value.uuid16;
2478 values[0] = &profile->uuid.value.uuid32;
2482 values[0] = &profile->uuid.value.uuid128;
2494 sdp_pattern_add_uuid(rec, &profile->uuid);
2556 * UUID comparison function
2567 * UUID comparison function
2578 * 128 to 16 bit and 32 to 16 bit UUID conversion functions
2590 /* allocate a 128bit UUID and init to the Bluetooth base UUID */
2594 /* extract bytes 2 and 3 of 128bit BT base UUID */
2597 /* add the given UUID (16 bits) */
2612 /* allocate a 128bit UUID and init to the Bluetooth base UUID */
2619 /* add the given UUID (32bits) */
2626 uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid)
2630 switch (uuid->type) {
2632 *uuid128 = *uuid;
2635 sdp_uuid32_to_uuid128(uuid128, uuid);
2638 sdp_uuid16_to_uuid128(uuid128, uuid);
2645 * converts a 128-bit uuid to a 16/32-bit one if possible
2646 * returns true if uuid contains a 16/32-bit UUID at exit
2648 int sdp_uuid128_to_uuid(uuid_t *uuid)
2651 uint128_t *u = &uuid->value.uuid128;
2655 if (uuid->type != SDP_UUID128)
2665 uuid->type = SDP_UUID16;
2666 uuid->value.uuid16 = (uint16_t) data;
2668 uuid->type = SDP_UUID32;
2669 uuid->value.uuid32 = data;
2675 * convert a UUID to the 16-bit short-form
2677 int sdp_uuid_to_proto(uuid_t *uuid)
2679 uuid_t u = *uuid;
3088 void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid)
3090 uuid_t *uuid128 = sdp_uuid_to_uuid128(uuid);
3107 uuid_t *uuid = (uuid_t *)seq->data;
3108 sdp_pattern_add_uuid(rec, uuid);
3209 uuid_t *uuid = (uuid_t *) seq->data;
3210 return gen_dataseq_pdu(dst, seq, uuid->type);
3246 * pattern. Each entry in the list is a UUID (DataTypeSDP_UUID16)
3671 * pattern. Each entry in the list is a UUID (DataTypeSDP_UUID16)
3881 * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16)
4222 * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16)