Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Fix a few places where non zero error codes were mistakenly... #79

Closed
wants to merge 1 commit into from

Conversation

geeksville
Copy link

being treated as "true for success"

(I noticed this because I was seeing 'errors' in the examples and in my app when I checked the result code to isConnected(), saveConfiguration() etc... sendCommand is returning an error code enum, but the docs for isConnected() say the return value is true for success.

@PaulZC
Copy link
Collaborator

PaulZC commented Apr 15, 2020

Hi Kevin (@geeksville),
Many thanks for this PR. Great catch!
We changed the way sendCommand works a few months ago.

There are commands that will generate only an ACK (e.g. saveConfiguration) and sendCommand will return SFE_UBLOX_STATUS_DATA_SENT in those cases.
Then there are the commands that generate an ACK and return some data. sendCommand will return SFE_UBLOX_STATUS_DATA_RECEIVED in those cases.
Although sendCommand could in theory also return SFE_UBLOX_STATUS_SUCCESS, in practice it can't as neither waitForACKResponse nor waitForNoACKResponse return that value.

I agree with your changes - thank you - I just need to check that we don't also need to trap SFE_UBLOX_STATUS_DATA_RECEIVED too.

I also see we also need to fix this in many other places, including for example:
setI2CAddress
saveConfigSelective
factoryDefault
getVal8

I'll work on a separate catch-all PR and will include your PR in that.
Thanks again.

@PaulZC
Copy link
Collaborator

PaulZC commented Apr 16, 2020

Hi Kevin (@geeksville),
I have made several changes to the library today and have included corrections for all of the calls to sendCommand. These should - I hope - resolve all of your issues.
When you have time, could you please download and test the latest code?
I am going to close this PR. Please feel free to raise a new Issue or reopen this PR if you are still having problems.
Best wishes,
Paul

@PaulZC PaulZC closed this Apr 16, 2020
@geeksville
Copy link
Author

geeksville commented Apr 16, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants