NMEA2000 Library
0.1
Library to handle NMEA 2000 Communication written in C++
|
This class represents an internal device. More...
#include <N2kDeviceList.h>
Public Member Functions | |
tInternalDevice (uint64_t _Name, uint8_t _Source=255) | |
Construct a new Internal Device object. More... | |
~tInternalDevice () | |
Destroy the Internal Device object Clean up all the memory. More... | |
void | ClearConfigurationInformationLoaded () |
Resets the Configuration Information Loaded values of the device. More... | |
void | ClearPGNListLoaded () |
Resets the PGN List Loaded values of the device. More... | |
void | ClearProductInformation () |
Clears the Product Information the device. More... | |
void | ClearProductInformationLoaded () |
Resets the Product Information Loaded values of the device. More... | |
unsigned short | GetCertificationLevel () const |
Get the Certification Level of this device. More... | |
char * | GetInstallationDescription1 () |
Get the Installation Description 1 of this device. More... | |
const char * | GetInstallationDescription1 () const |
Get the Installation Description 1 of this device. More... | |
char * | GetInstallationDescription2 () |
Get the Installation Description 2 of this device. More... | |
const char * | GetInstallationDescription2 () const |
Get the Installation Description 2 of this device. More... | |
unsigned short | GetLoadEquivalency () const |
Get the Load Equivalency (x * 50 mA) of this device. More... | |
char * | GetManufacturerInformation () |
Get the Manufacturer Information of this device. More... | |
const char * | GetManufacturerInformation () const |
Get the Manufacturer Information of this device. More... | |
const char * | GetModelID () const |
Get the Model ID of this device. More... | |
const char * | GetModelSerialCode () const |
Get the Model Serial Code of this device. More... | |
const char * | GetModelVersion () const |
Get the Model Version of this device. More... | |
unsigned short | GetN2kVersion () const |
Get the N2k version of this device. More... | |
unsigned short | GetProductCode () const |
Get the Product code of this device. More... | |
const unsigned long * | GetReceivePGNs () const |
Get the received PGNs of this device. More... | |
const char * | GetSwCode () const |
Get the Software Code of this device. More... | |
const unsigned long * | GetTransmitPGNs () const |
Get the transmitted PGNs of this device. More... | |
bool | HasConfigurationInformation () const |
Has the Configuration Information for the device already been loaded. More... | |
bool | HasProductInformation () const |
Has the Product Information for the device already been loaded. More... | |
char * | InitConfigurationInformation (size_t &_ManISize, size_t &_InstDesc1Size, size_t &_InstDesc2Size) |
Initialize the Configuration Information of this device. More... | |
unsigned long * | InitReceivePGNs (uint8_t count) |
Initialize an array for received PGNs This functions frees if needed old reservation and reserves new memory for requested number of PGNs. More... | |
unsigned long * | InitTransmitPGNs (uint8_t count) |
Initialize an array for transmitted PGNs This functions frees if needed old reservation and reserves new memory for requested number of PGNs. More... | |
bool | IsSameProductInformation (tNMEA2000::tProductInformation &Other) |
Compares two Product Informations. More... | |
bool | ReadyForRequestConfigurationInformation () |
Ready for the next request of Device Configuration Information. More... | |
bool | ReadyForRequestPGNList () |
Ready for the next request of Device PGN List. More... | |
bool | ReadyForRequestProductInformation () |
Ready for the next request of Device Product Information. More... | |
void | SetConfigurationInformationRequested () |
Increments the Number of how often the Configuration Information has already been requested and stores the timestamp. More... | |
void | SetDeviceInformation (uint64_t _Name) |
Set the Device Information. More... | |
void | SetNameRequested () |
Increments the Number of how often the name has already been requested. More... | |
void | SetPGNListRequested () |
Increments the Number of how often the PGN List has already been requested and stores the timestamp. More... | |
void | SetProductInformation (const char *_ModelSerialCode, unsigned short _ProductCode=0xffff, const char *_ModelID=0, const char *_SwCode=0, const char *_ModelVersion=0, unsigned char _LoadEquivalency=0xff, unsigned short _N2kVersion=0xffff, unsigned char _CertificationLevel=0xff) |
Set the Product Information of the device. More... | |
void | SetProductInformationRequested () |
Increments the Number of how often the Product Information has already been requested and stores the timestamp. More... | |
void | SetSource (uint8_t _Source) |
Set the Source address of the device. More... | |
bool | ShouldRequestConfigurationInformation () |
Should the Device Configuration Information be requested As long as the device Configuration Information is not set yet and the number of requests is smaller than 4, the name should be requested once more. More... | |
bool | ShouldRequestName () |
Should the Device Name be requested As long as the device name is not set yet and the number of requests is smaller than 20, the name should be requested once more. More... | |
bool | ShouldRequestPGNList () |
Should the Device PGN List be requested As long as the device PGN List is not set yet and the number of requests is smaller than 4, the name should be requested once more. More... | |
bool | ShouldRequestProductInformation () |
Should the Device Product Information be requested As long as the device Product Information is not set yet and the number of requests is smaller than 4, the name should be requested once more. More... | |
Public Member Functions inherited from tNMEA2000::tDevice | |
tDevice (uint64_t _Name, uint8_t _Source=255) | |
Construct a new Device object. More... | |
virtual | ~tDevice () |
Destroy the Device object. More... | |
virtual unsigned short | GetCertificationLevel () const =0 |
Get the certification level from the product information of this device. More... | |
unsigned long | GetCreateTime () const |
Returns the Time of Creation of this device. More... | |
unsigned char | GetDeviceClass () const |
Get the Device Class from the Device Information. More... | |
unsigned char | GetDeviceFunction () const |
Get the Device Function from the Device Information. More... | |
unsigned char | GetDeviceInstance () const |
Get the Device Instance from the Device Information. More... | |
unsigned char | GetDeviceInstanceLower () const |
Get the Device Instance (lower bits) from the Device Information. More... | |
unsigned char | GetDeviceInstanceUpper () const |
Get the Device Instance (upper bits) from the Device Information. More... | |
unsigned char | GetIndustryGroup () const |
Get the Industry Group from the Device Information. More... | |
virtual const char * | GetInstallationDescription1 () const |
Get the installation description 1 from the configuration information of this device. More... | |
virtual const char * | GetInstallationDescription2 () const |
Get the installation description 2 from the configuration information of this device. More... | |
virtual unsigned short | GetLoadEquivalency () const =0 |
Get the load equivalency from the product information of this device. More... | |
uint16_t | GetManufacturerCode () const |
Get the Manufacturer Code from the Device Information. More... | |
virtual const char * | GetManufacturerInformation () const |
Get the manufacturer information from the configuration information of this device. More... | |
virtual const char * | GetModelID () const =0 |
Get the model ID from the product information of this device. More... | |
virtual const char * | GetModelSerialCode () const =0 |
Get the model serial code from the product information of this device. More... | |
virtual const char * | GetModelVersion () const =0 |
Get the model version from the product information of this device. More... | |
virtual unsigned short | GetN2kVersion () const =0 |
Get N2k Standard version from the product information of this device. More... | |
uint64_t | GetName () const |
Get the Name of this device. More... | |
virtual unsigned short | GetProductCode () const =0 |
Get the product code from the product information of this device. More... | |
virtual const unsigned long * | GetReceivePGNs () const |
Get the list of received PGNs from this device. More... | |
uint8_t | GetSource () const |
Returns the Source Address of this device. More... | |
virtual const char * | GetSwCode () const =0 |
Get the Software version code from the product information of this device. More... | |
unsigned char | GetSystemInstance () const |
Get the System Instance from the Device Information. More... | |
virtual const unsigned long * | GetTransmitPGNs () const |
Get the list of transmitted PGNs from this device. More... | |
uint32_t | GetUniqueNumber () const |
Get the unique Number from the Device Information. More... | |
bool | IsSame (uint64_t Other) |
Check if two devices are the same, by comparing the device name. More... | |
Public Attributes | |
unsigned long | ConfIRequested |
Time for last request on the Config Information. More... | |
unsigned long | LastMessageTime |
Time of the last message. More... | |
uint8_t | nConfIRequested |
How many times we have requested the Config information. More... | |
uint8_t | nNameRequested |
How many times we have requested the name. More... | |
uint8_t | nPGNsRequested |
How many times we have requested the PGN. More... | |
uint8_t | nProdIRequested |
How many times we have requested the Product information. More... | |
unsigned long | PGNsRequested |
Time for last request on the PGN. More... | |
unsigned long | ProdIRequested |
Time for last request on the Product Information. More... | |
Protected Attributes | |
char * | ConfI |
Pointer to the Config Information. More... | |
bool | ConfILoaded |
Product Information has been loaded. More... | |
uint16_t | ConfISize |
Size of the Config Information (number of bytes) More... | |
char * | InstallationDescription1 |
Pointer to the Installation Description 1. More... | |
char * | InstallationDescription2 |
Pointer to the Installation Description 2. More... | |
uint16_t | InstDesc1Size |
Size of the Installation Description 1 (number of bytes) More... | |
uint16_t | InstDesc2Size |
Size of the Installation Description 2 (number of bytes) More... | |
uint16_t | ManISize |
Size of the Manufacturer Information (number of bytes) More... | |
char * | ManufacturerInformation |
Pointer to the Manufacturer Information. More... | |
tNMEA2000::tProductInformation | ProdI |
Product Information of this device. More... | |
bool | ProdILoaded |
Product Information has been loaded. More... | |
unsigned long * | ReceivePGNs |
Received PGNs. More... | |
uint8_t | ReceivePGNsSize |
Size of the received PGN (number of bytes) More... | |
unsigned long * | TransmitPGNs |
Transmitted PGNs. More... | |
uint8_t | TransmitPGNsSize |
Size of the transmitted PGN (number of bytes) More... | |
Protected Attributes inherited from tNMEA2000::tDevice | |
unsigned long | CreateTime |
Timestamp when this device was created. More... | |
tDeviceInformation | DevI |
This object holds all necessary device informations. More... | |
uint8_t | Source |
Source address on bus for this device. More... | |
This class represents an internal device.
This class is derived from tNMEA2000::tDevice
Definition at line 80 of file N2kDeviceList.h.
tN2kDeviceList::tInternalDevice::tInternalDevice | ( | uint64_t | _Name, |
uint8_t | _Source = 255 |
||
) |
Construct a new Internal Device object.
Init all the variables of the Internal device.
_Name | Name of the device |
_Source | Source address of this device on the bus |
Definition at line 412 of file N2kDeviceList.cpp.
tN2kDeviceList::tInternalDevice::~tInternalDevice | ( | ) |
Destroy the Internal Device object Clean up all the memory.
Definition at line 423 of file N2kDeviceList.cpp.
|
inline |
Resets the Configuration Information Loaded values of the device.
Definition at line 384 of file N2kDeviceList.h.
|
inline |
Resets the PGN List Loaded values of the device.
Definition at line 414 of file N2kDeviceList.h.
|
inline |
Clears the Product Information the device.
Definition at line 344 of file N2kDeviceList.h.
|
inline |
Resets the Product Information Loaded values of the device.
Definition at line 341 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Certification Level of this device.
Implements tNMEA2000::tDevice.
Definition at line 236 of file N2kDeviceList.h.
|
inline |
Get the Installation Description 1 of this device.
Definition at line 290 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Installation Description 1 of this device.
Reimplemented from tNMEA2000::tDevice.
Definition at line 259 of file N2kDeviceList.h.
|
inline |
Get the Installation Description 2 of this device.
Definition at line 295 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Installation Description 2 of this device.
Reimplemented from tNMEA2000::tDevice.
Definition at line 264 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Load Equivalency (x * 50 mA) of this device.
Implements tNMEA2000::tDevice.
Definition at line 241 of file N2kDeviceList.h.
|
inline |
Get the Manufacturer Information of this device.
Definition at line 285 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Manufacturer Information of this device.
Reimplemented from tNMEA2000::tDevice.
Definition at line 254 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Model ID of this device.
Implements tNMEA2000::tDevice.
Definition at line 216 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Model Serial Code of this device.
Implements tNMEA2000::tDevice.
Definition at line 231 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Model Version of this device.
Implements tNMEA2000::tDevice.
Definition at line 226 of file N2kDeviceList.h.
|
inlinevirtual |
Get the N2k version of this device.
Implements tNMEA2000::tDevice.
Definition at line 206 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Product code of this device.
Implements tNMEA2000::tDevice.
Definition at line 211 of file N2kDeviceList.h.
|
inlinevirtual |
Get the received PGNs of this device.
Reimplemented from tNMEA2000::tDevice.
Definition at line 306 of file N2kDeviceList.h.
|
inlinevirtual |
Get the Software Code of this device.
Implements tNMEA2000::tDevice.
Definition at line 221 of file N2kDeviceList.h.
|
inlinevirtual |
Get the transmitted PGNs of this device.
Reimplemented from tNMEA2000::tDevice.
Definition at line 301 of file N2kDeviceList.h.
|
inline |
Has the Configuration Information for the device already been loaded.
Definition at line 249 of file N2kDeviceList.h.
|
inline |
Has the Product Information for the device already been loaded.
Definition at line 201 of file N2kDeviceList.h.
char * tN2kDeviceList::tInternalDevice::InitConfigurationInformation | ( | size_t & | _ManISize, |
size_t & | _InstDesc1Size, | ||
size_t & | _InstDesc2Size | ||
) |
Initialize the Configuration Information of this device.
This function gives back an empty string for the Configuration Information. Adequate memory has been allocated and the leading character ('\0' terminators ) have been added.
_ManISize | Size of the Manufacturer Information |
_InstDesc1Size | Size of the Install Description 1 |
_InstDesc2Size | Size of the Install Description 2 |
Definition at line 430 of file N2kDeviceList.cpp.
unsigned long * tN2kDeviceList::tInternalDevice::InitReceivePGNs | ( | uint8_t | count | ) |
Initialize an array for received PGNs This functions frees if needed old reservation and reserves new memory for requested number of PGNs.
count | Number of Transmitted PGNs to be handled |
Definition at line 467 of file N2kDeviceList.cpp.
unsigned long * tN2kDeviceList::tInternalDevice::InitTransmitPGNs | ( | uint8_t | count | ) |
Initialize an array for transmitted PGNs This functions frees if needed old reservation and reserves new memory for requested number of PGNs.
count | Number of Transmitted PGNs to be handled |
Definition at line 459 of file N2kDeviceList.cpp.
|
inline |
Compares two Product Informations.
Definition at line 373 of file N2kDeviceList.h.
|
inline |
Ready for the next request of Device Configuration Information.
There must be a minimum interval between two requests for product information. see N2kDL_TimeBetweenCIRequest
Definition at line 404 of file N2kDeviceList.h.
|
inline |
Ready for the next request of Device PGN List.
There must be a minimum interval between two requests for product information. see N2kDL_TimeForFirstRequest
Definition at line 438 of file N2kDeviceList.h.
|
inline |
Ready for the next request of Device Product Information.
There must be a minimum interval between two requests for product information. see N2kDL_TimeBetweenPIRequest
Definition at line 363 of file N2kDeviceList.h.
|
inline |
Increments the Number of how often the Configuration Information has already been requested and stores the timestamp.
Definition at line 409 of file N2kDeviceList.h.
|
inline |
Set the Device Information.
_Name | Name of the device |
Definition at line 165 of file N2kDeviceList.h.
|
inline |
Increments the Number of how often the name has already been requested.
Definition at line 337 of file N2kDeviceList.h.
|
inline |
Increments the Number of how often the PGN List has already been requested and stores the timestamp.
Definition at line 428 of file N2kDeviceList.h.
|
inline |
Set the Product Information of the device.
_ModelSerialCode | Default="". Max 32 chars. Manufacturer's Model serial code |
_ProductCode | Default=666. Manufacturer's product code |
_ModelID | Default="". Max 33 chars. Manufacturer's Model ID |
_SwCode | Default="". Max 40 chars. Manufacturer's software version code |
_ModelVersion | Default="". Max 24 chars. Manufacturer's Model version |
_LoadEquivalency | Default=1. x * 50 mA |
_N2kVersion | Default=1300 |
_CertificationLevel | Default=1 |
Definition at line 183 of file N2kDeviceList.h.
|
inline |
Increments the Number of how often the Product Information has already been requested and stores the timestamp.
Definition at line 367 of file N2kDeviceList.h.
|
inline |
Set the Source address of the device.
_Source | Source address of this device |
Definition at line 158 of file N2kDeviceList.h.
|
inline |
Should the Device Configuration Information be requested As long as the device Configuration Information is not set yet and the number of requests is smaller than 4, the name should be requested once more.
Definition at line 393 of file N2kDeviceList.h.
|
inline |
Should the Device Name be requested As long as the device name is not set yet and the number of requests is smaller than 20, the name should be requested once more.
Definition at line 333 of file N2kDeviceList.h.
|
inline |
Should the Device PGN List be requested As long as the device PGN List is not set yet and the number of requests is smaller than 4, the name should be requested once more.
Definition at line 423 of file N2kDeviceList.h.
|
inline |
Should the Device Product Information be requested As long as the device Product Information is not set yet and the number of requests is smaller than 4, the name should be requested once more.
Definition at line 353 of file N2kDeviceList.h.
|
protected |
Pointer to the Config Information.
Definition at line 99 of file N2kDeviceList.h.
|
protected |
Product Information has been loaded.
Definition at line 88 of file N2kDeviceList.h.
unsigned long tN2kDeviceList::tInternalDevice::ConfIRequested |
Time for last request on the Config Information.
Definition at line 125 of file N2kDeviceList.h.
|
protected |
Size of the Config Information (number of bytes)
Definition at line 90 of file N2kDeviceList.h.
|
protected |
Pointer to the Installation Description 1.
Definition at line 103 of file N2kDeviceList.h.
|
protected |
Pointer to the Installation Description 2.
Definition at line 105 of file N2kDeviceList.h.
|
protected |
Size of the Installation Description 1 (number of bytes)
Definition at line 94 of file N2kDeviceList.h.
|
protected |
Size of the Installation Description 2 (number of bytes)
Definition at line 96 of file N2kDeviceList.h.
unsigned long tN2kDeviceList::tInternalDevice::LastMessageTime |
Time of the last message.
Definition at line 135 of file N2kDeviceList.h.
|
protected |
Size of the Manufacturer Information (number of bytes)
Definition at line 92 of file N2kDeviceList.h.
|
protected |
Pointer to the Manufacturer Information.
Definition at line 101 of file N2kDeviceList.h.
uint8_t tN2kDeviceList::tInternalDevice::nConfIRequested |
How many times we have requested the Config information.
Definition at line 128 of file N2kDeviceList.h.
uint8_t tN2kDeviceList::tInternalDevice::nNameRequested |
How many times we have requested the name.
Definition at line 118 of file N2kDeviceList.h.
uint8_t tN2kDeviceList::tInternalDevice::nPGNsRequested |
How many times we have requested the PGN.
Definition at line 132 of file N2kDeviceList.h.
uint8_t tN2kDeviceList::tInternalDevice::nProdIRequested |
How many times we have requested the Product information.
Definition at line 123 of file N2kDeviceList.h.
unsigned long tN2kDeviceList::tInternalDevice::PGNsRequested |
Time for last request on the PGN.
Definition at line 130 of file N2kDeviceList.h.
|
protected |
Product Information of this device.
Definition at line 85 of file N2kDeviceList.h.
|
protected |
Product Information has been loaded.
Definition at line 83 of file N2kDeviceList.h.
unsigned long tN2kDeviceList::tInternalDevice::ProdIRequested |
Time for last request on the Product Information.
Definition at line 120 of file N2kDeviceList.h.
|
protected |
Received PGNs.
Definition at line 114 of file N2kDeviceList.h.
|
protected |
Size of the received PGN (number of bytes)
Definition at line 112 of file N2kDeviceList.h.
|
protected |
Transmitted PGNs.
Definition at line 110 of file N2kDeviceList.h.
|
protected |
Size of the transmitted PGN (number of bytes)
Definition at line 108 of file N2kDeviceList.h.