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

Fix VFOMode to check for correct response #87

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

larsks
Copy link
Contributor

@larsks larsks commented Oct 27, 2023

Previous, VFOMode() was expecting the response CHKVFO 1 from rigctld
when running in VFO mode, but in fact rigctld responds with the string
1:

$ nc localhost 4532
\chk_vfo
1

Closes la5nta/pat#427

Copy link
Member

@martinhpedersen martinhpedersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reporting this, and for the PR :)

This is a breaking API change in rigctld, which is unfortunate. We need to fix this in a backwards compatible way in order to stay compatible with older versions of hamlib.

If we do strings.TrimPrefix(resp, "CHKVFO") == "1" instead, it will work in both cases. Do you mind updating the PR?

Thanks again!

PS: We should probably trace down the change i hamlib and check if this is a bug or an intended API change. Maybe they've done similar changes we shuold take into account aswell.

@larsks
Copy link
Contributor Author

larsks commented Oct 27, 2023

If we do strings.TrimPrefix(resp, "CHKVFO") == "1" instead, it will work in both cases. Do you mind updating the PR?

Sounds good. I'm happy to update the PR.

We should probably trace down the change in hamlib and check if this is a bug or an intended API change. Maybe they've done similar changes we should take into account as well.

It looks like it changed in Hamlib/Hamlib@44a20c6, without explanation, in Sept 2019.

Previous, VFOMode() was expecting the response `CHKVFO 1` from `rigctld`
when running in VFO mode, but in fact `rigctld` responds with the string
`1`:

    $ nc localhost 4532
    \chk_vfo
    1

Closes la5nta/pat#427
Copy link
Member

@martinhpedersen martinhpedersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's perfect! Thank you 😀

@martinhpedersen martinhpedersen merged commit f11f6c0 into la5nta:master Oct 27, 2023
4 checks passed
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

Successfully merging this pull request may close these issues.

Pat failing to interact with rigctld in vfo mode
2 participants