-
Notifications
You must be signed in to change notification settings - Fork 104
Issue with myGNSS.getVal8 #172
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
Comments
Hello mborgerson, Your point is completely valid. We try to keep the library functions (methods) as simple as possible. For most users, given the reliability of the u-blox interface, returning the value direct is the quickest and an acceptable solution. But, yes, a better way is to: return a success/fail error code; return the data via a pointer. In our more recent libraries, we have done exactly that: provide the pointer method, and also provide a simpler overload that returns the value direct. The solution for you would be to call OK. To solve this properly, I do need to add pointer methods. However, we are already at the "tipping point" in terms of how much program memory this library uses. (See #169 for details.) So I'm reluctant to add the new methods... We are working on a new version of the library where it will be much easier to add support for new messages, and to delete messages if required to save memory. But that won't be available for some time. (I suspect I will end up working on it over the Christmas holiday!) Instead, you could use a custom packet to read the value. Please see examples 20 and 21 for details. In your case, the code would be:
I've tested the above on a ZED-F9R and it works. But I don't know which key you are trying to read. Please adapt the code as necessary. Apologies for the inconvenience, but this is at least a workable solution for you. Please let me know if it works for you. Best wishes, |
Just a note that this has been resolved in v3 of the library. v3 contains 'safe' versions of getVal - using pointers to return the value - as well as overloads for the original 'unsafe' versions. |
This is resolved in v3 of the library: https://github.com/sparkfun/SparkFun_u-blox_GNSS_v3 It is still Work-In-Progress. I'm slowly working my way through the examples, updating and testing each one as I go. But I'm confident the library is useable as-is. You won't be able to install it via the Arduino Library Manager. For now, you will need to download it and install it manually. |
Based on this forum post:
https://forum.sparkfun.com/viewtopic.php?p=237470#p237470
GNSS LIBRARY PROBLEM WITH MYGNSS.GETVAL8
I'm using the getVal8 library function to see whether the ZED-F9R is responding properly to my commands to turn on and off the sensor fusion. I'm getting variable results ---sometimes 0 and sometimes 1 for the RAM enable flag.
I think part of the problem may be that the function can return a zero value for two different issues:
1: It returns 0 when the flag is zero. That's the desired result.
2: It returns 0 when there is a communications error.
Here's the source code:
I think there should be an error code returned that is not one-half the valid responses for the function return in cases where you are asking for the status of a logical flag that returns either 0 or 1.
The text was updated successfully, but these errors were encountered: