NMEA2000 Library
0.1
Library to handle NMEA 2000 Communication written in C++
|
This class contains all the data of an NMEA2000 message. More...
#include <N2kMsg.h>
Public Member Functions | |
tN2kMsg (unsigned char _Source=15, unsigned char _Priority=6, unsigned long _PGN=0, int _DataLen=0) | |
Construct a new t N2k Msg object. More... | |
void | Add1ByteDouble (double v, double precision, double UndefVal=N2kDoubleNA) |
Add double value to the buffer using 1 byte. More... | |
void | Add1ByteUDouble (double v, double precision, double UndefVal=N2kDoubleNA) |
Add double value to the buffer using 1 byte. More... | |
void | Add2ByteDouble (double v, double precision, double UndefVal=N2kDoubleNA) |
Add double value to the buffer using 2 bytes. More... | |
void | Add2ByteInt (int16_t v) |
Add integer value to the buffer using 2 bytes The value will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | Add2ByteUDouble (double v, double precision, double UndefVal=N2kDoubleNA) |
Add double value to the buffer using 2 bytes. More... | |
void | Add2ByteUInt (uint16_t v) |
Add unsigned integer value to the buffer using 2 bytes The value will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | Add3ByteDouble (double v, double precision, double UndefVal=N2kDoubleNA) |
Add double value to the buffer using 3 bytes. More... | |
void | Add3ByteInt (int32_t v) |
Add integer value to the buffer using 3 bytes The value will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | Add4ByteDouble (double v, double precision, double UndefVal=N2kDoubleNA) |
Add double value to the buffer using 4 bytes. More... | |
void | Add4ByteUDouble (double v, double precision, double UndefVal=N2kDoubleNA) |
Add double value to the buffer using 4 bytes. More... | |
void | Add4ByteUInt (uint32_t v) |
Add unsigned integer value to the buffer using 4 bytes The value will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | Add8ByteDouble (double v, double precision, double UndefVal=N2kDoubleNA) |
Add double value to the buffer using 8 bytes. More... | |
void | AddAISStr (const char *str, int len) |
Add string value to the buffer after filtering characters as defined in ITU-R M.1371-1 The string will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | AddBuf (const void *buf, size_t bufLen) |
Add byte array to the buffer. More... | |
void | AddByte (unsigned char v) |
Add byte value to the buffer The byte will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | AddFloat (float v, float UndefVal=N2kFloatNA) |
Add float value to the buffer This method adds a float value to the message buffer using SetBufFloat The value will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | AddStr (const char *str, int len, bool UsePgm=false, unsigned char fillChar=0xff) |
Add string value to the buffer The string will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | AddUInt64 (uint64_t v) |
Add unsigned integer value to the buffer using 8 bytes The value will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | AddVarStr (const char *str, bool UsePgm=false) |
Add string value to the buffer This method determines the length of the string by it self using strlen(). The string will be added to the end (indicated by DataLen) of the byte array Data. More... | |
void | CheckDestination () const |
Validation check for the message destination We can send to specified destination only for PGN:s low byte=0. More... | |
virtual void | Clear () |
Clears the content of the N2kMsg object The method sets the PGN, DataLen and MsgTime to zero. More... | |
void | ForceSource (unsigned char _Source) const |
Set the Source of the message. More... | |
double | Get1ByteDouble (double precision, int &Index, double def=N2kDoubleNA) const |
Get a double from 1 bytes out of Data The fixed point integer mechanism is used. More... | |
double | Get1ByteUDouble (double precision, int &Index, double def=N2kDoubleNA) const |
Get a double from 1 bytes out of Data The fixed point integer mechanism is used. More... | |
double | Get2ByteDouble (double precision, int &Index, double def=N2kDoubleNA) const |
Get a double from 2 bytes out of Data The fixed point integer mechanism is used. More... | |
int16_t | Get2ByteInt (int &Index, int16_t def=0x7fff) const |
Get an integer from 2 bytes out of Data. More... | |
double | Get2ByteUDouble (double precision, int &Index, double def=N2kDoubleNA) const |
Get a double from 2 bytes out of Data The fixed point integer mechanism is used. More... | |
uint16_t | Get2ByteUInt (int &Index, uint16_t def=0xffff) const |
Get an unsigned integer from 2 bytes out of Data. More... | |
double | Get3ByteDouble (double precision, int &Index, double def=N2kDoubleNA) const |
Get a double from 3 bytes out of Data The fixed point integer mechanism is used. More... | |
uint32_t | Get3ByteUInt (int &Index, uint32_t def=0xffffffff) const |
Get an unsigned integer from 3 bytes out of Data. More... | |
double | Get4ByteDouble (double precision, int &Index, double def=N2kDoubleNA) const |
Get a double from 4 bytes out of Data The fixed point integer mechanism is used. More... | |
double | Get4ByteUDouble (double precision, int &Index, double def=N2kDoubleNA) const |
Get a double from 4 bytes out of Data The fixed point integer mechanism is used. More... | |
uint32_t | Get4ByteUInt (int &Index, uint32_t def=0xffffffff) const |
Get an unsigned integer from 4 bytes out of Data. More... | |
double | Get8ByteDouble (double precision, int &Index, double def=N2kDoubleNA) const |
Get a double from 8 bytes out of Data The fixed point integer mechanism is used. More... | |
int | GetAvailableDataLength () const |
Get the Available Data Length The method calculates the available data length with MaxDataLen - DataLen. More... | |
bool | GetBuf (void *buf, size_t Length, int &Index) const |
Get a byte array out of Data. More... | |
unsigned char | GetByte (int &Index) const |
Get the value from a byte out of Data. More... | |
float | GetFloat (int &Index, float def=N2kFloatNA) const |
Get a float out of Data. More... | |
int | GetRemainingDataLength (int Index) const |
Get the Remaining Data Length. More... | |
bool | GetStr (char *StrBuf, size_t Length, int &Index) const |
Get a string out of Data. More... | |
bool | GetStr (size_t StrBufSize, char *StrBuf, size_t Length, unsigned char nulChar, int &Index) const |
Get a string out of Data. More... | |
uint64_t | GetUInt64 (int &Index, uint64_t def=0xffffffffffffffffULL) const |
Get an unsigned integer from 8 bytes out of Data. More... | |
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, using the byte (index -2) inside Data. More... | |
void | Init (unsigned char _Priority, unsigned long _PGN, unsigned char _Source, unsigned char _Destination=0xff) |
Initialisation of the N2kMsg object. More... | |
bool | IsTPMessage () const |
Determine if the message is flagged as MultiPacket Message. More... | |
bool | IsValid () const |
Checks if the Message Meta Content is valid Basic check if the message object is valid, mean datalen >0 and PGN != 0. More... | |
void | Print (N2kStream *port, bool NoData=false) const |
Print out the whole content of the N2kMsg Object. More... | |
void | SendInActisenseFormat (N2kStream *port) const |
Print out the whole content of the N2kMsg Object using the Actisense Format. More... | |
bool | Set2ByteUInt (uint16_t v, int &Index) |
Set a 2byte unsigned integer in Data. More... | |
bool | SetByte (uint8_t v, int &Index) |
Set a byte in Data. More... | |
void | SetIsTPMessage (bool tp=true) |
Set the MultiPacket Message status. More... | |
void | SetPGN (unsigned long _PGN) |
Set the Parameter Group Number of the message *. More... | |
Public Attributes | |
unsigned char | Data [MaxDataLen] |
Byte array which carries all the data of the NMEA2000 message. More... | |
int | DataLen |
Number of bytes already stored in tN2kMsg::Data of this message. More... | |
unsigned char | Destination |
Destination of the NMEA2000 message. More... | |
unsigned long | MsgTime |
timestamp (ms since start [max 49days]) of the NMEA2000 message More... | |
unsigned long | PGN |
Parameter Group Number (PGN) of the NMEA2000 message. More... | |
unsigned char | Priority |
Priority of the NMEA2000 message. More... | |
unsigned char | Source |
Source of the NMEA2000 message. More... | |
Static Public Attributes | |
static const int | MaxDataLen =223 |
Maximum number of bytes that can be stored in the data buffer With fast packet the first frame can have 6 byte and rest 31 frames 7 bytes. More... | |
Protected Member Functions | |
void | ResetData () |
Fills the whole data buffer with 0xff. More... | |
Protected Attributes | |
bool | TPMessage |
Message is a MultiPacket Message. More... | |
This class contains all the data of an NMEA2000 message.
The class tN2kMsg holds all necessary data of an NMEA2000 message. An object of this class will be passed to the SetN2kPGNxxxx function and there it is "filled" with the corresponding data. To extract data out of a NMEA2000 message, the ParseN2kPGNxxxx functions can be used.
tN2kMsg::tN2kMsg | ( | unsigned char | _Source = 15 , |
unsigned char | _Priority = 6 , |
||
unsigned long | _PGN = 0 , |
||
int | _DataLen = 0 |
||
) |
Construct a new t N2k Msg object.
_Source | Source address of the NMEA2000 device sending this message [range 0 .. 251] default = 15 |
_Priority | Priority of the Message [0 .. 7] default = 6 |
_PGN | Parameter Group Number [decimal] |
_DataLen | Length off the data field |
Definition at line 60 of file N2kMsg.cpp.
void tN2kMsg::Add1ByteDouble | ( | double | v, |
double | precision, | ||
double | UndefVal = N2kDoubleNA |
||
) |
Add double value to the buffer using 1 byte.
The fixed point integer mechanism is used. The value will be added to the end (indicated by DataLen) of the byte array Data.
precision | the value is rounded to the given precision (e.g. 0.01) |
v | value to add |
UndefVal | "not available" value |
Definition at line 165 of file N2kMsg.cpp.
void tN2kMsg::Add1ByteUDouble | ( | double | v, |
double | precision, | ||
double | UndefVal = N2kDoubleNA |
||
) |
Add double value to the buffer using 1 byte.
The fixed point integer mechanism is used. The value will be added to the end (indicated by DataLen) of the byte array Data.
precision | the value is rounded to the given precision (e.g. 0.01) |
v | value to add |
UndefVal | "not available" value |
Definition at line 174 of file N2kMsg.cpp.
void tN2kMsg::Add2ByteDouble | ( | double | v, |
double | precision, | ||
double | UndefVal = N2kDoubleNA |
||
) |
Add double value to the buffer using 2 bytes.
The fixed point integer mechanism is used. The value will be added to the end (indicated by DataLen) of the byte array Data.
precision | the value is rounded to the given precision (e.g. 0.01) |
v | value to add |
UndefVal | "not available" value |
Definition at line 147 of file N2kMsg.cpp.
void tN2kMsg::Add2ByteInt | ( | int16_t | v | ) |
Add integer value to the buffer using 2 bytes The value will be added to the end (indicated by DataLen) of the byte array Data.
v | value to add |
Definition at line 183 of file N2kMsg.cpp.
void tN2kMsg::Add2ByteUDouble | ( | double | v, |
double | precision, | ||
double | UndefVal = N2kDoubleNA |
||
) |
Add double value to the buffer using 2 bytes.
The fixed point integer mechanism is used. The value will be added to the end (indicated by DataLen) of the byte array Data.
precision | the value is rounded to the given precision (e.g. 0.01) |
v | value to add |
UndefVal | "not available" value |
Definition at line 156 of file N2kMsg.cpp.
void tN2kMsg::Add2ByteUInt | ( | uint16_t | v | ) |
Add unsigned integer value to the buffer using 2 bytes The value will be added to the end (indicated by DataLen) of the byte array Data.
v | value to add |
Definition at line 188 of file N2kMsg.cpp.
void tN2kMsg::Add3ByteDouble | ( | double | v, |
double | precision, | ||
double | UndefVal = N2kDoubleNA |
||
) |
Add double value to the buffer using 3 bytes.
The fixed point integer mechanism is used. The value will be added to the end (indicated by DataLen) of the byte array Data.
precision | the value is rounded to the given precision (e.g. 0.01) |
v | value to add |
UndefVal | "not available" value |
Definition at line 138 of file N2kMsg.cpp.
void tN2kMsg::Add3ByteInt | ( | int32_t | v | ) |
Add integer value to the buffer using 3 bytes The value will be added to the end (indicated by DataLen) of the byte array Data.
v | value to add |
Definition at line 193 of file N2kMsg.cpp.
void tN2kMsg::Add4ByteDouble | ( | double | v, |
double | precision, | ||
double | UndefVal = N2kDoubleNA |
||
) |
Add double value to the buffer using 4 bytes.
The fixed point integer mechanism is used. The value will be added to the end (indicated by DataLen) of the byte array Data.
precision | the value is rounded to the given precision (e.g. 0.01) |
v | value to add |
UndefVal | "not available" value |
Definition at line 120 of file N2kMsg.cpp.
void tN2kMsg::Add4ByteUDouble | ( | double | v, |
double | precision, | ||
double | UndefVal = N2kDoubleNA |
||
) |
Add double value to the buffer using 4 bytes.
The fixed point integer mechanism is used. The value will be added to the end (indicated by DataLen) of the byte array Data.
precision | the value is rounded to the given precision (e.g. 0.01) |
v | value to add |
UndefVal | "not available" value |
Definition at line 129 of file N2kMsg.cpp.
void tN2kMsg::Add4ByteUInt | ( | uint32_t | v | ) |
Add unsigned integer value to the buffer using 4 bytes The value will be added to the end (indicated by DataLen) of the byte array Data.
v | value to add |
Definition at line 198 of file N2kMsg.cpp.
void tN2kMsg::Add8ByteDouble | ( | double | v, |
double | precision, | ||
double | UndefVal = N2kDoubleNA |
||
) |
Add double value to the buffer using 8 bytes.
The fixed point integer mechanism is used. The value will be added to the end (indicated by DataLen) of the byte array Data.
precision | the value is rounded to the given precision (e.g. 0.01) |
v | value to add |
UndefVal | "not available" value |
Definition at line 110 of file N2kMsg.cpp.
void tN2kMsg::AddAISStr | ( | const char * | str, |
int | len | ||
) |
Add string value to the buffer after filtering characters as defined in ITU-R M.1371-1 The string will be added to the end (indicated by DataLen) of the byte array Data.
str | String as pointer to a char array |
len | Length of the string |
Definition at line 221 of file N2kMsg.cpp.
void tN2kMsg::AddBuf | ( | const void * | buf, |
size_t | bufLen | ||
) |
Add byte array to the buffer.
The buffer will be added to the end (indicated by DataLen) of the byte array Data.
buf | Pointer to the byte array |
bufLen | Number of bytes to add |
Definition at line 242 of file N2kMsg.cpp.
void tN2kMsg::AddByte | ( | unsigned char | v | ) |
Add byte value to the buffer The byte will be added to the end (indicated by DataLen) of the byte array Data.
v | value to add |
Definition at line 208 of file N2kMsg.cpp.
void tN2kMsg::AddFloat | ( | float | v, |
float | UndefVal = N2kFloatNA |
||
) |
Add float value to the buffer This method adds a float value to the message buffer using SetBufFloat The value will be added to the end (indicated by DataLen) of the byte array Data.
v | value to add |
UndefVal | "not available" value |
Definition at line 101 of file N2kMsg.cpp.
void tN2kMsg::AddStr | ( | const char * | str, |
int | len, | ||
bool | UsePgm = false , |
||
unsigned char | fillChar = 0xff |
||
) |
Add string value to the buffer The string will be added to the end (indicated by DataLen) of the byte array Data.
str | String as pointer to a char array |
len | Length of the string |
UsePgm | {bool} use the pgm_read_byte function |
fillChar | character to for padding at end of strings |
Definition at line 213 of file N2kMsg.cpp.
void tN2kMsg::AddUInt64 | ( | uint64_t | v | ) |
Add unsigned integer value to the buffer using 8 bytes The value will be added to the end (indicated by DataLen) of the byte array Data.
v | value to add |
Definition at line 203 of file N2kMsg.cpp.
void tN2kMsg::AddVarStr | ( | const char * | str, |
bool | UsePgm = false |
||
) |
Add string value to the buffer This method determines the length of the string by it self using strlen(). The string will be added to the end (indicated by DataLen) of the byte array Data.
str | String as pointer to a char array |
UsePgm | {bool} use the pgm_read_byte function |
Definition at line 234 of file N2kMsg.cpp.
|
inline |
|
virtual |
Clears the content of the N2kMsg object The method sets the PGN, DataLen and MsgTime to zero.
Definition at line 94 of file N2kMsg.cpp.
|
inline |
double tN2kMsg::Get1ByteDouble | ( | double | precision, |
int & | Index, | ||
double | def = N2kDoubleNA |
||
) | const |
Get a double from 1 bytes out of Data The fixed point integer mechanism is used.
precision | the value is rounded to the given precision (e.g. 0.01) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 296 of file N2kMsg.cpp.
double tN2kMsg::Get1ByteUDouble | ( | double | precision, |
int & | Index, | ||
double | def = N2kDoubleNA |
||
) | const |
Get a double from 1 bytes out of Data The fixed point integer mechanism is used.
precision | the value is rounded to the given precision (e.g. 0.01) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 303 of file N2kMsg.cpp.
double tN2kMsg::Get2ByteDouble | ( | double | precision, |
int & | Index, | ||
double | def = N2kDoubleNA |
||
) | const |
Get a double from 2 bytes out of Data The fixed point integer mechanism is used.
precision | the value is rounded to the given precision (e.g. 0.01) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 310 of file N2kMsg.cpp.
int16_t tN2kMsg::Get2ByteInt | ( | int & | Index, |
int16_t | def = 0x7fff |
||
) | const |
Get an integer from 2 bytes out of Data.
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 261 of file N2kMsg.cpp.
double tN2kMsg::Get2ByteUDouble | ( | double | precision, |
int & | Index, | ||
double | def = N2kDoubleNA |
||
) | const |
Get a double from 2 bytes out of Data The fixed point integer mechanism is used.
precision | the value is rounded to the given precision (e.g. 0.01) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 317 of file N2kMsg.cpp.
uint16_t tN2kMsg::Get2ByteUInt | ( | int & | Index, |
uint16_t | def = 0xffff |
||
) | const |
Get an unsigned integer from 2 bytes out of Data.
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 268 of file N2kMsg.cpp.
double tN2kMsg::Get3ByteDouble | ( | double | precision, |
int & | Index, | ||
double | def = N2kDoubleNA |
||
) | const |
Get a double from 3 bytes out of Data The fixed point integer mechanism is used.
precision | the value is rounded to the given precision (e.g. 0.01) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 324 of file N2kMsg.cpp.
uint32_t tN2kMsg::Get3ByteUInt | ( | int & | Index, |
uint32_t | def = 0xffffffff |
||
) | const |
Get an unsigned integer from 3 bytes out of Data.
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 275 of file N2kMsg.cpp.
double tN2kMsg::Get4ByteDouble | ( | double | precision, |
int & | Index, | ||
double | def = N2kDoubleNA |
||
) | const |
Get a double from 4 bytes out of Data The fixed point integer mechanism is used.
precision | the value is rounded to the given precision (e.g. 0.01) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 331 of file N2kMsg.cpp.
double tN2kMsg::Get4ByteUDouble | ( | double | precision, |
int & | Index, | ||
double | def = N2kDoubleNA |
||
) | const |
Get a double from 4 bytes out of Data The fixed point integer mechanism is used.
precision | the value is rounded to the given precision (e.g. 0.01) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 338 of file N2kMsg.cpp.
uint32_t tN2kMsg::Get4ByteUInt | ( | int & | Index, |
uint32_t | def = 0xffffffff |
||
) | const |
Get an unsigned integer from 4 bytes out of Data.
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 282 of file N2kMsg.cpp.
double tN2kMsg::Get8ByteDouble | ( | double | precision, |
int & | Index, | ||
double | def = N2kDoubleNA |
||
) | const |
Get a double from 8 bytes out of Data The fixed point integer mechanism is used.
precision | the value is rounded to the given precision (e.g. 0.01) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 345 of file N2kMsg.cpp.
|
inline |
Get the Available Data Length The method calculates the available data length with MaxDataLen - DataLen.
bool tN2kMsg::GetBuf | ( | void * | buf, |
size_t | Length, | ||
int & | Index | ||
) | const |
Get a byte array out of Data.
buf | Pointer to byte array |
Length | Length of byte array to be extracted |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
Definition at line 430 of file N2kMsg.cpp.
unsigned char tN2kMsg::GetByte | ( | int & | Index | ) | const |
Get the value from a byte out of Data.
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
Definition at line 254 of file N2kMsg.cpp.
float tN2kMsg::GetFloat | ( | int & | Index, |
float | def = N2kFloatNA |
||
) | const |
Get a float out of Data.
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 352 of file N2kMsg.cpp.
|
inline |
bool tN2kMsg::GetStr | ( | char * | StrBuf, |
size_t | Length, | ||
int & | Index | ||
) | const |
Get a string out of Data.
StrBuf | Pointer to a char array as string |
Length | Length of the string |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
Definition at line 359 of file N2kMsg.cpp.
bool tN2kMsg::GetStr | ( | size_t | StrBufSize, |
char * | StrBuf, | ||
size_t | Length, | ||
unsigned char | nulChar, | ||
int & | Index | ||
) | const |
Get a string out of Data.
StrBufSize | Size of String Buffer |
StrBuf | Pointer to a char array as string |
Length | Length of the string |
nulChar | used "null Char" in the message (e.g. '@' in AIS) |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
Definition at line 385 of file N2kMsg.cpp.
uint64_t tN2kMsg::GetUInt64 | ( | int & | Index, |
uint64_t | def = 0xffffffffffffffffULL |
||
) | const |
Get an unsigned integer from 8 bytes out of Data.
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
def | default value when data is unavailable |
Definition at line 289 of file N2kMsg.cpp.
bool tN2kMsg::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, using the byte (index -2) inside Data.
StrBufSize | Size of String Buffer |
StrBuf | Pointer to a char array as string |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
Definition at line 416 of file N2kMsg.cpp.
void tN2kMsg::Init | ( | unsigned char | _Priority, |
unsigned long | _PGN, | ||
unsigned char | _Source, | ||
unsigned char | _Destination = 0xff |
||
) |
Initialisation of the N2kMsg object.
_Priority | Priority of the Message [0 .. 7] |
_PGN | Parameter Group Number [decimal] |
_Source | Source address of the NMEA2000 device sending this message [range 0 .. 251] |
_Destination | Destination address of the NMEA2000 device sending this message [range 0 .. 251] |
Definition at line 75 of file N2kMsg.cpp.
|
inline |
|
inline |
void tN2kMsg::Print | ( | N2kStream * | port, |
bool | NoData = false |
||
) | const |
Print out the whole content of the N2kMsg Object.
port | port where to stream, see N2kStream |
NoData | if true the data buffer will not be printed |
Definition at line 824 of file N2kMsg.cpp.
|
protected |
Fills the whole data buffer with 0xff.
Definition at line 87 of file N2kMsg.cpp.
void tN2kMsg::SendInActisenseFormat | ( | N2kStream * | port | ) | const |
Print out the whole content of the N2kMsg Object using the Actisense Format.
port | port where to stream, see N2kStream |
Definition at line 853 of file N2kMsg.cpp.
bool tN2kMsg::Set2ByteUInt | ( | uint16_t | v, |
int & | Index | ||
) |
Set a 2byte unsigned integer in Data.
v | Value to add |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
Definition at line 457 of file N2kMsg.cpp.
bool tN2kMsg::SetByte | ( | uint8_t | v, |
int & | Index | ||
) |
Set a byte in Data.
v | Value to add |
Index | position inside the byte array Data, getting incremented according to the number of bytes extracted |
Definition at line 447 of file N2kMsg.cpp.
|
inline |
void tN2kMsg::SetPGN | ( | unsigned long | _PGN | ) |
Set the Parameter Group Number of the message *.
_PGN | Parameter Group Number [decimal] |
Definition at line 68 of file N2kMsg.cpp.
unsigned char tN2kMsg::Data[MaxDataLen] |
int tN2kMsg::DataLen |
Number of bytes already stored in tN2kMsg::Data of this message.
|
mutable |
|
static |
unsigned long tN2kMsg::MsgTime |
unsigned long tN2kMsg::PGN |
unsigned char tN2kMsg::Priority |
|
mutable |
|
protected |