Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
- Fixed priority setting on N2kGroupFunction tN2kGroupFunctionHandler::ParseCommandParams
- Fixed inline void SetN2kPGN129285 on N2kMessages.h to avoid conflict
- Fixed readNHexByte on SeaSmart.cpp to avoid warning.
- Restored dropped GetManufacturerInformation() definition to tNMEA2000::tDevice
- Fix comment for 127233L on NMEA2000.cpp
  • Loading branch information
ttlappalainen committed Sep 12, 2023
1 parent 10fdaeb commit e90c387
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 8 deletions.
26 changes: 26 additions & 0 deletions Documents/src/changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changes to the Library {#changes}
\tableofcontents
## 12.09.2023

- Fixed priority setting on N2kGroupFunction tN2kGroupFunctionHandler::ParseCommandParams
- Fixed inline void SetN2kPGN129285 on N2kMessages.h to avoid conflict
- Fixed readNHexByte on SeaSmart.cpp to avoid warning.
- Restored dropped GetManufacturerInformation() definition to tNMEA2000::tDevice
- Fix comment for 127233L on NMEA2000.cpp

## 25.07.2023

- Changed INT32_MAX instead of LONG_MAX on N2kTimer.h by Sam Meredith
- CMakeLists update by phatpaul
- Cleaner CMakeLists.txt by Paul Abbott
- Example ActisenseListener update

## 20.05.2023

- Example N2kDataToNMEA0183 update by Andrei Errapart

## 19.05.2023

- Catch update to version 2.13.10 by Andrei Errapart
- Fix N2kMessages/ ParsePGN129029 initialize reference station variables t NA, if no reference station by Andrei Errapart
- CMakeLists compatible as ESP-IDF by Paul Abbott
- N2kCANMsg.h: Changed #include <N2kMSG.h> to use quotes.

## 08.02.2023

- Fixed priority setting on SetN2kPGN130577.
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.18.7",
"version": "4.18.8",
"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.18.7
version=4.18.8
author=Timo Lappalainen
maintainer=Kave Oy <www.kave.fi>
sentence=NMEA 2000 library for building compatible devices for NMEA 2000 bus.
Expand Down
2 changes: 1 addition & 1 deletion src/N2kGroupFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ bool tN2kGroupFunctionHandler::ParseCommandParams(const tN2kMsg &N2kMsg,
uint8_t &NumberOfParameterPairs) {
if (N2kMsg.PGN!=126208L) return false;
int Index=N2kgf_OffsetToParams;
PrioritySetting=N2kMsg.GetByte(Index);
PrioritySetting=N2kMsg.GetByte(Index) & 0x0f;
NumberOfParameterPairs=N2kMsg.GetByte(Index);

return true;
Expand Down
3 changes: 2 additions & 1 deletion src/N2kMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -4093,7 +4093,8 @@ inline void SetN2kPGN129285(tN2kMsg &N2kMsg, uint16_t Start, uint16_t Database,
bool NavDirection, bool SupplementaryData, char* RouteName)
{
tN2kNavigationDirection NavDirection1 = NavDirection?N2kdir_reverse:N2kdir_forward;
SetN2kPGN129285(N2kMsg, Start, Database, Route, NavDirection1, (uint8_t)SupplementaryData, RouteName);
tN2kGenericStatusPair N2kSupplementaryData = SupplementaryData?N2kDD002_Yes:N2kDD002_No;
SetN2kPGN129285(N2kMsg, Start, Database, Route, NavDirection1, RouteName, N2kSupplementaryData);
}

/************************************************************************//**
Expand Down
4 changes: 2 additions & 2 deletions src/NMEA2000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ bool IsMandatoryFastPacketMessage(unsigned long PGN) {
* - 126986L: Alert Configuration, pri=2, period=NA
* - 126987L: Alert Threshold, pri=2, period=NA
* - 126988L: Alert Value, pri=2, period=10000
* - 127233L: Alert Value, pri=3, period=NA
* - 127233L: Man Overboard Notification(MOB), pri=3, period=NA
* - 127237L: Heading/Track control, pri=2, period=250
* - 127489L: Engine parameters dynamic, pri=2, period=500
* - 127496L: Trip fuel consumption, vessel, pri=5, period=1000
Expand Down Expand Up @@ -430,7 +430,7 @@ bool IsDefaultFastPacketMessage(unsigned long PGN) {
case 126986L: // Alert Configuration, pri=2, period=NA
case 126987L: // Alert Threshold, pri=2, period=NA
case 126988L: // Alert Value, pri=2, period=10000
case 127233L: // Alert Value, pri=3, period=NA
case 127233L: // Man Overboard Notification(MOB), pri=3, period=NA
case 127237L: // Heading/Track control, pri=2, period=250
case 127489L: // Engine parameters dynamic, pri=2, period=500
case 127496L: // Trip fuel consumption, vessel, pri=5, period=1000
Expand Down
3 changes: 3 additions & 0 deletions src/NMEA2000.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,9 @@ class tNMEA2000
virtual unsigned short GetLoadEquivalency() const=0;

// Configuration information
/** \brief Get the manufacturer information from the configuration
* information of this device*/
virtual const char * GetManufacturerInformation() const { return 0; }
/** \brief Get the installation description 1 from the configuration
* information of this device*/
virtual const char * GetInstallationDescription1() const { return 0; }
Expand Down
5 changes: 3 additions & 2 deletions src/Seasmart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ size_t N2kToSeasmart(const tN2kMsg &msg, uint32_t timestamp, char *buffer, size_
* Returns true if successful, false otherwise.
*/
static bool readNHexByte(const char *s, unsigned int n, uint32_t &value) {
value=(uint32_t)(-1); // required to avoid warning about uninitialized variable.
if (strlen(s) < 2*n) {
return -1;
return false;
}
for (unsigned int i = 0; i < 2*n; i++) {
if (!isxdigit(s[i])) {
return -1;
return false;
}
}

Expand Down

0 comments on commit e90c387

Please sign in to comment.