summaryrefslogtreecommitdiffstats
path: root/tools/sdptool.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-12-10 09:06:36 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-12-10 09:06:36 +0000
commit19812023eacc4a912db4adb92c040a02a50cdff7 (patch)
tree9bc8cb6dae0ae895c14568f842f7ca87930f2665 /tools/sdptool.c
parentf90e45fa8fb3edc954ccb9e537d2d8082a3d8070 (diff)
Also translate UUID-32 to string
Diffstat (limited to 'tools/sdptool.c')
-rw-r--r--tools/sdptool.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/tools/sdptool.c b/tools/sdptool.c
index 6ceb0bd9..cfbe2bba 100644
--- a/tools/sdptool.c
+++ b/tools/sdptool.c
@@ -318,8 +318,8 @@ static void sdp_uuid_printf(uuid_t *uuid, struct attrib_context *context, int in
struct uuid_def *uuidDef = NULL;
int i;
- for(i = 0; i < uuid16_max; i++)
- if(uuid16_names[i].num == uuidNum) {
+ for (i = 0; i < uuid16_max; i++)
+ if (uuid16_names[i].num == uuidNum) {
uuidDef = &uuid16_names[i];
break;
}
@@ -330,15 +330,31 @@ static void sdp_uuid_printf(uuid_t *uuid, struct attrib_context *context, int in
context->service = uuidDef;
}
- if(uuidDef)
+ if (uuidDef)
printf("%.*sUUID16 : 0x%.4x - %s\n",
indent, indent_spaces, uuidNum, uuidDef->name);
else
printf("%.*sUUID16 : 0x%.4x\n",
indent, indent_spaces, uuidNum);
} else if (uuid->type == SDP_UUID32) {
- printf("%.*sUUID32 : 0x%.8x\n",
- indent, indent_spaces, uuid->value.uuid32);
+ struct uuid_def *uuidDef = NULL;
+ int i;
+
+ if (!(uuid->value.uuid32 & 0xffff0000)) {
+ uint16_t uuidNum = uuid->value.uuid32;
+ for (i = 0; i < uuid16_max; i++)
+ if (uuid16_names[i].num == uuidNum) {
+ uuidDef = &uuid16_names[i];
+ break;
+ }
+ }
+
+ if (uuidDef)
+ printf("%.*sUUID32 : 0x%.8x - %s\n",
+ indent, indent_spaces, uuid->value.uuid32, uuidDef->name);
+ else
+ printf("%.*sUUID32 : 0x%.8x\n",
+ indent, indent_spaces, uuid->value.uuid32);
} else if (uuid->type == SDP_UUID128) {
unsigned int data0;
unsigned short data1;