summaryrefslogtreecommitdiffstats
path: root/src/target/trx_toolkit/data_msg.py
AgeCommit message (Collapse)AuthorFilesLines
2018-12-18trx_toolkit/data_msg.py: add optional legacy message coding flagVadim Yanitskiy1-1/+14
Some transceivers (e.g. OsmoTRX) have inherited a rudiment from OpenBTS - two dummy bytes at the end of TRX2L1 messages. Despite they are absolutely useless, some L1 implementations, such as trxcon and OpenBTS, still do expect them when checking the message length. Let's add an optional (disabled by default) argument to gen_msg(), that would enable adding those two dummy bytes. Change-Id: I0cf1314c399411886420176704cadd6e6d84787f
2018-12-18trx_toolkit/data_msg.py: use struct API for fn and toa256 codingVadim Yanitskiy1-16/+4
The built-in struct module is already used for toa256 decoding, so let's use it for toa256 encoding, and TDMA frame number coding too - no need to (re)implement the wheel! Change-Id: I10d2e15ac57a0524e9bc1c80ed6a0f6f5a263436
2018-12-07trx_toolkit: use generic logging module instead of print()Vadim Yanitskiy1-11/+17
There are multiple advantages of using Python's logging module: - advanced message formatting (file name, line number, etc.), - multiple logging targets (e.g. stderr, file, socket), - logging levels (e.g. DEBUG, INFO, ERROR), - the pythonic way ;) so, let's replace multiple print() calls by logging calls, add use the following logging message format by default: [%(levelname)s] %(filename)s:%(lineno)d %(message)s Examples: [INFO] ctrl_if_bts.py:57 Starting transceiver... [DEBUG] clck_gen.py:87 IND CLOCK 26826 [DEBUG] ctrl_if_bts.py:71 Recv POWEROFF cmd [INFO] ctrl_if_bts.py:73 Stopping transceiver... [INFO] fake_trx.py:127 Shutting down... Please note that there is no way to filter messages by logging level yet. This is to be introduced soon, together with argparse. Change-Id: I7fcafabafe8323b58990997a47afdd48b6d1f357
2018-03-13Rename 'fake_trx' to 'trx_toolkit'Vadim Yanitskiy1-0/+545
This toolkit has branched out into several different tools for TRX interface hacking, and creating a virtual Um-interface (FakeTRX) is only one of its potential applications. Change-Id: I56bcbc76b9c273d6b469a2bb68ddc46f3980e835