Arduino C++ Library for VLCB
Loading...
Searching...
No Matches
Service.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 <Arduino.h>
9#include <vlcbdefs.hpp>
10
11namespace VLCB
12{
13
14class Controller;
15struct Action;
16
25{
27protected:
29 bool isThisNodeNumber(unsigned int nodeNumber);
30
32 Controller * controller;
33
34public:
36 void setController(Controller * ctrl) { this->controller = ctrl; }
37
40 virtual void begin() {}
41
46 virtual VlcbServiceTypes getServiceID() const = 0;
47
52 virtual byte getServiceVersionID() const = 0;
53
59 virtual void process() {}
60
66 virtual void processAction(const Action & action) {};
67
72 virtual void reportDiagnostics(byte serviceIndex, byte diagnosticsCode);
73
75 virtual int getDiagnosticCount() { return 0; }
76
78 struct Data { byte data1, data2, data3; };
79
82 virtual Data getServiceData();
84};
85
86}
Interface base class for all VLCB services.
Definition Service.h:25
Definition VLCB.h:50
void begin()
void process()
VlcbServiceTypes
Definition vlcbdefs.hpp:487