NMEA2000 Library  0.1
Library to handle NMEA 2000 Communication written in C++
N2kMaretron.h
Go to the documentation of this file.
1/*
2 * N2kMaretron.h
3 *
4 * Copyright (c) 2019-2024 Vassilis Bourdakis,
5 * Timo Lappalainen, Kave Oy, www.kave.fi,
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23*/
24
25/**************************************************************************/
44#ifndef _N2kMaretron_H_
45#define _N2kMaretron_H_
46
47#include "N2kMsg.h"
48#include "N2kTypes.h"
49#include <stdint.h>
50
51
52/************************************************************************/
79void SetN2kMaretronPGN130823(tN2kMsg &N2kMsg, unsigned char SID, unsigned char TempInstance, tN2kTempSource TempSource,
80 double ActualTemperature, double SetTemperature=N2kDoubleNA);
81
82/************************************************************************/
89inline void SetN2kMaretronTempHR(tN2kMsg &N2kMsg, unsigned char SID, unsigned char TempInstance, tN2kTempSource TempSource,
90 double ActualTemperature, double SetTemperature=N2kDoubleNA) {
91 SetN2kMaretronPGN130823(N2kMsg,SID,TempInstance,TempSource,ActualTemperature,SetTemperature);
92}
93
94/************************************************************************/
123bool ParseN2kMaretronPGN130823(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &TempInstance, tN2kTempSource &TempSource,
124 double &ActualTemperature, double &SetTemperature);
125
126/************************************************************************/
134inline bool ParseN2kMaretronTempHR(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &TempInstance, tN2kTempSource &TempSource,
135 double &ActualTemperature, double &SetTemperature) {
136 return ParseN2kMaretronPGN130823(N2kMsg, SID, TempInstance, TempSource, ActualTemperature, SetTemperature);
137}
138
139/************************************************************************/
166void SetN2kMaretronPGN65286(tN2kMsg &N2kMsg, unsigned char SID, unsigned char FlowRateInstance, tN2kFluidType FluidType,
167 double FluidFlowRate);
168
169/************************************************************************/
176inline void SetN2kMaretronFluidFR(tN2kMsg &N2kMsg, unsigned char SID, unsigned char FlowRateInstance, tN2kFluidType FluidType,
177 double FluidFlowRate) {
178 SetN2kMaretronPGN65286(N2kMsg,SID,FlowRateInstance,FluidType,FluidFlowRate);
179}
180
181/************************************************************************/
208bool ParseN2kMaretronPGN65286(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &FlowRateInstance, tN2kFluidType &FluidType,
209 double &FluidFlowRate);
210
211/************************************************************************/
218inline bool ParseN2kMaretronFluidFR(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &FlowRateInstance, tN2kFluidType &FluidType,
219 double &FluidFlowRate) {
220 return ParseN2kMaretronPGN65286(N2kMsg, SID, FlowRateInstance, FluidType, FluidFlowRate);
221}
222
223/************************************************************************/
249void SetN2kMaretronPGN65287(tN2kMsg &N2kMsg, unsigned char SID, unsigned char VolumeInstance, tN2kFluidType FluidType,
250 double TripVolume);
251
252/************************************************************************/
259inline void SetN2kMaretronTripVolume(tN2kMsg &N2kMsg, unsigned char SID, unsigned char VolumeInstance, tN2kFluidType FluidType,
260 double TripVolume) {
261 SetN2kMaretronPGN65287(N2kMsg,SID,VolumeInstance,FluidType,TripVolume);
262}
263
264/************************************************************************/
290bool ParseN2kMaretronPGN65287(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &VolumeInstance, tN2kFluidType &FluidType,
291 double &TripVolume);
292
293/************************************************************************/
300inline bool ParseN2kMaretronTripVolume(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &VolumeInstance, tN2kFluidType &FluidType,
301 double &TripVolume) {
302 return ParseN2kMaretronPGN65287(N2kMsg, SID, VolumeInstance, FluidType, TripVolume);
303}
304
305#endif
306
void SetN2kMaretronFluidFR(tN2kMsg &N2kMsg, unsigned char SID, unsigned char FlowRateInstance, tN2kFluidType FluidType, double FluidFlowRate)
Setting up Maretron Message "Fluid Flow Rate" - PGN 65286.
Definition: N2kMaretron.h:176
bool ParseN2kMaretronTripVolume(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &VolumeInstance, tN2kFluidType &FluidType, double &TripVolume)
Parsing the content of Maretron Message "Trip Volume" - PGN 65287.
Definition: N2kMaretron.h:300
bool ParseN2kMaretronPGN130823(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &TempInstance, tN2kTempSource &TempSource, double &ActualTemperature, double &SetTemperature)
Parsing the content of Maretron Message PGN 130823 "Temperature High Range".
Definition: N2kMaretron.cpp:50
void SetN2kMaretronPGN65286(tN2kMsg &N2kMsg, unsigned char SID, unsigned char FlowRateInstance, tN2kFluidType FluidType, double FluidFlowRate)
Setting up PGN 65286 for Maretron Message "Fluid Flow Rate".
Definition: N2kMaretron.cpp:66
void SetN2kMaretronPGN65287(tN2kMsg &N2kMsg, unsigned char SID, unsigned char VolumeInstance, tN2kFluidType FluidType, double TripVolume)
Setting up PGN 65287 for Maretron Message "Trip Volume".
Definition: N2kMaretron.cpp:92
void SetN2kMaretronTripVolume(tN2kMsg &N2kMsg, unsigned char SID, unsigned char VolumeInstance, tN2kFluidType FluidType, double TripVolume)
Setting up Maretron Message "Trip Volume" - PGN 65287.
Definition: N2kMaretron.h:259
bool ParseN2kMaretronFluidFR(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &FlowRateInstance, tN2kFluidType &FluidType, double &FluidFlowRate)
Parsing the content of Maretron Message "Fluid Flow Rate" - PGN 65286.
Definition: N2kMaretron.h:218
bool ParseN2kMaretronTempHR(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &TempInstance, tN2kTempSource &TempSource, double &ActualTemperature, double &SetTemperature)
Parsing the content of Maretron Message "Temperature High Range" - PGN 130823.
Definition: N2kMaretron.h:134
bool ParseN2kMaretronPGN65287(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &VolumeInstance, tN2kFluidType &FluidType, double &TripVolume)
Parsing the content of Maretron Message PGN 65287 "Trip Volume".
void SetN2kMaretronTempHR(tN2kMsg &N2kMsg, unsigned char SID, unsigned char TempInstance, tN2kTempSource TempSource, double ActualTemperature, double SetTemperature=N2kDoubleNA)
Setting up Maretron Message "Temperature High Range" - PGN 130823.
Definition: N2kMaretron.h:89
bool ParseN2kMaretronPGN65286(const tN2kMsg &N2kMsg, unsigned char &SID, unsigned char &FlowRateInstance, tN2kFluidType &FluidType, double &FluidFlowRate)
Parsing the content of Maretron Message PGN 65286 "Fluid Flow Rate".
Definition: N2kMaretron.cpp:77
void SetN2kMaretronPGN130823(tN2kMsg &N2kMsg, unsigned char SID, unsigned char TempInstance, tN2kTempSource TempSource, double ActualTemperature, double SetTemperature=N2kDoubleNA)
Setting up PGN 130823 for Maretron Message "Temperature High Range".
Definition: N2kMaretron.cpp:38
This File contains the class tN2kMsg and all necessary functions to handle a NMEA2000 Message.
const double N2kDoubleNA
Constant "Not Available" for a double value.
Definition: N2kMsg.h:49
This File contains all specific Enumerations to make NMEA2000 Messages easier for humans to read.
This class contains all the data of an NMEA2000 message.
Definition: N2kMsg.h:656
tN2kTempSource
Enumeration of sources for a temperature value according to PGN130311, PGN130312 and PGN130316.
Definition: N2kTypes.h:171
tN2kFluidType
Enumeration of fluid types according to PGN127505.
Definition: N2kTypes.h:234