From 0cd6d963d0fed972434f6d0cec0448c99bee87cb Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 6 Nov 2008 17:13:03 +0200 Subject: Use bt_string2class instead of bt_string2uuid to avoid unecessary conversion --- serial/port.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'serial') diff --git a/serial/port.c b/serial/port.c index c36e84d1..c4fa644c 100644 --- a/serial/port.c +++ b/serial/port.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -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; -- cgit