VLCB
Loading...
Searching...
No Matches
VLCB::AbstractEventTeachingService Class Reference

Base class for teaching services. More...

#include <AbstractEventTeachingService.h>

Inheritance diagram for VLCB::AbstractEventTeachingService:
VLCB::Service VLCB::EventSlotTeachingService VLCB::EventTeachingService VLCB::EventTeachingServiceWithDiagnostics

Public Member Functions

void setEventValidator (byte(*func)(int nn, int en, byte evNum, byte evVal))
virtual Data getServiceData () override
 Return Data bytes specific for the implementing service. The meaning of each data byte is defined in the service specification.
void enableLearn ()
void inhibitLearn ()
Public Member Functions inherited from VLCB::Service
void setController (Controller *ctrl)
 Set a pointer to the controller object for use in implementing class.
virtual void begin ()
 This optional method is called at the beginning of the Arduino sketch. Define this method for the service to do any setup required at the beginning.
virtual VlcbServiceTypes getServiceID () const =0
 Return a unique ID for this service.
virtual byte getServiceVersionID () const =0
 Return the version of the service specification implemented by this service.
virtual void process ()
 This method that be called regularly from the VLCB core to let the service perform regular tasks.
virtual void processAction (const Action &action)
 Called when there is an action available.
virtual void reportDiagnostics (byte serviceIndex, byte diagnosticsCode)
 Report a given diagnostic value.
virtual int getDiagnosticCount ()
 report how many diagnostics this service supports.

Protected Member Functions

void handleMessage (const VlcbMessage *msg)
Protected Member Functions inherited from VLCB::Service
bool isThisNodeNumber (unsigned int nodeNumber)
 Helper function to decide if a given node number is the same as that assigned to this node.

Protected Attributes

bool bLearn = false
byte(* validatorFunc )(int nn, int en, byte evNum, byte evVal) = nullptr
unsigned int diagEventsTaught = 0
Protected Attributes inherited from VLCB::Service
Controllercontroller
 Pointer to the Controller object that can be used by implementing classes.

Detailed Description

Base class for teaching services.

Provides common implementation for all teaching services.

Member Function Documentation

◆ setEventValidator()

void VLCB::AbstractEventTeachingService::setEventValidator ( byte(* func )(int nn, int en, byte evNum, byte evVal))
inline

Register a callback handler that validates that events taught to this module comply with rules for this module.

◆ getServiceData()

Service::Data VLCB::AbstractEventTeachingService::getServiceData ( )
overridevirtual

Return Data bytes specific for the implementing service. The meaning of each data byte is defined in the service specification.

Reimplemented from VLCB::Service.

◆ enableLearn()

void VLCB::AbstractEventTeachingService::enableLearn ( )

◆ inhibitLearn()

void VLCB::AbstractEventTeachingService::inhibitLearn ( )

◆ handleMessage()

void VLCB::AbstractEventTeachingService::handleMessage ( const VlcbMessage * msg)
protected

Member Data Documentation

◆ bLearn

bool VLCB::AbstractEventTeachingService::bLearn = false
protected

◆ validatorFunc

byte(* VLCB::AbstractEventTeachingService::validatorFunc) (int nn, int en, byte evNum, byte evVal) = nullptr
protected

◆ diagEventsTaught

unsigned int VLCB::AbstractEventTeachingService::diagEventsTaught = 0
protected

The documentation for this class was generated from the following files: