Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON output or similar #70

Open
giddel opened this issue Jul 24, 2023 · 0 comments
Open

Add JSON output or similar #70

giddel opened this issue Jul 24, 2023 · 0 comments

Comments

@giddel
Copy link

giddel commented Jul 24, 2023

It would be nice, if the read output can be formatted as json, yaml, csv or anything else which can easily parsed by other code (e.g. shell scripts)
For example instead of:

$ mbpoll 192.168.1.148 -r 40068 -q -1 -c4
-- Polling slave 1...
[40068]:    7898
[40069]:    0
[40070]:    65524 (-12)
[40071]:    65535 (-1)

Something like this:

$ mbpoll 192.168.1.148 -r 40068 -q -1 -c4  -o json
{
    "slave": 1,
    "registers": [
        {"40068": 7898 },
        {"40069": 0},
        {"40070": "65524 (-12)"},
        {"40071": "65535 (-1)"}
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant