Arduino C++ Library for VLCB
Loading...
Searching...
No Matches
MinimumNodeService.h
Go to the documentation of this file.
1// Copyright (C) Sven Rosvall (sven@rosvall.ie)
2// This file is part of VLCB-Arduino project on https://github.com/SvenRosvall/VLCB-Arduino
3// Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
4// The full licence can be found at: http://creativecommons.org/licenses/by-nc-sa/4.0/
5
6#pragma once
7
8#include "Service.h"
9#include <vlcbdefs.hpp>
10
11namespace VLCB
12{
13
14struct VlcbMessage;
26{
27
28public:
30 virtual void process() override;
31 virtual void processAction(const Action &action) override;
32
33 virtual VlcbServiceTypes getServiceID() const override { return SERVICE_ID_MNS; }
34 virtual byte getServiceVersionID() const override { return 1; }
35
36 virtual void begin() override;
37
44 void setHeartBeat(bool f) { noHeartbeat = !f; }
46 void setSetupMode();
49 void setUninitialised();
51 void setNormal(unsigned int nn);
53private:
54
55 VlcbModeParams instantMode;
58 void initSetupFromUninitialised();
61 void initSetupFromNormal();
63 void initSetupCommon();
67 void heartbeat();
68
69 unsigned long lastHeartbeat = 0;
70 byte heartbeatSequence = 0;
71 bool noHeartbeat = false;
72 unsigned int heartRate = 5000;
73 bool notFcuCompatible = false; //Compatible is default
74
77 void handleRequestNodeParameters();
80 void handleRequestNodeParameter(const VlcbMessage *msg, unsigned int nn);
83 void handleSetNodeNumber(const VlcbMessage *msg, unsigned int nn);
86 void handleRequestServiceDefinitions(const VlcbMessage *msg, unsigned int nn);
89 void handleModeMessage(const VlcbMessage *msg, unsigned int nn);
90
91protected:
95 virtual void handleMessage(const VlcbMessage *msg);
98 virtual void diagNodeNumberChanged() {};
99
101};
102}
Mandatory Service for node.
Definition MinimumNodeService.h:26
Interface base class for all VLCB services.
Definition Service.h:25
Definition VLCB.h:50
void begin()
void process()
VlcbModeParams
Definition vlcbdefs.hpp:562
VlcbServiceTypes
Definition vlcbdefs.hpp:487
@ SERVICE_ID_MNS
Definition vlcbdefs.hpp:492