From 19c3a0efc9ec55a41f8ae5abd2f961c84d248774 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Mon, 9 Apr 2012 10:24:43 -0400 Subject: [PATCH] print RX: 0 when channel selection finishes test that all matches are made before using them. --- tools/rftestrx2pcap.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/rftestrx2pcap.py b/tools/rftestrx2pcap.py index 88ca5d686..83929b3db 100755 --- a/tools/rftestrx2pcap.py +++ b/tools/rftestrx2pcap.py @@ -40,12 +40,14 @@ while chan != int(sys.argv[2]) - 11: while 1: chanstr += os.read(serport, 1) m = re.match(".*channel: (\w+)\s+", chanstr) - if m != None: + if m is not None: chan = int(m.group(1)) break os.close(serport) +sys.stderr.write("RX: 0") + try: serport = open(sys.argv[1], 'r+') except IOError: @@ -75,7 +77,7 @@ try: m_rftestline = re.match(".*rftest-rx --- len 0x(\w\w).*", line) - if m_rftestline != None: + if m_rftestline is not None: newpacket = 1 t = time.time() sec = int(t) @@ -102,7 +104,8 @@ try: for d in line.split(' '): # do a match because their might be a \r floating around m = re.match('.*(\w\w).*', d) - sys.stdout.write(pack('