summaryrefslogtreecommitdiff
path: root/serial
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-11-06 17:13:03 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-11-06 17:13:03 +0200
commit0cd6d963d0fed972434f6d0cec0448c99bee87cb (patch)
treebfeef878669fdb692742bc7970d1e148bda83bd0 /serial
parent7fc0e09665e52a798dd455306278da54f7dbd1b7 (diff)
downloadbluez-0cd6d963d0fed972434f6d0cec0448c99bee87cb.tar.gz
Use bt_string2class instead of bt_string2uuid to avoid unecessary conversion
Diffstat (limited to 'serial')
-rw-r--r--serial/port.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/serial/port.c b/serial/port.c
index c36e84d1b..c4fa644c3 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -40,6 +40,7 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
#include <glib.h>
#include <gdbus.h>
@@ -101,6 +102,7 @@ static struct serial_port *find_port(GSList *ports, const char *pattern)
for (l = ports; l != NULL; l = l->next) {
struct serial_port *port = l->data;
uuid_t uuid;
+ uint16_t uuid16;
char *uuid_str;
int ret;
@@ -114,9 +116,12 @@ static struct serial_port *find_port(GSList *ports, const char *pattern)
* UUID-128 string and compares it with the port UUID (which is
* also stored as a UUID-128 string */
- if (bt_string2uuid(&uuid, pattern) < 0)
+ uuid16 = bt_string2class(pattern);
+ if (!uuid16)
continue;
+ sdp_uuid16_create(&uuid, uuid16);
+
uuid_str = bt_uuid2string(&uuid);
if (!uuid_str)
continue;