summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2014-09-22 13:36:55 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2014-09-22 13:36:55 +0300
commitd4b17ab3156f53fc4f9346c822ed7a1c02f3ebdb (patch)
tree3325f8366d56b9abe7ea47d7f68122d171ac5485
parent92f837078fcf29399a8bd639a3a8ff7a30df6414 (diff)
Support filtering on multiple addresses
If the -a argument is specified multiple time each address will generate a match when filtering URBs. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xusbmon.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/usbmon.py b/usbmon.py
index 23d694b..0bbab3f 100755
--- a/usbmon.py
+++ b/usbmon.py
@@ -694,7 +694,7 @@ def main(argv):
opts = getopt.getopt(argv[1:], 'a:c:C:d:e:f:ho:')
outf = sys.stdout
- addr = -1
+ addr = []
devclass = 'std'
endp = -1
capture = None
@@ -703,7 +703,7 @@ def main(argv):
for opt in opts[0]:
if opt[0] == '-a':
- addr = int(opt[1])
+ addr.append(int(opt[1], 0))
elif opt[0] == '-c':
capture = [int(v) for v in opt[1].split('-')]
elif opt[0] == '-C':
@@ -739,7 +739,7 @@ def main(argv):
raise
index += 1
- if addr != -1 and urb.addr != addr:
+ if urb.addr not in addr:
continue
if endp != -1 and urb.endp != endp:
continue