NMEA2000 Library
0.1
Library to handle NMEA 2000 Communication written in C++
|
This File contains functions to convert enums from N2kMessages.h to const char. More...
#include "N2kMessages.h"
Go to the source code of this file.
Macros | |
#define | MakeN2kEnumTypeToStrFunc(enumType, strs) |
Macro function for converting various N2k Enums to a const char. More... | |
Variables | |
const char * | N2kEnumTypeEmpty ="" |
Default value if no string representation is found. More... | |
const char * | tN2kBatChemStrs [] = { "lead acid", "LiIon", "NiCad", "NiMh"} |
string representation of the N2k enum tN2kBatChem More... | |
const char * | tN2kBatEqSupportStrs [] = { "no", "yes", "error"} |
string representation of the N2k enum tN2kBatEqSupport More... | |
const char * | tN2kBatNomVoltStrs [] = { "6V", "12V", "24V", "32V", "62V", "42V", "48V"} |
string representation of the N2k enum tN2kBatNomVolt More... | |
const char * | tN2kBatTypeStrs [] = { "flooded", "gel", "AGM"} |
string representation of the N2k enum tN2kBatType More... | |
const char * | tN2kDCTypeStrs [] = { "battery", "altenator", "converter", "solar cell", "wind generator"} |
string representation of the N2k enum tN2kDCType More... | |
const char * | tN2kFluidTypeStrs [] |
string representation of the N2k enum tN2kFluidType More... | |
const char * | tN2kGNSSmethodStrs [] = { "no GNSS", "GNSS fix", "DGNSS", "precise GNSS" } |
string representation of the N2k enum tN2kGNSSmethod More... | |
const char * | tN2kGNSStypeStrs [] = { "GPS", "GLONASS", "GPS+GLONASS", "GPS+SBAS/WAAS", "GPS+SBAS/WAAS+GLONASS", "Chayka", "integrated", "surveyed", "Galileo" } |
string representation of the N2k enum tN2kGNSStype More... | |
const char * | tN2kHeadingReferenceStrs [] = { "true", "magnetic" } |
string representation of the N2k enum tN2kHeadingReference More... | |
const char * | tN2kHumidityStrs [] = { "inside", "outside" } |
string representation of the N2k enum tN2kHumiditySource More... | |
const char * | tN2kMagneticVariationStrs [] = { "Manual","Automatic Chart","Automatic Table","Automatic Calculation","WMM 2000","WMM 2005","WMM 2010","WMM 2015","WMM 2020" } |
string representation of the N2k enum tN2kMagneticVariation More... | |
const char * | tN2kOnOffStrs [] = { "0", "1", "err", "NA" } |
string representation of the N2k enum tN2kOnOff More... | |
const char * | tN2kPressureStrs [] = { "atmospheric", "water", "steam", "compressed air", "hydraulic", "filter", "altimete setting", "oil", "fuel" } |
string representation of the N2k enum tN2kPressureSource More... | |
const char * | tN2kRudderDirectionOrderStrs [] = { "no direction order", "move to starboard", "move to port" } |
string representation of the N2k enum tN2kRudderDirectionOrder More... | |
const char * | tN2kSpeedWaterReferenceTypeStrs [] = {"Paddle wheel","Pitot tube","Doppler","Correlation (ultra sound)","Electro Magnetic"} |
string representation of the N2k enum tN2kSpeedWaterReferenceType More... | |
const char * | tN2kTempSourceStrs [] |
string representation of the N2k enum tN2kTempSource More... | |
const char * | tN2kTimeSourceStrs [] = { "GPS", "GLONASS", "radio station", "local cesium clock", "local rubidium clock", "local crystal clock" } |
string representation of the N2k enum tN2kTimeSource More... | |
const char * | tN2kTransmissionGearStrs [] = { "forward", "neutral", "reverse", "unknown"} |
string representation of the N2k enum tN2kTransmissionGear More... | |
const char *const | tN2kXTEModeStrs [] = { "Autonomous", "Differential", "Estimated", "Simulator" } |
string representation of the N2k enum tN2kXTEModeStrs More... | |
This File contains functions to convert enums from N2kMessages.h to const char.
This is collection of functions for handling enums of NMEA2000 bus messages. There are basically 2 functions in the library to convert enums derived from N2kMessages to const char *:
This functions returns a const char * value thats representing the given enum Value. By detecting the enumType, the right text output is chosen.
This prints the corresponding text output to the given output stream.
Definition in file N2kMessagesEnumToStr.h.
#define MakeN2kEnumTypeToStrFunc | ( | enumType, | |
strs | |||
) |
Macro function for converting various N2k Enums to a const char.
This generic macro defines a way to use a specific version of N2kEnumTypeToStr(enumType enumVal) depending on which enumType is given as parameter.
In NMEA2000 messages there are several enumerations defined and used for the states of different systems. E.g tN2kBatType holds all the available battery types like "flooded", "gel", "AGM". If you need the "real" values of these enums written to a string (e.g. for debugging), you can use these functions.
Definition at line 102 of file N2kMessagesEnumToStr.h.
MakeN2kEnumTypeToStrFunc | ( | tN2kBatChem | , |
tN2kBatChemStrs | |||
) |
Converting the N2k enum tN2kBatChem to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kBatEqSupport | , |
tN2kBatEqSupportStrs | |||
) |
Converting the N2k enum tN2kBatEqSupport to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kBatNomVolt | , |
tN2kBatNomVoltStrs | |||
) |
Converting the N2k enum tN2kBatNomVolt to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kBatType | , |
tN2kBatTypeStrs | |||
) |
Converting the N2k enum tN2kBatType to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kDCType | , |
tN2kDCTypeStrs | |||
) |
Converting the N2k enum tN2kDCType to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kFluidType | , |
tN2kFluidTypeStrs | |||
) |
Converting the N2k enum tN2kFluidType to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kGNSSmethod | , |
tN2kGNSSmethodStrs | |||
) |
Converting the N2k enum tN2kGNSSmethod to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kGNSStype | , |
tN2kGNSStypeStrs | |||
) |
Converting the N2k enum tN2kTimeSource to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kHeadingReference | , |
tN2kHeadingReferenceStrs | |||
) |
Converting the N2k enum tN2kHeadingReference to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kHumiditySource | , |
tN2kHumidityStrs | |||
) |
Converting the N2k enum tN2kHumiditySource to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kMagneticVariation | , |
tN2kSpeedWaterReferenceTypeStrs | |||
) |
Converting the N2k enum tN2kMagneticVariation to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kOnOff | , |
tN2kOnOffStrs | |||
) |
Converting the N2k enum tN2kOnOff to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kPressureSource | , |
tN2kPressureStrs | |||
) |
Converting the N2k enum tN2kPressureSource to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kRudderDirectionOrder | , |
tN2kRudderDirectionOrderStrs | |||
) |
Converting the N2k enum tN2kRudderDirectionOrder to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kSpeedWaterReferenceType | , |
tN2kSpeedWaterReferenceTypeStrs | |||
) |
Converting the N2k enum tN2kSpeedWaterReferenceType to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kTempSource | , |
tN2kTempSourceStrs | |||
) |
Converting the N2k enum tN2kTempSource to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kTimeSource | , |
tN2kTimeSourceStrs | |||
) |
Converting the N2k enum tN2kTimeSource to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kTransmissionGear | , |
tN2kTransmissionGearStrs | |||
) |
Converting the N2k enum tN2kTransmissionGear to a const char.
MakeN2kEnumTypeToStrFunc | ( | tN2kXTEMode | , |
tN2kXTEModeStrs | |||
) |
Converting the N2k enum tN2kXTEModeStrs to a const char.
void PrintN2kEnumType | ( | T | a, |
Stream * | OutputStream, | ||
bool | addLF = true |
||
) |
Print function for the enum values.
This function template generation an text output to the defined stream. Corresponding to the type of the enum value, the correct function (and therefore output text) is chosen.
T | Type of the enum |
a | enum value |
OutputStream | stream handler for the output |
addLF | add a line feed (default = true) |
Definition at line 69 of file N2kMessagesEnumToStr.h.
const char* N2kEnumTypeEmpty ="" |
Default value if no string representation is found.
Definition at line 55 of file N2kMessagesEnumToStr.h.
const char* tN2kBatChemStrs[] = { "lead acid", "LiIon", "NiCad", "NiMh"} |
string representation of the N2k enum tN2kBatChem
Definition at line 198 of file N2kMessagesEnumToStr.h.
const char* tN2kBatEqSupportStrs[] = { "no", "yes", "error"} |
string representation of the N2k enum tN2kBatEqSupport
Definition at line 180 of file N2kMessagesEnumToStr.h.
const char* tN2kBatNomVoltStrs[] = { "6V", "12V", "24V", "32V", "62V", "42V", "48V"} |
string representation of the N2k enum tN2kBatNomVolt
Definition at line 189 of file N2kMessagesEnumToStr.h.
const char* tN2kBatTypeStrs[] = { "flooded", "gel", "AGM"} |
string representation of the N2k enum tN2kBatType
Definition at line 171 of file N2kMessagesEnumToStr.h.
const char* tN2kDCTypeStrs[] = { "battery", "altenator", "converter", "solar cell", "wind generator"} |
string representation of the N2k enum tN2kDCType
Definition at line 207 of file N2kMessagesEnumToStr.h.
const char* tN2kFluidTypeStrs[] |
string representation of the N2k enum tN2kFluidType
Definition at line 150 of file N2kMessagesEnumToStr.h.
const char* tN2kGNSSmethodStrs[] = { "no GNSS", "GNSS fix", "DGNSS", "precise GNSS" } |
string representation of the N2k enum tN2kGNSSmethod
Definition at line 141 of file N2kMessagesEnumToStr.h.
const char* tN2kGNSStypeStrs[] = { "GPS", "GLONASS", "GPS+GLONASS", "GPS+SBAS/WAAS", "GPS+SBAS/WAAS+GLONASS", "Chayka", "integrated", "surveyed", "Galileo" } |
string representation of the N2k enum tN2kGNSStype
Definition at line 132 of file N2kMessagesEnumToStr.h.
const char* tN2kHeadingReferenceStrs[] = { "true", "magnetic" } |
string representation of the N2k enum tN2kHeadingReference
Definition at line 112 of file N2kMessagesEnumToStr.h.
const char* tN2kHumidityStrs[] = { "inside", "outside" } |
string representation of the N2k enum tN2kHumiditySource
Definition at line 243 of file N2kMessagesEnumToStr.h.
const char* tN2kMagneticVariationStrs[] = { "Manual","Automatic Chart","Automatic Table","Automatic Calculation","WMM 2000","WMM 2005","WMM 2010","WMM 2015","WMM 2020" } |
string representation of the N2k enum tN2kMagneticVariation
Definition at line 271 of file N2kMessagesEnumToStr.h.
const char* tN2kOnOffStrs[] = { "0", "1", "err", "NA" } |
string representation of the N2k enum tN2kOnOff
Definition at line 225 of file N2kMessagesEnumToStr.h.
const char* tN2kPressureStrs[] = { "atmospheric", "water", "steam", "compressed air", "hydraulic", "filter", "altimete setting", "oil", "fuel" } |
string representation of the N2k enum tN2kPressureSource
Definition at line 234 of file N2kMessagesEnumToStr.h.
const char* tN2kRudderDirectionOrderStrs[] = { "no direction order", "move to starboard", "move to port" } |
string representation of the N2k enum tN2kRudderDirectionOrder
Definition at line 252 of file N2kMessagesEnumToStr.h.
const char* tN2kSpeedWaterReferenceTypeStrs[] = {"Paddle wheel","Pitot tube","Doppler","Correlation (ultra sound)","Electro Magnetic"} |
string representation of the N2k enum tN2kSpeedWaterReferenceType
Definition at line 261 of file N2kMessagesEnumToStr.h.
const char* tN2kTempSourceStrs[] |
string representation of the N2k enum tN2kTempSource
Definition at line 161 of file N2kMessagesEnumToStr.h.
const char* tN2kTimeSourceStrs[] = { "GPS", "GLONASS", "radio station", "local cesium clock", "local rubidium clock", "local crystal clock" } |
string representation of the N2k enum tN2kTimeSource
Definition at line 122 of file N2kMessagesEnumToStr.h.
const char* tN2kTransmissionGearStrs[] = { "forward", "neutral", "reverse", "unknown"} |
string representation of the N2k enum tN2kTransmissionGear
Definition at line 216 of file N2kMessagesEnumToStr.h.
const char* const tN2kXTEModeStrs[] = { "Autonomous", "Differential", "Estimated", "Simulator" } |
string representation of the N2k enum tN2kXTEModeStrs
Definition at line 280 of file N2kMessagesEnumToStr.h.