NMEA2000 Library  0.1
Library to handle NMEA 2000 Communication written in C++
DeviceAnalyzer.ino File Reference

NMEA2000 library example. Show devices on NMEA2000 bus by using tN2kDeviceList. More...

#include <Arduino.h>
#include <NMEA2000_CAN.h>
#include "N2kDeviceList.h"
Include dependency graph for DeviceAnalyzer.ino:

Go to the source code of this file.

Macros

#define N2k_CAN_INT_PIN   21
 
#define START_DELAY_IN_S   8
 

Functions

void CheckCommand ()
 
void ListDevices (bool force=false)
 
void loop ()
 
void PrintDevice (const tNMEA2000::tDevice *pDevice)
 
template<typename T >
void PrintLabelValWithConversionCheckUnDef (const char *label, T val, double(*ConvFunc)(double val)=0, bool AddLf=false)
 
void PrintText (const char *Text, bool AddLineFeed=true)
 
void PrintUlongList (const char *prefix, const unsigned long *List)
 
void setup ()
 

Variables

Stream * OutputStream
 
tN2kDeviceListpN2kDeviceList
 

Detailed Description

NMEA2000 library example. Show devices on NMEA2000 bus by using tN2kDeviceList.

tN2kDeviceList is helper class, which automatically keeps track of devices on the bus. This example simplyt lists all devices on the bus and prints their information by using data collected by tN2kDeviceList.

Definition in file DeviceAnalyzer.ino.

Macro Definition Documentation

◆ N2k_CAN_INT_PIN

#define N2k_CAN_INT_PIN   21

Definition at line 13 of file DeviceAnalyzer.ino.

◆ START_DELAY_IN_S

#define START_DELAY_IN_S   8

Definition at line 104 of file DeviceAnalyzer.ino.

Function Documentation

◆ CheckCommand()

void CheckCommand ( )

Definition at line 134 of file DeviceAnalyzer.ino.

◆ ListDevices()

void ListDevices ( bool  force = false)

Definition at line 106 of file DeviceAnalyzer.ino.

◆ loop()

void loop ( )

Definition at line 144 of file DeviceAnalyzer.ino.

◆ PrintDevice()

void PrintDevice ( const tNMEA2000::tDevice pDevice)

Definition at line 86 of file DeviceAnalyzer.ino.

◆ PrintLabelValWithConversionCheckUnDef()

template<typename T >
void PrintLabelValWithConversionCheckUnDef ( const char *  label,
val,
double(*)(double val)  ConvFunc = 0,
bool  AddLf = false 
)

Definition at line 21 of file DeviceAnalyzer.ino.

◆ PrintText()

void PrintText ( const char *  Text,
bool  AddLineFeed = true 
)

Definition at line 80 of file DeviceAnalyzer.ino.

◆ PrintUlongList()

void PrintUlongList ( const char *  prefix,
const unsigned long *  List 
)

Definition at line 67 of file DeviceAnalyzer.ino.

◆ setup()

void setup ( )

Definition at line 30 of file DeviceAnalyzer.ino.

Variable Documentation

◆ OutputStream

Stream* OutputStream

Definition at line 18 of file DeviceAnalyzer.ino.

◆ pN2kDeviceList

tN2kDeviceList* pN2kDeviceList

Definition at line 17 of file DeviceAnalyzer.ino.