28#define N2kPGN60928_UniqueNumber_field 1
29#define N2kPGN60928_ManufacturerCode_field 2
30#define N2kPGN60928_DeviceInstanceLower_field 3
31#define N2kPGN60928_DeviceInstanceUpper_field 4
32#define N2kPGN60928_DeviceFunction_field 5
33#define N2kPGN60928_Reserved_field 6
34#define N2kPGN60928_DeviceClass_field 7
35#define N2kPGN60928_SystemInstance_field 8
36#define N2kPGN60928_IndustryGroup_field 9
37#define N2kPGN60928_ISOSelfConfigurable_field 10
39#if !defined(N2K_NO_GROUP_FUNCTION_SUPPORT)
45 uint32_t TransmissionInterval,
46 uint16_t TransmissionIntervalOffset,
47 uint8_t NumberOfParameterPairs,
50 bool MatchFilter=
true;
57 NumberOfParameterPairs);
60 if ( NumberOfParameterPairs>0 ) {
66 bool FoundInvalidField=
false;
71 if ( !FoundInvalidField) {
109 FoundInvalidField=
true;
140 uint8_t DILower=0xff;
141 uint8_t DIUpper=0xff;
150 NumberOfParameterPairs);
155 for (i=0; i<NumberOfParameterPairs; i++) {
160 DILower=N2kMsg.
GetByte(Index) & 0x7;
163 DIUpper=N2kMsg.
GetByte(Index) & 0x1f;
166 SI=N2kMsg.
GetByte(Index) & 0x0f;
185 uint32_t TransmissionInterval,
186 uint16_t TransmissionIntervalOffset,
187 uint8_t NumberOfParameterPairs,
190 bool MatchFilter=
true;
191 uint8_t RespondTxRx=0xff;
198 NumberOfParameterPairs);
201 if ( NumberOfParameterPairs>0 ) {
206 bool FoundInvalidField=
false;
211 if ( !FoundInvalidField) {
215 RespondTxRx=N2kMsg.
GetByte(Index);
226 FoundInvalidField=
true;
243#if !defined(N2K_NO_ISO_MULTI_PACKET_SUPPORT)
244 unsigned char dest=N2kMsg.
Source;
257#define N2kPGN126996_NMEA2000DatabaseVersion_field 1
258#define N2kPGN126996_NMEAManufacturersProductCode_field 2
259#define N2kPGN126996_ManufacturersModelID_field 3
260#define N2kPGN126996_ManufacturersSoftwareVersionCode_field 4
261#define N2kPGN126996_ManufacturersModelVersion_field 5
262#define N2kPGN126996_ManufacturersModelSerialCode_field 6
263#define N2kPGN126996_NMEA2000CertificationLevel_field 7
264#define N2kPGN126996_LoadEquivalency_field 8
270 uint32_t TransmissionInterval,
271 uint16_t TransmissionIntervalOffset,
272 uint8_t NumberOfParameterPairs,
275 bool MatchFilter=
true;
282 NumberOfParameterPairs);
285 if ( NumberOfParameterPairs>0 ) {
290 bool FoundInvalidField=
false;
293 char CurVal[strSize];
298 if ( !FoundInvalidField) {
336 FoundInvalidField=
true;
353#if !defined(N2K_NO_ISO_MULTI_PACKET_SUPPORT)
354 unsigned char dest=N2kMsg.
Source;
365#define N2kPGN126998_InstallationDescription1_field 1
366#define N2kPGN126998_InstallationDescription2_field 2
367#define N2kPGN126998_ManufacturerInformation_field 3
373 uint32_t TransmissionInterval,
374 uint16_t TransmissionIntervalOffset,
375 uint8_t NumberOfParameterPairs,
378 bool MatchFilter=
true;
385 NumberOfParameterPairs);
388 if ( NumberOfParameterPairs>0 ) {
393 bool FoundInvalidField=
false;
401 if ( !FoundInvalidField) {
406 N2kMsg.
GetVarStr(QueryStrSize,Query,Index);
412 N2kMsg.
GetVarStr(QueryStrSize,Query,Index);
418 N2kMsg.
GetVarStr(QueryStrSize,Query,Index);
425 FoundInvalidField=
true;
443#if !defined(N2K_NO_ISO_MULTI_PACKET_SUPPORT)
444 unsigned char dest=N2kMsg.
Source;
461 size_t InstallationDescriptionSize;
471 NumberOfParameterPairs);
475 for (i=0; i<NumberOfParameterPairs; i++) {
480 N2kMsg.
GetVarStr(InstallationDescriptionSize,InstallationDescription,Index);
486 N2kMsg.
GetVarStr(InstallationDescriptionSize,InstallationDescription,Index);
500#if !defined(N2K_NO_HEARTBEAT_SUPPORT)
505 uint32_t TransmissionInterval,
506 uint16_t TransmissionIntervalOffset,
507 uint8_t NumberOfParameterPairs,
513 if ( NumberOfParameterPairs==0 ) {
514 if ( TransmissionInterval==0xffffffff && TransmissionIntervalOffset==0xffff ) {
521 uint32_t Offset=TransmissionIntervalOffset;
522 Offset=(Offset==0xffff || Offset==0?0xffffffff:Offset*10);
tN2kGroupFunctionParameterErrorCode
Error Codes Command used by acknowledge group function.
@ N2kgfpec_TemporarilyUnableToComply
@ N2kgfpec_RequestOrCommandNotSupported
@ N2kgfpec_InvalidRequestOrCommandParameterField
@ N2kgfpec_RequestOrCommandParameterOutOfRange
tN2kGroupFunctionTransmissionOrPriorityErrorCode
Error codes Transmit interval used by acknowledge group function.
@ N2kgfTPec_TransmitIntervalOrPriorityNotSupported
#define N2kPGN60928_DeviceInstanceUpper_field
#define N2kPGN60928_DeviceFunction_field
#define N2kPGN60928_UniqueNumber_field
#define N2kPGN126996_LoadEquivalency_field
#define N2kPGN60928_ManufacturerCode_field
#define N2kPGN60928_Reserved_field
#define N2kPGN126996_ManufacturersSoftwareVersionCode_field
#define N2kPGN60928_ISOSelfConfigurable_field
#define N2kPGN126996_NMEA2000CertificationLevel_field
#define N2kPGN60928_SystemInstance_field
#define N2kPGN126996_ManufacturersModelVersion_field
#define N2kPGN126996_NMEA2000DatabaseVersion_field
#define N2kPGN126996_ManufacturersModelSerialCode_field
#define N2kPGN126998_InstallationDescription1_field
#define N2kPGN60928_DeviceInstanceLower_field
#define N2kPGN126996_NMEAManufacturersProductCode_field
#define N2kPGN60928_DeviceClass_field
#define N2kPGN60928_IndustryGroup_field
#define N2kPGN126998_InstallationDescription2_field
#define N2kPGN126998_ManufacturerInformation_field
#define N2kPGN126996_ManufacturersModelID_field
The file contains default group function handler classes.
This file contains the class tNMEA2000, which consists the main functionality of the library.
#define Max_N2kModelSerialCode_len
Max length of SerialCode Document says for length 32 but then values has not been translated right on...
#define Max_N2kProductInfoStrLen
Define length of longest info string Define length of longest info string (from Max_N2kModelID_len,...
#define Max_N2kSwCode_len
Max length of Software Code Document says for length 40 but then values has not been translated right...
#define Max_N2kModelVersion_len
Max length of Model Version Document says for length 24 but then values has not been translated right...
#define Max_N2kConfigurationInfoField_len
Max length of Configuration Info Fields.
#define Max_N2kModelID_len
Max length of ModelID Document says for length 33 but then values has not been translated right on de...
virtual bool HandleRequest(const tN2kMsg &N2kMsg, uint32_t TransmissionInterval, uint16_t TransmissionIntervalOffset, uint8_t NumberOfParameterPairs, int iDev)
Handle response for request group function.
virtual bool HandleRequest(const tN2kMsg &N2kMsg, uint32_t TransmissionInterval, uint16_t TransmissionIntervalOffset, uint8_t NumberOfParameterPairs, int iDev)
Handle response for request group function.
virtual bool HandleRequest(const tN2kMsg &N2kMsg, uint32_t TransmissionInterval, uint16_t TransmissionIntervalOffset, uint8_t NumberOfParameterPairs, int iDev)
Handle response for request group function.
virtual bool HandleRequest(const tN2kMsg &N2kMsg, uint32_t TransmissionInterval, uint16_t TransmissionIntervalOffset, uint8_t NumberOfParameterPairs, int iDev)
Handle response for request group function.
virtual bool HandleCommand(const tN2kMsg &N2kMsg, uint8_t PrioritySetting, uint8_t NumberOfParameterPairs, int iDev)
Handle response for command group function.
virtual bool HandleRequest(const tN2kMsg &N2kMsg, uint32_t TransmissionInterval, uint16_t TransmissionIntervalOffset, uint8_t NumberOfParameterPairs, int iDev)
Handle response for request group function.
virtual bool HandleCommand(const tN2kMsg &N2kMsg, uint8_t PrioritySetting, uint8_t NumberOfParameterPairs, int iDev)
Handle response for command group function.
static bool StartParseRequestPairParameters(const tN2kMsg &N2kMsg, int &Index)
Get start Index of pair parameters from request group function message.
void MatchRequestField(T FieldVal, T MatchVal, T Mask, bool &Match, tN2kGroupFunctionParameterErrorCode &ErrorCode)
Template class to test does field on group function match to PGN field value.
static void SendAcknowledge(tNMEA2000 *pNMEA2000, unsigned char Destination, int iDev, unsigned long PGN, tN2kGroupFunctionPGNErrorCode PGNErrorCode, tN2kGroupFunctionTransmissionOrPriorityErrorCode TransmissionOrPriorityErrorCode, uint8_t NumberOfParameterPairs=0, tN2kGroupFunctionParameterErrorCode ParameterErrorCodeForAll=N2kgfpec_Acknowledge)
Send out an acknowledge group function message.
virtual tN2kGroupFunctionTransmissionOrPriorityErrorCode GetRequestGroupFunctionTransmissionOrPriorityErrorCode(uint32_t TransmissionInterval, uint16_t TransmissionIntervalOffset, bool UseIntervalLimits=false, uint32_t IntervalMax=N2k_MAX_TRANSMISSION_INTERVAL, uint32_t IntervalMin=50, bool UseOffsetLimits=false, uint16_t OffsetMax=N2k_MAX_TRANSMISSION_INTERVAL_OFFSET)
Get request group function transmission or priority error code.
static void SetStartAcknowledge(tN2kMsg &N2kMsg, unsigned char Destination, unsigned long PGN, tN2kGroupFunctionPGNErrorCode PGNErrorCode, tN2kGroupFunctionTransmissionOrPriorityErrorCode TransmissionOrPriorityErrorCode, uint8_t NumberOfParameterPairs=0)
Setting up the group function message for Acknowledge.
tNMEA2000 * pNMEA2000
NMEA2000 object in order to send messages to the bus
static bool StartParseCommandPairParameters(const tN2kMsg &N2kMsg, int &Index)
Get start Index of pair parameters from command group function message.
unsigned long PGN
Parameter Group Number (PGN) of this Group Function.
virtual bool HandleRequest(const tN2kMsg &N2kMsg, uint32_t TransmissionInterval, uint16_t TransmissionIntervalOffset, uint8_t NumberOfParameterPairs, int iDev)
Handle response for request group function.
static void AddAcknowledgeParameter(tN2kMsg &N2kMsg, uint8_t ParameterPairIndex, tN2kGroupFunctionParameterErrorCode ErrorCode=N2kgfpec_ReadOrWriteIsNotSupported)
Add parameter error code to acknowledge group function message.
This class contains all the data of an NMEA2000 message.
bool GetVarStr(size_t &StrBufSize, char *StrBuf, int &Index) const
Get a string out of Data This method determines the length of the string by it self,...
bool IsTPMessage() const
Determine if the message is flagged as MultiPacket Message.
uint16_t Get2ByteUInt(int &Index, uint16_t def=0xffff) const
Get an unsigned integer from 2 bytes out of Data.
unsigned char Source
Source of the NMEA2000 message.
uint32_t Get3ByteUInt(int &Index, uint32_t def=0xffffffff) const
Get an unsigned integer from 3 bytes out of Data.
unsigned char GetByte(int &Index) const
Get the value from a byte out of Data.
bool GetStr(char *StrBuf, size_t Length, int &Index) const
Get a string out of Data.
unsigned char Destination
Destination of the NMEA2000 message.
void SendHeartbeat(int iDev)
Send heartbeat for specific device.
void SetInstallationDescription1(const char *InstallationDescription1)
Set the Installation Description 1 of this device.
const tDeviceInformation GetDeviceInformation(int iDev=0)
Get the Device Information.
bool SendConfigurationInformation(unsigned char Destination, int DeviceIndex, bool UseTP)
Send a Config Information message.
unsigned char GetCertificationLevel(int iDev=0) const
Get the Certification Level of the device.
static bool IsBroadcast(unsigned char Source)
Checks if the given Address is a broadcast address.
void SendIsoAddressClaim(unsigned char Destination=0xff, int DeviceIndex=0, unsigned long FromNow=0)
Send an IsoAddressClaim message.
void GetManufacturerInformation(char *buf, size_t max_len)
Get the Manufacturer Information of this device.
bool SendMsg(const tN2kMsg &N2kMsg, int DeviceIndex=0)
Send message to the NMEA2000 bus.
void GetInstallationDescription1(char *buf, size_t max_len)
Get the Install Description 1 of this device.
void SetHeartbeatIntervalAndOffset(uint32_t interval, uint32_t offset=0, int iDev=-1)
Set the Heartbeat Interval and Offset for a device.
void SendRxPGNList(unsigned char Destination, int DeviceIndex, bool UseTP=false)
Send a list with all supported Receive messages.
void SendTxPGNList(unsigned char Destination, int DeviceIndex, bool UseTP=false)
Send a list with all supported Transmit messages.
unsigned short GetN2kVersion(int iDev=0) const
Get the N2k standard version of the device.
bool SendProductInformation(unsigned char Destination, int DeviceIndex, bool UseTP)
Send a Product Information message.
void SetInstallationDescription2(const char *InstallationDescription2)
Set the Installation Description 2 of this device.
void SetDeviceInformationInstances(uint8_t _DeviceInstanceLower=0xff, uint8_t _DeviceInstanceUpper=0xff, uint8_t _SystemInstance=0xff, int iDev=0)
Set the Device Information Instances.
void GetInstallationDescription2(char *buf, size_t max_len)
Get the Install Description 2 of this device.
unsigned short GetProductCode(int iDev=0) const
Get the Product Code of the device.
void GetModelID(char *buf, size_t max_len, int iDev=0) const
Get the ModelID of the device.
unsigned char GetLoadEquivalency(int iDev=0) const
Get the Load Equivalency of this device.