diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2020-03-30 19:22:47 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2020-03-30 19:22:47 +0700 |
commit | 930d7240bf1ead9a7759bc98713c2ef75a1d3ef3 (patch) | |
tree | 6e20326f3735f31fa0e88ebdc05790c90a31db3f /src/target/trx_toolkit | |
parent | b1f0772002d9450a5ff96b14551db813bb3ca94a (diff) |
trx_toolkit/trx_sniff.py: add options to filter bursts by RSSI
Change-Id: I16dd29d2f1e14e634029195599fa49a9be9219ab
Diffstat (limited to 'src/target/trx_toolkit')
-rwxr-xr-x | src/target/trx_toolkit/trx_sniff.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/target/trx_toolkit/trx_sniff.py b/src/target/trx_toolkit/trx_sniff.py index 1417664a..0cb62d36 100755 --- a/src/target/trx_toolkit/trx_sniff.py +++ b/src/target/trx_toolkit/trx_sniff.py @@ -164,6 +164,14 @@ class Application(ApplicationBase): if not self.argv.pf_nope_ind and msg.nope_ind: return False + # RSSI filter + if self.argv.pf_rssi_min is not None: + if msg.rssi < self.argv.pf_rssi_min: + return False + if self.argv.pf_rssi_max is not None: + if msg.rssi > self.argv.pf_rssi_max: + return False + # Burst passed ;) return True @@ -267,6 +275,12 @@ class Application(ApplicationBase): pf_group.add_argument("--no-nope-ind", dest = "pf_nope_ind", action = "store_false", help = "Ignore NOPE.ind (NOPE / IDLE indications)") + pf_group.add_argument("--rssi-min", metavar = "RSSI", + dest = "pf_rssi_min", type = int, + help = "Minimum RSSI value (e.g. -75)") + pf_group.add_argument("--rssi-max", metavar = "RSSI", + dest = "pf_rssi_max", type = int, + help = "Maximum RSSI value (e.g. -50)") return parser.parse_args() |