-
Notifications
You must be signed in to change notification settings - Fork 199
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
introducing a help command #129
Comments
SCPI-99 is standard with some fixed structure of requests and responses. Even if it has text commands, it is not supposed to be used by humans directly. E.g. exactly one newline character at the end of the command is expected and exactly one newline character is expected in the response. Exception os only Of course, you can have any nonstandard modification in your product but it is unlikely that it will be part of the library itself. |
I re-implemented the HELP mechanism with block data. Still working on it a bit and cleaning up. The optional description mechanism is backward compatible and allows informing the user which arguments are expected. Short explanations can be added to describe the exact scope and use of each command. Some PC tools allow sending raw SCPI commands. When a program uses HELP, it could use the returned list of commands to populate a drop-down box or show the command list as a table. The newline characters are absorbed into the ends of each block and should thus not be caught by the parser. ps. is comma separation required? I think that's the last compliance issue to be addressed. I've only found one reference (in scpi-99, 6.2.3.4) pertaining to multiple blocks, and it appears they need to be treated the same as numerical values. |
@j123b567 the HELP? enhancement has served me well in recent months. It's really convenient in the lab when setting up and verifying configurations. I don't have to worry about versions of documentation to boards I've given to colleagues either. |
I was asked to add a help mechanism to list all currently supported scpi commands. Hopefully I haven't overlooked another implementation somewhere. I'd love to hear your thoughts on the approach described below. I feel it's a trade-off between conformity and readability.
Here's what the user sees in a PuTTY session:
The implementation is rather straight-forward:
Now I would expect the pattern strings would need to be returned in quotes, but then again it's most likely a human operator that opened the connection exclusively, so one would in turn even want to do away with the comma separation.
Going one step further even, one might be tempted to add short description strings where commands are not completely clear to the new user, and print them next to the listed commands.
_scpi_command_t
would need to be changed toThe text was updated successfully, but these errors were encountered: