Add capability to send rigctld commands that return more than one result #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing code assumes that all rigctld commands return a single result, like get_freq but get_mode and others return two or more. rigctld has an awkward API that does not tell you when it has sent the last result so you just have to know how many results you are expecting and read that many lines. The results are packed into an array of string so the internal unexported functions needed to be altered slightly but the exported functions are backward compatible and also compatible with the libhamlib wrapper.
I needed the enum for the rig modulation modes so I had to make the rigctld depend on the C .h file. That could be fixed if that dependency is unwanted.
There is a "new" protocol for rigctld that seemed to solved the problem above and I coded for that until I found out that not all the rigctld commands actually implement the new protocol! When that happens the code could be made more compact and less messy.
The purpose of this change is to enable a patch that allows the setting of the rig's modulation mode, which is not possible without it.