VLCB
Toggle main menu visibility
Loading...
Searching...
No Matches
AbstractEventTeachingService.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
10
namespace
VLCB
11
{
12
13
struct
VlcbMessage
;
14
18
class
AbstractEventTeachingService
:
public
Service
19
{
20
public
:
23
void
setEventValidator
(
byte
(*func)(
int
nn,
int
en,
byte
evNum,
byte
evVal)) {
validatorFunc
= func; }
24
26
virtual
Data
getServiceData
()
override
;
27
28
void
enableLearn
();
29
void
inhibitLearn
();
30
31
protected
:
32
bool
bLearn
=
false
;
33
byte (*
validatorFunc
)(
int
nn,
int
en,
byte
evNum,
byte
evVal) =
nullptr
;
34
unsigned
int
diagEventsTaught
= 0;
35
36
void
handleMessage
(
const
VlcbMessage
*msg);
37
39
40
private
:
41
void
handleLearnMode(
const
VlcbMessage
*msg,
unsigned
int
nn);
42
void
handleLearn(
unsigned
int
nn);
43
void
handleUnlearnEvent(
const
VlcbMessage
*msg,
unsigned
int
nn);
44
void
handleUnlearn(
unsigned
int
nn);
45
void
handleRequestEventCount(
unsigned
int
nn);
46
void
handleReadEvents(
unsigned
int
nn);
47
void
handleReadEventVariable(
const
VlcbMessage
*msg,
unsigned
int
nn);
48
void
handleClearEvents(
unsigned
int
nn);
49
void
handleGetFreeEventSlots(
unsigned
int
nn);
50
};
51
52
}
// VLCB
Service.h
VLCB::AbstractEventTeachingService
Base class for teaching services.
Definition
AbstractEventTeachingService.h:19
VLCB::AbstractEventTeachingService::diagEventsTaught
unsigned int diagEventsTaught
Definition
AbstractEventTeachingService.h:34
VLCB::AbstractEventTeachingService::getServiceData
virtual Data getServiceData() override
Return Data bytes specific for the implementing service. The meaning of each data byte is defined in ...
Definition
AbstractEventTeachingService.cpp:15
VLCB::AbstractEventTeachingService::validatorFunc
byte(*) validatorFunc(int nn, int en, byte evNum, byte evVal)
Definition
AbstractEventTeachingService.h:33
VLCB::AbstractEventTeachingService::enableLearn
void enableLearn()
Definition
AbstractEventTeachingService.cpp:21
VLCB::AbstractEventTeachingService::setEventValidator
void setEventValidator(byte(*func)(int nn, int en, byte evNum, byte evVal))
Definition
AbstractEventTeachingService.h:23
VLCB::AbstractEventTeachingService::inhibitLearn
void inhibitLearn()
Definition
AbstractEventTeachingService.cpp:28
VLCB::AbstractEventTeachingService::bLearn
bool bLearn
Definition
AbstractEventTeachingService.h:32
VLCB::AbstractEventTeachingService::handleMessage
void handleMessage(const VlcbMessage *msg)
Definition
AbstractEventTeachingService.cpp:35
VLCB::Service
Interface base class for all VLCB services.
Definition
Service.h:25
VLCB
Definition
AbstractEventTeachingService.cpp:13
VLCB::VlcbMessage
VLCB message type.
Definition
Controller.h:38
src
AbstractEventTeachingService.h
Generated by
1.18.0