-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add readme for custom monitoring script
- Loading branch information
Krisjanis Veinbahs
committed
Jan 8, 2022
1 parent
34f19ac
commit d9c3e7e
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Custom serial port monitoring script `hexbytes` | ||
This folder contains a Python module which can be imported by the DIP Testbed Client `hardware-serial-monitor` command. | ||
|
||
Module contents: | ||
- `mock.py` - Mocks of all DIP Testbed related Python classes needed to implement a custom monitoring solution, | ||
this is added for doing type checking in IDEs. | ||
- `monitor.py` - The actual monitoring script, which exports a `monitor` variable containing the monitoring class with a method `run` | ||
|
||
The monitoring script gets run with an instance of `socketlike: Socketlike`, which allows receiving/transmitting monitoring messages to/from the backend. | ||
|
||
This specific `hexbytes` implementation is a copy-paste of the original `hardware-serial-monitor` monitoring type `hexbytes`, simply implemented as an external script/module. | ||
|
||
This script does the following: | ||
- receives bytes from the `socketlike`, formats and prints them out to `STDOUT` | ||
- captures/supresses `STDIN` from printing to `STDOUT` | ||
- redirects all `STDIN` bytes to transmit through `socketlike` | ||
- on error conditions or exit signals reverts the capture of `STDIN`, closes the `socketlike` connection, returns an exit result |