MyTooliT / ICOc

ICOc is a tool to control the ICOtronic system, acquire data, and test stationary transceiver units and sensory tool holders.
https://mytoolit.github.io/ICOc/
2 stars 0 forks source link

Create Script To Read/Write STH & STU Attributes #11

Open sanssecours opened 3 years ago

sanssecours commented 3 years ago

Description

To debug the state of an STH or STU it makes sense to read (and write) some of the (EEPROM) attributes of these nodes. Ideally we should offer a command line application (Python script) that allows us to read all or specific attributes of a node. Contrary to the current design of the ICOc the application would not work interactively, but instead behave just like a normal command line application such as cat, head or git. This should make it possible to also use the program in (Shell) scripts to automate certain tasks.

Examples

General

I am still unsure about the name of the tool. In the examples below I just call it “ICOn” or icon. Of course I am open for better name suggestions.

Reading all attributes of a certain unit could look like this

icon read --name GGvXEd6B --type STH

and the output could look something like this:

EEPROM Status: Initialized (0xac)
Name: CGvXAd6B
Production Date: 2019-07-03
…

The idea here is to use subcommands (read in this example) to specify the purpose of the command just like other tools such as docker or git do.

Reading a Single Attribute

Command

icon read --name GGvXEd6B --type STH --attribute 'Production Date'

Output

2019-07-03

Writing a Single Attribute

Command

icon write --name GGvXEd6B --type STH --attribute 'Production Date' '2020-10-06'

Output

None

Retrieving All Available STHs

Command

icon list

Output

GGvXEd6B
Blubb
Hello