Skip to content

Commit

Permalink
Fixed GetVarStr
Browse files Browse the repository at this point in the history
- Fixed GetVarStr to handle invalid length, thanks to EricvanderVelde.
- Fixed PGN 129794 setter to set SID properly.
- Fixed PGN 129540 to parse up to MaxSatelliteInfoCount, thanks to cosina.
- CMakeLists.txt update by Dirlay.
  • Loading branch information
ttlappalainen committed May 23, 2024
1 parent efcd662 commit 060c955
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Documents/src/changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changes to the Library {#changes}
\tableofcontents

## 23.05.2024
- Fixed GetVarStr to handle invalid length, thanks to EricvanderVelde.
- Fixed PGN 129794 setter to set SID properly.
- Fixed PGN 129540 to parse up to MaxSatelliteInfoCount, thanks to cosina.
- CMakeLists.txt update by Dirlay.

## 25.03.2024
- Added PGN 127510
- Added PGN 127750
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"url": "http://www.kave.fi",
"maintainer": true
},
"version": "4.21.4",
"version": "4.21.5",
"license": "MIT",
"frameworks": "*",
"platforms": "*"
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=NMEA2000
version=4.21.4
version=4.21.5
author=Timo Lappalainen
maintainer=Kave Oy <www.kave.fi>
sentence=NMEA 2000 library for building compatible devices for NMEA 2000 bus.
Expand Down
3 changes: 1 addition & 2 deletions src/N2kMessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ bool ParseN2kPGN129540(const tN2kMsg& N2kMsg, uint8_t SVIndex, tSatelliteInfo& S

int Index = 2;
uint8_t NumberOfSVs=N2kMsg.GetByte(Index);
bool ret=( NumberOfSVs<MaxSatelliteInfoCount && SVIndex<NumberOfSVs );
bool ret=( NumberOfSVs<=MaxSatelliteInfoCount && SVIndex<NumberOfSVs );

if ( ret ) {
Index=3+SVIndex*12;
Expand Down Expand Up @@ -1712,7 +1712,6 @@ void SetN2kPGN129794(tN2kMsg &N2kMsg, uint8_t MessageID, tN2kAISRepeat Repeat, u
N2kMsg.AddAISStr(Destination, 20);
N2kMsg.AddByte((DTE & 0x01)<<6 | (GNSStype & 0x0f)<<2 | (AISversion & 0x03));
N2kMsg.AddByte(0xe0 | (AISinfo & 0x1f));
N2kMsg.AddByte(0xff);
N2kMsg.AddByte(SID);
}

Expand Down

0 comments on commit 060c955

Please sign in to comment.