From ef3649fd9e62bd989ff67a125a05c962d5640fd3 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 23 Mar 2007 21:04:08 +0000 Subject: network: using service class identifier instead of the uuid 128 string for server registration --- network/common.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'network/common.c') diff --git a/network/common.c b/network/common.c index 7fbfee91..ec10cc34 100644 --- a/network/common.c +++ b/network/common.c @@ -60,9 +60,9 @@ static struct { const char *uuid128; /* UUID 128 */ uint16_t id; /* Service class identifier */ } __svc[] = { - { "PANU", PANU_UUID, BNEP_SVC_PANU }, - { "GN", GN_UUID, BNEP_SVC_GN }, - { "NAP", NAP_UUID, BNEP_SVC_NAP }, + { "panu", PANU_UUID, BNEP_SVC_PANU }, + { "gn", GN_UUID, BNEP_SVC_GN }, + { "nap", NAP_UUID, BNEP_SVC_NAP }, { NULL } }; @@ -101,6 +101,16 @@ const char *bnep_uuid(uint16_t id) return NULL; } +const char *bnep_name(uint16_t id) +{ + int i; + + for (i = 0; __svc[i].name; i++) + if (__svc[i].id == id) + return __svc[i].name; + return NULL; +} + int bnep_init(void) { ctl = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_BNEP); -- cgit