Skip to contentSkip to conversation

sdptool/hciconfig patches

Bluez-devel Denis KENZIOR 2 participants 3 messages Feb 15, 2006 – Feb 20, 2006 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

- Fix a small bug in hciconfig which prevents it from displaying the correct category of  Peripheral or Imaging or Uncategorized device class devices (reports as invalid)
- Capability for sdptool to perform searches by 16/32/128 bit uuids

-Denis

Index: include/sdp_lib.h
===================================================================
RCS file: /cvsroot/bluez/libs/include/sdp_lib.h,v
retrieving revision 1.14

sdp_lib.h +2 -0
diff -u -r1.14 sdp_lib.h
@@ -442,6 +442,8 @@
 int sdp_svclass_uuid2strn(const uuid_t *uuid, char *str, size_t n);
 int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n);
 
+int sdp_extract_uuid_from_string(uint128_t *dst, const char *str);
+
 /*
  * In all the sdp_get_XXX(handle, XXX *xxx) functions below, 
  * the XXX * is set to point to the value, should it exist

Index: src/sdp.c
===================================================================
RCS file: /cvsroot/bluez/libs/src/sdp.c,v
retrieving revision 1.37

sdp.c +87 -66

170 lines not on this page · raw message

Index: tools/hciconfig.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/hciconfig.c,v retrieving revision 1.76

hciconfig.c +1 -1
diff -u -r1.76 hciconfig.c
@@ -676,7 +676,7 @@
 		} else
 			printf("Unspecified");
 		printf("\n\tDevice Class: ");
-		if ((cls[1] & 0x1f) > sizeof(*major_devices))
+		if ((cls[1] & 0x1f) >= sizeof(major_devices) / sizeof(*major_devices))
 			printf("Invalid Device Class!\n");
 		else
 			printf("%s, %s\n", major_devices[cls[1] & 0x1f],

Index: tools/sdptool.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/sdptool.c,v
retrieving revision 1.54

sdptool.c +8 -1
diff -u -r1.54 sdptool.c
@@ -989,7 +989,10 @@
 
 	sdp_uuid2strn(uuid, UUID_str, MAX_LEN_UUID_STR);
 	sdp_svclass_uuid2strn(uuid, ServiceClassUUID_str, MAX_LEN_SERVICECLASS_UUID_STR);
-	printf("  \"%s\" (0x%s)\n", ServiceClassUUID_str, UUID_str);
+        if (uuid->type != SDP_UUID128)
+		printf("  \"%s\" (0x%s)\n", ServiceClassUUID_str, UUID_str);
+	else
+		printf("  UUID 128: %s\n", UUID_str);
 }
 
 static void print_service_desc(void *value, void *user)
@@ -3485,6 +3488,7 @@
 {
 	struct search_context context;
 	unsigned char *uuid = NULL;
+        uint128_t uuid128;
 	uint32_t class = 0;
 	bdaddr_t bdaddr;
 	int has_addr = 0;
@@ -3529,6 +3533,9 @@
 		sscanf(context.svc + 2, "%X", &num);
 		class = num;
 		printf("Class 0x%X\n", class);
+	}
+	else if (sdp_extract_uuid_from_string(&uuid128, context.svc) == 0) {
+		uuid = uuid128.data;
 	} else {
 		/* Convert class name to an UUID */
 
maintainer
#1 lore raw

Hi Denis,

Quoted 4 lines

- Fix a small bug in hciconfig which prevents it from displaying the correct category of Peripheral or Imaging or Uncategorized device class devices (reports as invalid)
- Capability for sdptool to perform searches by 16/32/128 bit uuids

I picked the hciconfig and the first hunk for sdptool. Please redo the other changes and resend them. And we use tabs instead of whitespaces.

Regards

Marcel

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw
In reply to Denis KENZIOR

Marcel,

Sorry about that, I tried using tabs, but a couple slipped through. Try these?

-Denis

Quoted 3 lines

Hi Denis,

Quoted 1 line

- Fix a small bug in hciconfig which prevents it from displaying the

correct

Quoted 10 lines
Quoted 3 lines

category of Peripheral or Imaging or Uncategorized device class devices (reports as invalid)
- Capability for sdptool to perform searches by 16/32/128 bit uuids

I picked the hciconfig and the first hunk for sdptool. Please redo the other changes and resend them. And we use tabs instead of whitespaces.

Regards

Marcel

Index: include/sdp_lib.h
===================================================================
RCS file: /cvsroot/bluez/libs/include/sdp_lib.h,v
retrieving revision 1.14

sdp_lib.h +2 -0
diff -u -r1.14 sdp_lib.h
@@ -442,6 +442,8 @@
 int sdp_svclass_uuid2strn(const uuid_t *uuid, char *str, size_t n);
 int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n);
 
+int sdp_extract_uuid_from_string(uint128_t *dst, const char *str);
+
 /*
  * In all the sdp_get_XXX(handle, XXX *xxx) functions below, 
  * the XXX * is set to point to the value, should it exist

Index: src/sdp.c
===================================================================
RCS file: /cvsroot/bluez/libs/src/sdp.c,v
retrieving revision 1.37

sdp.c +87 -66

170 lines not on this page · raw message

Index: tools/sdptool.c
===================================================================
RCS file: /cvsroot/bluez/utils/tools/sdptool.c,v
retrieving revision 1.55

sdptool.c +5 -0
diff -u -r1.55 sdptool.c
@@ -989,6 +989,7 @@
 
 	sdp_uuid2strn(uuid, UUID_str, MAX_LEN_UUID_STR);
 	sdp_svclass_uuid2strn(uuid, ServiceClassUUID_str, MAX_LEN_SERVICECLASS_UUID_STR);
+
 	if (uuid->type != SDP_UUID128)
 		printf("  \"%s\" (0x%s)\n", ServiceClassUUID_str, UUID_str);
 	else
@@ -3488,6 +3489,7 @@
 {
 	struct search_context context;
 	unsigned char *uuid = NULL;
+	uint128_t uuid128;
 	uint32_t class = 0;
 	bdaddr_t bdaddr;
 	int has_addr = 0;
@@ -3532,6 +3534,9 @@
 		sscanf(context.svc + 2, "%X", &num);
 		class = num;
 		printf("Class 0x%X\n", class);
+	}
+	else if (sdp_extract_uuid_from_string(&uuid128, context.svc) == 0) {
+		uuid = uuid128.data;
 	} else {
 		/* Convert class name to an UUID */