mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
feat(vrx): add live Radxa wfb_rx and SoC thermal telemetry ($VRX) to relay, OSD, and GPUI
This commit is contained in:
1 parent
56f37d1320
commit
dfa142c2d1
8 files changed
+358
-9
No files matched your search
@@ -74,6 +74,25 @@ class TestRadxaG29Relay(unittest.TestCase):
|
||||
self.assertEqual(relay.extract_outbound_serial_lines(noisy, max_buf=4096), [])
|
||||
self.assertEqual(len(noisy), 512)
|
||||
|
||||
def test_wfb_json_parsing_and_vrx_formatting(self) -> None:
|
||||
sample = (
|
||||
'{"type":"rx","rx_ant_stats":{"0":[-52,-48,-46,120],"1":[-58,-54,-51,118]},'
|
||||
'"packets":{"fec_rec":[3,42],"lost":[1,5],"incoming_bytes":[800000,10000000]}}'
|
||||
)
|
||||
parsed = relay.parse_wfb_json_line(sample)
|
||||
self.assertIsNotNone(parsed)
|
||||
assert parsed is not None
|
||||
self.assertEqual(parsed["rssi_a"], -46)
|
||||
self.assertEqual(parsed["rssi_b"], -51)
|
||||
self.assertEqual(parsed["fec_rec"], 3)
|
||||
self.assertEqual(parsed["fec_lost"], 1)
|
||||
self.assertEqual(parsed["kbps"], 6400)
|
||||
self.assertEqual(
|
||||
relay.format_vrx_line(54.25, -46, -51, 3, 1, 6400),
|
||||
b"$VRX,54.2,-46,-51,3,1,6400\n",
|
||||
)
|
||||
self.assertIsNone(relay.parse_wfb_json_line("not json"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user