Skip to content

Commit a421fe9

Browse files
committed
tools: tdf_list: packet RSSI filtering
Add the option to filter TDFs by packet RSSI. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent e7e072e commit a421fe9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/infuse_iot/tools/tdf_list.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ def add_parser(cls, parser):
3333
parser.add_argument(
3434
"--id", type=lambda x: int(x, 0), action="append", default=[], help="Limit displayed TDFs by device ID"
3535
)
36+
parser.add_argument("--min-rssi", type=int, help="Minimum RSSI to display TDF")
3637

3738
def __init__(self, args):
3839
self._client = LocalClient(default_multicast_address(), 1.0)
3940
self._decoder = TDF()
4041
self._array_all = args.array_all
4142
self._ids = args.id
43+
self._min_rssi = args.min_rssi
4244

4345
def append_tdf(
4446
self,
@@ -117,6 +119,8 @@ def run(self) -> None:
117119

118120
if len(self._ids) > 0 and source.infuse_id not in self._ids:
119121
continue
122+
if self._min_rssi is not None and source.rssi < self._min_rssi:
123+
continue
120124

121125
table: list[tuple[str | None, str | None, str, str, str]] = []
122126

0 commit comments

Comments
 (0)