summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2020-03-30 19:22:47 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2020-03-30 19:22:47 +0700
commit930d7240bf1ead9a7759bc98713c2ef75a1d3ef3 (patch)
tree6e20326f3735f31fa0e88ebdc05790c90a31db3f
parentb1f0772002d9450a5ff96b14551db813bb3ca94a (diff)
trx_toolkit/trx_sniff.py: add options to filter bursts by RSSI
-rwxr-xr-xsrc/target/trx_toolkit/trx_sniff.py14
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()