No project description provided
Project description
Introduction
The main goal
This project access for the serial port and It is able to script control.
Installation
pip install macross-serial
For developers
git clone git@github.com:rondou/macross-serial.git
cd macross-serial
poetry install
Usage
Access for the serial port and run script.
macross-serial run [--repeat N] <port-name> <macro-file>
Show serail port name.
macross-serial list-port
Macro file format
<method> <content> [<timeout-second> [progress-message]]
Simple example
script.tsv
wait_for_str 'system started at UTC'
send 'account\n'
send 'password\n'
wait_for_regex r'\b(([0-9A-Fa-f]{2}:){5})\b'
send 'reboot\n'
Methods
send
Write data to serial port
E.g.
send 'poweroff\n'
wait_for_str
Waiting until for find out a specific string then continue to execute next step.
E.g.
wait_for_str 'system started at UTC'
wait_for_regex
Waiting until for find out a regular expression pattern then continue to execute next step.
E.g.
wait_for_regex r'\b(([0-9A-Fa-f]{2}:){5})\b'
wait_for_second
Wait/sleep/pause for N seconds.
E.g.
wait_for_second 10
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
macross-serial-1.0.3.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for macross_serial-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3f60403b4ad4fd7d85cc7dad38cf049545eaa1ad6d6a5d3ae1cca775b003a67 |
|
MD5 | 1bbbac0dbc7e70124466887a4f4476be |
|
BLAKE2b-256 | 535dbd8779e8a49e57a99ef33b7bbb914cf511850398eb9cdf70f81bd2332c17 |