NMEA2000 Library
0.1
Library to handle NMEA 2000 Communication written in C++
|
This File contains the class tN2kMsg and all necessary functions to handle a NMEA2000 Message. More...
Go to the source code of this file.
Classes | |
class | tN2kMsg |
This class contains all the data of an NMEA2000 message. More... | |
Macros | |
#define | BIT(n) (1 << n) |
Functions | |
double | GetBuf1ByteDouble (double precision, int &index, const unsigned char *buf, double def=0) |
Extracts the specified numbers of bytes out of the given buffer and converts it to a double value. More... | |
double | GetBuf1ByteUDouble (double precision, int &index, const unsigned char *buf, double def=-1) |
Extracts 1 byte out of the given buffer and converts it to a double value. More... | |
double | GetBuf2ByteDouble (double precision, int &index, const unsigned char *buf, double def=0) |
Extracts 2 bytes out of the given buffer and converts it to a double value. More... | |
int16_t | GetBuf2ByteInt (int &index, const unsigned char *buf) |
Extracts 2 bytes out of the given buffer and converts it to an integer value. More... | |
double | GetBuf2ByteUDouble (double precision, int &index, const unsigned char *buf, double def=-1) |
Extracts 2 bytes out of the given buffer and converts it to a double value. More... | |
uint16_t | GetBuf2ByteUInt (int &index, const unsigned char *buf) |
Extracts 2 bytes out of the given buffer and converts it to an integer value. More... | |
double | GetBuf3ByteDouble (double precision, int &index, const unsigned char *buf, double def=0) |
Extracts 3 bytes out of the given buffer and converts it to a double value. More... | |
uint32_t | GetBuf3ByteUInt (int &index, const unsigned char *buf) |
Extracts 3 bytes out of the given buffer and converts it to an integer value. More... | |
double | GetBuf4ByteDouble (double precision, int &index, const unsigned char *buf, double def=0) |
Extracts 4 bytes out of the given buffer and converts it to a double value. More... | |
double | GetBuf4ByteUDouble (double precision, int &index, const unsigned char *buf, double def=-1) |
Extracts 4 bytes out of the given buffer and converts it to a double value. More... | |
uint32_t | GetBuf4ByteUInt (int &index, const unsigned char *buf) |
Extracts 4 bytes out of the given buffer and converts it to an integer value. More... | |
double | GetBuf8ByteDouble (double precision, int &index, const unsigned char *buf, double def=0) |
Extracts 8 bytes out of the given buffer and converts it to a double value. More... | |
uint64_t | GetBuf8ByteUInt (int &index, const unsigned char *buf) |
Extracts 8 bytes out of the given buffer and converts it to an integer value. More... | |
double | GetBufDouble (int &index, const unsigned char *buf, double def=0) |
Extracts bytes out of the given buffer and converts it to a double value. More... | |
float | GetBufFloat (int &index, const unsigned char *buf, float def=0) |
Extracts the specified numbers of bytes out of the given buffer and converts it to an float value. More... | |
bool | N2kIsNA (double v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (float v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (int16_t v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (int32_t v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (int64_t v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (int8_t v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (uint16_t v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (uint32_t v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (uint64_t v) |
Verify that the specified value is equal to "Not available". More... | |
bool | N2kIsNA (uint8_t v) |
Verify that the specified value is equal to "Not available". More... | |
void | PrintBuf (N2kStream *port, unsigned char len, const unsigned char *pData, bool AddLF=false) |
Print out a buffer (byte array) More... | |
void | SetBuf1ByteDouble (double v, double precision, int &index, unsigned char *buf) |
Writes a double signed value into a byte array buffer using 1 byte. More... | |
void | SetBuf1ByteUDouble (double v, double precision, int &index, unsigned char *buf) |
Writes a double unsigned value into a byte array buffer using 1 byte. More... | |
void | SetBuf2ByteDouble (double v, double precision, int &index, unsigned char *buf) |
Writes a double signed value into a byte array buffer using 2 bytes. More... | |
void | SetBuf2ByteInt (int16_t v, int &index, unsigned char *buf) |
Writes an integer value into a byte array buffer using 2 bytes To write a integer value into a certain position of an byte array buffer the function memcpy is used. More... | |
void | SetBuf2ByteUDouble (double v, double precision, int &index, unsigned char *buf) |
Writes a double unsigned value into a byte array buffer using 2 bytes. More... | |
void | SetBuf2ByteUInt (uint16_t v, int &index, unsigned char *buf) |
Writes an unsigned integer value into a byte array buffer using 2 bytes. More... | |
void | SetBuf3ByteDouble (double v, double precision, int &index, unsigned char *buf) |
Writes a double signed value into a byte array buffer using 3 bytes. More... | |
void | SetBuf3ByteInt (int32_t v, int &index, unsigned char *buf) |
Writes an integer value into a byte array buffer using 3 bytes To write a integer value into a certain position of an byte array buffer the function memcpy is used. More... | |
void | SetBuf4ByteDouble (double v, double precision, int &index, unsigned char *buf) |
Writes a double signed value into a byte array buffer using 4 bytes. More... | |
void | SetBuf4ByteUDouble (double v, double precision, int &index, unsigned char *buf) |
Writes a double unsigned value into a byte array buffer using 4 bytes. More... | |
void | SetBuf4ByteUInt (uint32_t v, int &index, unsigned char *buf) |
Writes an unsigned integer value into a byte array buffer u ing 4 bytes To write a integer value into a certain position of an byte array buffer the function memcpy is used. More... | |
void | SetBuf8ByteDouble (double v, double precision, int &index, unsigned char *buf) |
Writes a double signed value into a byte array buffer using 8 bytes. More... | |
void | SetBufDouble (double v, int &index, unsigned char *buf) |
Writes a double value into a byte array buffer More... | |
void | SetBufFloat (float v, int &index, unsigned char *buf) |
Writes a float value into a byte array buffer. More... | |
void | SetBufStr (const char *str, int len, int &index, unsigned char *buf, bool UsePgm=false, unsigned char fillChar=0x0) |
Writes a string into a byte array buffer. More... | |
void | SetBufUInt64 (uint64_t v, int &index, unsigned char *buf) |
Writes an unsigned integer 64bit value into a byte array buffer using 8 bytes To write a integer value into a certain position of an byte array buffer the function memcpy is used. More... | |
Variables | |
const double | N2kDoubleNA =-1e9 |
Constant "Not Available" for a double value. More... | |
const float | N2kFloatNA =-1e9 |
Constant "Not Available" for a float value. More... | |
const int16_t | N2kInt16NA =0x7fff |
Constant "Not Available" for a signed 16bit int value. More... | |
const int32_t | N2kInt32NA =0x7fffffff |
Constant "Not Available" for a signed 32bit int value. More... | |
const int64_t | N2kInt64NA =0x7fffffffffffffffLL |
Constant "Not Available" for a signed 64bit int value. More... | |
const int8_t | N2kInt8NA =0x7f |
Constant "Not Available" for a signed 8bit value. More... | |
const uint16_t | N2kUInt16NA =0xffff |
Constant "Not Available" for a unsigned 16bit int value. More... | |
const uint32_t | N2kUInt32NA =0xffffffff |
Constant "Not Available" for a unsigned 32bit int value. More... | |
const uint64_t | N2kUInt64NA =0xffffffffffffffffLL |
Constant "Not Available" for a unsigned 64bit int value. More... | |
const uint8_t | N2kUInt8NA =0xff |
Constant "Not Available" for a unsigned 8bit int value. More... | |
This File contains the class tN2kMsg and all necessary functions to handle a 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.
As all the data on the NMEA2000 messages is stored in a byte array, there are plenty of helper functions to inject or extract certain datatypes in and out of this byte array.
Definition in file N2kMsg.h.
double GetBuf1ByteDouble | ( | double | precision, |
int & | index, | ||
const unsigned char * | buf, | ||
double | def = 0 |
||
) |
Extracts the specified numbers of bytes out of the given buffer and converts it to a double value.
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 tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 650 of file N2kMsg.cpp.
double GetBuf1ByteUDouble | ( | double | precision, |
int & | index, | ||
const unsigned char * | buf, | ||
double | def = -1 |
||
) |
Extracts 1 byte out of the given buffer and converts it to a double value.
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 tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 658 of file N2kMsg.cpp.
double GetBuf2ByteDouble | ( | double | precision, |
int & | index, | ||
const unsigned char * | buf, | ||
double | def = 0 |
||
) |
Extracts 2 bytes out of the given buffer and converts it to a double value.
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 tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 666 of file N2kMsg.cpp.
int16_t GetBuf2ByteInt | ( | int & | index, |
const unsigned char * | buf | ||
) |
Extracts 2 bytes out of the given buffer and converts it to an integer value.
index | position inside the byte array tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
Definition at line 625 of file N2kMsg.cpp.
double GetBuf2ByteUDouble | ( | double | precision, |
int & | index, | ||
const unsigned char * | buf, | ||
double | def = -1 |
||
) |
Extracts 2 bytes out of the given buffer and converts it to a double value.
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 tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 674 of file N2kMsg.cpp.
uint16_t GetBuf2ByteUInt | ( | int & | index, |
const unsigned char * | buf | ||
) |
Extracts 2 bytes out of the given buffer and converts it to an integer value.
index | position inside the byte array tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
Definition at line 630 of file N2kMsg.cpp.
double GetBuf3ByteDouble | ( | double | precision, |
int & | index, | ||
const unsigned char * | buf, | ||
double | def = 0 |
||
) |
Extracts 3 bytes out of the given buffer and converts it to a double value.
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 tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 717 of file N2kMsg.cpp.
uint32_t GetBuf3ByteUInt | ( | int & | index, |
const unsigned char * | buf | ||
) |
Extracts 3 bytes out of the given buffer and converts it to an integer value.
index | position inside the byte array tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
Definition at line 635 of file N2kMsg.cpp.
double GetBuf4ByteDouble | ( | double | precision, |
int & | index, | ||
const unsigned char * | buf, | ||
double | def = 0 |
||
) |
Extracts 4 bytes out of the given buffer and converts it to a double value.
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 tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 725 of file N2kMsg.cpp.
double GetBuf4ByteUDouble | ( | double | precision, |
int & | index, | ||
const unsigned char * | buf, | ||
double | def = -1 |
||
) |
Extracts 4 bytes out of the given buffer and converts it to a double value.
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 tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 733 of file N2kMsg.cpp.
uint32_t GetBuf4ByteUInt | ( | int & | index, |
const unsigned char * | buf | ||
) |
Extracts 4 bytes out of the given buffer and converts it to an integer value.
index | position inside the byte array tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
Definition at line 640 of file N2kMsg.cpp.
double GetBuf8ByteDouble | ( | double | precision, |
int & | index, | ||
const unsigned char * | buf, | ||
double | def = 0 |
||
) |
Extracts 8 bytes out of the given buffer and converts it to a double value.
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 tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 682 of file N2kMsg.cpp.
uint64_t GetBuf8ByteUInt | ( | int & | index, |
const unsigned char * | buf | ||
) |
Extracts 8 bytes out of the given buffer and converts it to an integer value.
index | position inside the byte array tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
Definition at line 645 of file N2kMsg.cpp.
double GetBufDouble | ( | int & | index, |
const unsigned char * | buf, | ||
double | def = 0 |
||
) |
Extracts bytes out of the given buffer and converts it to a double value.
The fixed point integer mechanism is used.
index | position inside the byte array tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 690 of file N2kMsg.cpp.
float GetBufFloat | ( | int & | index, |
const unsigned char * | buf, | ||
float | def = 0 |
||
) |
Extracts the specified numbers of bytes out of the given buffer and converts it to an float value.
index | position inside the byte array tN2kMsg::Data, getting incremented according to the number of bytes extracted |
buf | Pointer to the byte array buffer |
def | default value that will be returned if the byte array equal to "not available" |
Definition at line 704 of file N2kMsg.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void PrintBuf | ( | N2kStream * | port, |
unsigned char | len, | ||
const unsigned char * | pData, | ||
bool | AddLF = false |
||
) |
Print out a buffer (byte array)
port | port where to stream, see N2kStream |
len | Number of bytes to be printed |
pData | Pointer to the buffer |
AddLF | true will add a LineFeed at the end |
Definition at line 811 of file N2kMsg.cpp.
void SetBuf1ByteDouble | ( | double | v, |
double | precision, | ||
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double signed value into a byte array buffer using 1 byte.
To write a double value into a certain position of an byte array buffer the function memcpy is used. Out of range will be handled. So if given value can not be converted to fixed integer, "out of range" constant will be set.
There are different functions depending on how many byte should be used in the buffer. The fixed point integer mechanism is used.
v | {double} Value to be stored in the Buffer |
precision | the value is rounded to the given precision (e.g. 0.01) |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 755 of file N2kMsg.cpp.
void SetBuf1ByteUDouble | ( | double | v, |
double | precision, | ||
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double unsigned value into a byte array buffer using 1 byte.
To write a double value into a certain position of an byte array buffer the function memcpy is used. Out of range will be handled. So if given value can not be converted to fixed integer, "out of range" constant will be set.
There are different functions depending on how many byte should be used in the buffer. The fixed point integer mechanism is used.
v | {double} Value to be stored in the Buffer |
precision | the value is rounded to the given precision (e.g. 0.01) |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 762 of file N2kMsg.cpp.
void SetBuf2ByteDouble | ( | double | v, |
double | precision, | ||
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double signed value into a byte array buffer using 2 bytes.
To write a double value into a certain position of an byte array buffer the function memcpy is used. Out of range will be handled. So if given value can not be converted to fixed integer, "out of range" constant will be set.
There are different functions depending on how many byte should be used in the buffer. The fixed point integer mechanism is used.
v | {double} Value to be stored in the Buffer |
precision | the value is rounded to the given precision (e.g. 0.01) |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 741 of file N2kMsg.cpp.
void SetBuf2ByteInt | ( | int16_t | v, |
int & | index, | ||
unsigned char * | buf | ||
) |
Writes an integer value into a byte array buffer using 2 bytes To write a integer value into a certain position of an byte array buffer the function memcpy is used.
There are different functions depending on how many byte should be used in the buffer
v | Value to be stored in the Buffer |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 769 of file N2kMsg.cpp.
void SetBuf2ByteUDouble | ( | double | v, |
double | precision, | ||
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double unsigned value into a byte array buffer using 2 bytes.
To write a double value into a certain position of an byte array buffer the function memcpy is used. Out of range will be handled. So if given value can not be converted to fixed integer, "out of range" constant will be set.
There are different functions depending on how many byte should be used in the buffer. The fixed point integer mechanism is used.
v | {double} Value to be stored in the Buffer |
precision | the value is rounded to the given precision (e.g. 0.01) |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 748 of file N2kMsg.cpp.
void SetBuf2ByteUInt | ( | uint16_t | v, |
int & | index, | ||
unsigned char * | buf | ||
) |
Writes an unsigned integer value into a byte array buffer using 2 bytes.
To write a integer value into a certain position of an byte array buffer the function memcpy is used.
There are different functions depending on how many byte should be used in the buffer
v | Value to be stored in the Buffer |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 774 of file N2kMsg.cpp.
void SetBuf3ByteDouble | ( | double | v, |
double | precision, | ||
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double signed value into a byte array buffer using 3 bytes.
To write a double value into a certain position of an byte array buffer the function memcpy is used. Out of range will be handled. So if given value can not be converted to fixed integer, "out of range" constant will be set.
There are different functions depending on how many byte should be used in the buffer. The fixed point integer mechanism is used.
v | {double} Value to be stored in the Buffer |
precision | the value is rounded to the given precision (e.g. 0.01) |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 618 of file N2kMsg.cpp.
void SetBuf3ByteInt | ( | int32_t | v, |
int & | index, | ||
unsigned char * | buf | ||
) |
Writes an integer value into a byte array buffer using 3 bytes To write a integer value into a certain position of an byte array buffer the function memcpy is used.
There are different functions depending on how many byte should be used in the buffer
v | Value to be stored in the Buffer |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 779 of file N2kMsg.cpp.
void SetBuf4ByteDouble | ( | double | v, |
double | precision, | ||
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double signed value into a byte array buffer using 4 bytes.
To write a double value into a certain position of an byte array buffer the function memcpy is used. Out of range will be handled. So if given value can not be converted to fixed integer, "out of range" constant will be set.
There are different functions depending on how many byte should be used in the buffer. The fixed point integer mechanism is used.
v | {double} Value to be stored in the Buffer |
precision | the value is rounded to the given precision (e.g. 0.01) |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 604 of file N2kMsg.cpp.
void SetBuf4ByteUDouble | ( | double | v, |
double | precision, | ||
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double unsigned value into a byte array buffer using 4 bytes.
To write a double value into a certain position of an byte array buffer the function memcpy is used. Out of range will be handled. So if given value can not be converted to fixed integer, "out of range" constant will be set.
There are different functions depending on how many byte should be used in the buffer. The fixed point integer mechanism is used.
v | {double} Value to be stored in the Buffer |
precision | the value is rounded to the given precision (e.g. 0.01) |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 611 of file N2kMsg.cpp.
void SetBuf4ByteUInt | ( | uint32_t | v, |
int & | index, | ||
unsigned char * | buf | ||
) |
Writes an unsigned integer value into a byte array buffer u ing 4 bytes To write a integer value into a certain position of an byte array buffer the function memcpy is used.
There are different functions depending on how many byte should be used in the buffer
v | Value to be stored in the Buffer |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 784 of file N2kMsg.cpp.
void SetBuf8ByteDouble | ( | double | v, |
double | precision, | ||
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double signed value into a byte array buffer using 8 bytes.
To write a double value into a certain position of an byte array buffer the function memcpy is used. Out of range will be handled. So if given value can not be converted to fixed integer, "out of range" constant will be set.
There are different functions depending on how many byte should be used in the buffer. The fixed point integer mechanism is used.
v | {double} Value to be stored in the Buffer |
precision | the value is rounded to the given precision (e.g. 0.01) |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 586 of file N2kMsg.cpp.
void SetBufDouble | ( | double | v, |
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a double value into a byte array buffer
v | {double} Value to be stored in the Buffer |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 551 of file N2kMsg.cpp.
void SetBufFloat | ( | float | v, |
int & | index, | ||
unsigned char * | buf | ||
) |
Writes a float value into a byte array buffer.
To write a float value into a certain position of an byte array buffer the function memcpy is used. If the value represents "not available", the corresponding constant is copied into the buffer.
v | {float} Value to be stored in the Buffer |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 562 of file N2kMsg.cpp.
void SetBufStr | ( | const char * | str, |
int | len, | ||
int & | index, | ||
unsigned char * | buf, | ||
bool | UsePgm = false , |
||
unsigned char | fillChar = 0x0 |
||
) |
Writes a string into a byte array buffer.
str | String as pointer to a char array |
len | Length of the string |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
UsePgm | {bool} use the pgm_read_byte function |
fillChar | fill the rest of the buffer with this character |
Definition at line 794 of file N2kMsg.cpp.
void SetBufUInt64 | ( | uint64_t | v, |
int & | index, | ||
unsigned char * | buf | ||
) |
Writes an unsigned integer 64bit value into a byte array buffer using 8 bytes To write a integer value into a certain position of an byte array buffer the function memcpy is used.
There are different functions depending on how many byte should be used in the buffer
v | Value to be stored in the Buffer |
index | Position where the value should be placed inside the buffer |
buf | Pointer to the byte array buffer |
Definition at line 789 of file N2kMsg.cpp.
const double N2kDoubleNA =-1e9 |
const float N2kFloatNA =-1e9 |
const int16_t N2kInt16NA =0x7fff |
const int32_t N2kInt32NA =0x7fffffff |
const int64_t N2kInt64NA =0x7fffffffffffffffLL |
const int8_t N2kInt8NA =0x7f |
const uint16_t N2kUInt16NA =0xffff |
const uint32_t N2kUInt32NA =0xffffffff |
const uint64_t N2kUInt64NA =0xffffffffffffffffLL |