public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Markus Becker <mab@comnets.uni-bremen.de>
Cc: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] [PATCH] bluez-libs UUID-128 support for Protocol	Descriptor List
Date: Thu, 24 Aug 2006 16:43:22 +0200	[thread overview]
Message-ID: <1156430602.4133.108.camel@aeonflux.holtmann.net> (raw)
In-Reply-To: <Pine.LNX.4.21.0608241231400.27134-200000@bugs.comnets.uni-bremen.de>

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

Hi Markus,

> > > I've created a patch for bluez-libs/src/sdp.c to support the finding of
> > > UUID128 encoded protocols. So that also kdebluetooth and others can
> > > recognize those protocols. It changes the display of the Protocol
> > > Descriptor List for example from:
> > > 
> > > Service Name: ATEmulator
> > > Service RecHandle: 0x10010
> > > Service Class ID List:
> > >   "Error: This is UUID-128" (0x7dd6b763-99a9-4a92-87b5-bc8efe565c37)
> > >   "Error: This is UUID-128" (0x00001101-0000-1000-8000-00805f9b34fb)
> > > Protocol Descriptor List:
> > >   "Error: " (0x00000100-0000-1000-8000-00805f9b34fb)
> > >   "Error: " (0x00000003-0000-1000-8000-00805f9b34fb)
> > >     Channel: 25
> > > 
> > > to:
> > > 
> > > Service Name: ATEmulator
> > > Service RecHandle: 0x10010
> > > Service Class ID List:
> > >   UUID 128: 7dd6b763-99a9-4a92-87b5-bc8efe565c37
> > >   UUID 128: 00001101-0000-1000-8000-00805f9b34fb
> > > Protocol Descriptor List:
> > >   "L2CAP" (0x00000100-0000-1000-8000-00805f9b34fb)
> > >   "RFCOMM" (0x00000003-0000-1000-8000-00805f9b34fb)
> > >     Channel: 25
> > > 
> > > Please consider it for integration into mainline bluez-libs.
> > 
> > the patch is wrong. Before you are doing a lookup against the short
> > UUIDs of Bluetooth you should check if the base UUID is the Bluetooth
> > base UUID. Otherwise you can't do the lookup.
> > 
> OK. I attached a patch that does the whole String_lookup differently and
> using sdp_uuid128_to_uuid for 128 bit UUIDs. Unfortunately I had to change
> the interface in sdp_lib.h because of "const" not being fulfilled by
> sdp_uuid128_to_uuid.
> 
> I hope this patch is more to your liking. If not, contact me.

your patch is a little bit too complex and the coding style is wrong and
changing the prototypes is not a good idea.

Please test the attached patch. This is how I would do it.

Regards

Marcel


[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 1081 bytes --]

Index: src/sdp.c
===================================================================
RCS file: /cvsroot/bluez/libs/src/sdp.c,v
retrieving revision 1.42
diff -u -r1.42 sdp.c
--- src/sdp.c	23 Aug 2006 15:05:30 -0000	1.42
+++ src/sdp.c	24 Aug 2006 12:40:53 -0000
@@ -208,6 +208,24 @@
 	return "";
 }
 
+static char *string_lookup_uuid(struct tupla *pt0, const uuid_t* uuid)
+{
+	uuid_t tmp_uuid;
+
+	memcpy(&tmp_uuid, uuid, sizeof(tmp_uuid));
+
+	if (sdp_uuid128_to_uuid(&tmp_uuid)) {
+		switch (tmp_uuid.type) {
+		case SDP_UUID16:
+			return string_lookup(pt0, tmp_uuid.value.uuid16);
+		case SDP_UUID32:
+			return string_lookup(pt0, tmp_uuid.value.uuid32);
+		}
+	}
+
+	return "";
+}
+
 /*
  * Prints into a string the Protocol UUID
  * coping a maximum of n characters.
@@ -231,8 +249,9 @@
 		snprintf(str, n, str2);
 		break;
 	case SDP_UUID128:
-		snprintf(str, n, "Error: This is UUID-128");
-		return -4;
+		str2 = string_lookup_uuid(message, uuid);
+		snprintf(str, n, str2);
+		break;
 	default:
 		snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type);
 		return -1;

[-- Attachment #3: Type: text/plain, Size: 373 bytes --]

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2006-08-24 14:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-21 12:28 [Bluez-devel] [PATCH] bluez-libs UUID-128 support for Protocol Descriptor List Markus Becker
2006-08-23 17:35 ` Marcel Holtmann
2006-08-24 10:35   ` Markus Becker
2006-08-24 14:43     ` Marcel Holtmann [this message]
2006-08-24 13:51       ` Markus Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1156430602.4133.108.camel@aeonflux.holtmann.net \
    --to=marcel@holtmann.org \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=mab@comnets.uni-bremen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox