diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-03-23 21:04:08 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-03-23 21:04:08 +0000 |
commit | ef3649fd9e62bd989ff67a125a05c962d5640fd3 (patch) | |
tree | f8ec45b3ad8422908f9c1990fb65eec6287d4b98 /network/common.c | |
parent | 696c7534eca66f0dd64de6aba2ab26e8a4b66eea (diff) |
network: using service class identifier instead of the uuid 128 string for server registration
Diffstat (limited to 'network/common.c')
-rw-r--r-- | network/common.c | 16 |
1 files changed, 13 insertions, 3 deletions
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); |