Add TXRSSI and TXLQI sensors to FrSky D8/D16/LBT when using MULTI (#7128)
[opentx.git] / radio / util / bin2lbm.py
blobcaba6e3da4e531386eb9aef5f266923cdc07d509
1 #!/usr/bin/env python
3 from __future__ import division
4 import sys
6 filename = sys.argv[1]
7 fileout = sys.argv[2]
9 # Read entire file
10 with open(filename, "rb") as fr:
11 sts = fr.read()
13 # Parse into chunks of 16 bytes
14 sts = [sts[i:i+16] for i in range(0, len(sts), 16)]
16 with open(fileout, "w") as fw:
17 for st in sts:
18 for b in st:
19 fw.write("0x%02x," % (ord(b) if isinstance(b, str) else b))
20 fw.write("\n")
21 fw.write("\n")