diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-04-07 13:43:23 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2005-04-07 13:43:23 +0000 |
commit | 9f02be3e3b3d9af1e11e158c6cf386228e12d41f (patch) | |
tree | 89b690003245b202598aacefa6ed15a0ceb087c5 /tools | |
parent | 7271d875a003eab4af74e0304b2902c36fe86996 (diff) |
Add support to browse various UUIDs
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sdptool.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/sdptool.c b/tools/sdptool.c index 980778ea..d3da429d 100644 --- a/tools/sdptool.c +++ b/tools/sdptool.c @@ -2094,15 +2094,16 @@ static int do_search(bdaddr_t *bdaddr, struct search_context *context) } static struct option browse_options[] = { - { "help", 0,0, 'h' }, - { "tree", 0,0, 't' }, - { "l2cap", 0,0, 'l' }, + { "help", 0, 0, 'h' }, + { "tree", 0, 0, 't' }, + { "uuid", 1, 0, 'u' }, + { "l2cap", 0, 0, 'l' }, { 0, 0, 0, 0 } }; static char *browse_help = "Usage:\n" - "\tbrowse [--tree] [--l2cap] [bdaddr]\n"; + "\tbrowse [--tree] [--uuid uuid] [--l2cap] [bdaddr]\n"; /* * Browse the full SDP database (i.e. list all services starting from the @@ -2111,7 +2112,7 @@ static char *browse_help = static int cmd_browse(int argc, char **argv) { struct search_context context; - int opt; + int opt, num; /* Initialise context */ memset(&context, '\0', sizeof(struct search_context)); @@ -2123,6 +2124,13 @@ static int cmd_browse(int argc, char **argv) case 't': context.tree = 1; break; + case 'u': + if (sscanf(optarg, "%i", &num) != 1 || num < 0 || num > 0xffff) { + printf("Invalid uuid %s\n", optarg); + return -1; + } + sdp_uuid16_create(&context.group, num); + break; case 'l': sdp_uuid16_create(&context.group, L2CAP_UUID); break; |