If something is stupid but it works, it's not stupid
Simple utility to run key presses, AT commands & wait for response form phone scriptable in python. Great for repetitive tasks as i.e. phone unlock, or UI tests with multiple key presses.
run:
python3
from harness.common import conn
# for key press: 0 - 9, second parameter = wait time after key press, here set to '1'
conn.key(0, 1)
# ...
conn.key(9, 1)
# send AT command - '\r' is important - othervise modem will ignore command
conn.gsm("AT?\r")
# wait for some data
data = conn.read(4)
Frame:
<STX>
{
Type : harness::Enum::Events
Data : [ <element for selected data type>, ]
}
<ETX>
<STX> abd <ETX> is JsonI considered protobuf, tlv and msgpack, protobuf ain't very easy when you want to have Any types inside, msgpack don't have schema. Json is super easy - json it is
test/*.py - test code for handling phone
arrow keys for ~30 min