From 8bca3fbd74e366a85d35ce997a548c4c8916f75c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 6 Jul 2005 14:25:31 +0000 Subject: [PATCH] hcidump: Allow selection of system device --- tools/hcidump.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/hcidump.c b/tools/hcidump.c index f42402859..b7f3e1031 100644 --- a/tools/hcidump.c +++ b/tools/hcidump.c @@ -190,8 +190,12 @@ static void process_frames(int dev, int sock, int fd, unsigned long flags) exit(1); } - printf("device: hci%d snap_len: %d filter: 0x%lx\n", - dev, snap_len, filter); + if (device == HCI_DEV_NONE) + printf("system: "); + else + printf("device: hci%d ", dev); + + printf("snap_len: %d filter: 0x%lx\n", snap_len, filter); memset(&msg, 0, sizeof(msg)); @@ -430,7 +434,7 @@ static int open_socket(int dev, unsigned long flags) struct hci_dev_info di; int sk, dd, opt; - if (permcheck) { + if (permcheck && dev != HCI_DEV_NONE) { dd = hci_open_dev(dev); if (dd < 0) { perror("Can't open device"); @@ -678,7 +682,10 @@ int main(int argc, char *argv[]) while ((opt=getopt_long(argc, argv, "i:l:p:m:w:r:s:n:taxXRC:H:O:BVZh", main_options, NULL)) != -1) { switch(opt) { case 'i': - device = atoi(optarg + 3); + if (strcasecmp(optarg, "none")) + device = atoi(optarg + 3); + else + device = HCI_DEV_NONE; break; case 'l': -- 2.47.3