Code Monkey home page Code Monkey logo

Comments (6)

mariokonrad avatar mariokonrad commented on August 28, 2024

Thanks for the insight. I do not know what the standard says, I do not have it, nor have I seen it.
Found the information about ALR here: https://www.cruisersforum.com/forums/f134/opencpn-and-external-nmea0183-alarms-81396.html
According to the examples provided there, it seems the alarm description can contain whitespaces.

Interpreting your screenshots, the device delivers

$AIALR,00000.00,026,A,V,AIS: no position sensor in use*5D

but nmeatool prints

$AIALR,00000.00,026,A,V,AIS:nopositionsensorinuse*5D

and claims the checksum is wrong? Yes, this clearly seems wrong.
Thanks for finding the bug!

from marnav.

mariokonrad avatar mariokonrad commented on August 28, 2024

You're sure you're screenshots are accurate?

I try to reproduce and do:

echo "\$AIALR,00000.00,026,A,V,AIS: no position sensor in use*5D" | ./nmeatool

I get

$AIALR,00000.00,026,A,V,AIS: no position sensor in use*5D
        error: checksum error: checksum error (actual:6D, expected:5D)

There seems to be an issue with checksum, but I do not get your result.
Also your nmeatool output seems to strip the whitespaces, which I cannot reproduce.

Various sources (quickly found by your favorite search engine), examples:

do not seem to treat whitespaces in a special way.

To me, it actually looks like $AIALR,00000.00,026,A,V,AIS: no position sensor in use*5D is wrong
and should be $AIALR,00000.00,026,A,V,AIS: no position sensor in use*6D".

Cannot reproduce, does not look like a bug to me.

from marnav.

vcomert avatar vcomert commented on August 28, 2024

I 'm sure. You missed the one zero in the sentence after AIALR. There are six zero chars. The array that is seen in the picture is
AIALR,000000.00,026,A,V,AIS: no position sensor in use

Also, I fixed the bug in my local code by getting

if ((raw_ <= 32) || (raw_ >= 127))

raw_ <= 31.

from marnav.

mariokonrad avatar mariokonrad commented on August 28, 2024

You're right, I missed a 0. Then I try again:

echo "\$AIALR,000000.00,026,A,V,AIS: no position sensor in use*5D" | ./nmeatool

yields the output:

$AIALR,000000.00,026,A,V,AIS: no position sensor in use*5D
        Name  : Set Alarm State
        Talker: Mobile AIS station
        Time UTC                       : 00:00:00
        Alarm Number                   : 26
        Alarm Condition                : Threshold Exceeded
        Alarm Acknowledge              : Not Acknowledged
        Alarm Text                     : AIS: no position sensor in use

Still does not match the output you presented with allegedly wrong checksum and spaces removed in the output of nmeatool.

As for the nmea_reader.cpp, this really looks like ignoring spaces and does not work for ALR. Will fix this, thanks!

from marnav.

mariokonrad avatar mariokonrad commented on August 28, 2024

See b91e74c, nmea_reader.cpp processes now spaces as well.

from marnav.

vcomert avatar vcomert commented on August 28, 2024

I did not try to use with nmeatool with string input. Rather I used it with reading serial data. There may be a difference with input style. Anyway issue is closed. Thank you.

from marnav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.