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

Wrong Checksum sent for $PGRMZ in GNSSHelper.cpp #24

Closed
PeteMilligan99 opened this issue Jul 23, 2018 · 1 comment
Closed

Wrong Checksum sent for $PGRMZ in GNSSHelper.cpp #24

PeteMilligan99 opened this issue Jul 23, 2018 · 1 comment
Assignees
Labels

Comments

@PeteMilligan99
Copy link

The carriage return wasn't being checksummed, but the leading dollar sign was. This was providing the wrong checksum to an attached Kobo running XCSoar.

snprintf((char ) &GNSSbuf[GNSS_cnt+1], 24, "\n$PGRMZ,%d,f,3", altitude ); /* feet , 3D fix */
size_t sentence_size = strlen((char *) &GNSSbuf[GNSS_cnt+1]);

        //calculate the checksum
        unsigned char cs = 0;
        for (unsigned int n = 2; n < sentence_size - 1; n++) { **// n=1 changed to n=2**
          cs ^= GNSSbuf[(GNSS_cnt+1) + n];
        }
lyusupov added a commit that referenced this issue Jul 23, 2018
@lyusupov lyusupov self-assigned this Jul 23, 2018
@lyusupov lyusupov added the bug label Jul 23, 2018
@lyusupov
Copy link
Owner

fixed in cee531d

Repository owner locked as resolved and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants