VLCB
Loading...
Searching...
No Matches
VLCB::Service Class Referenceabstract

Interface base class for all VLCB services. More...

#include <Service.h>

Inheritance diagram for VLCB::Service:
VLCB::AbstractEventTeachingService VLCB::CanService VLCB::ConsumeOwnEventsService VLCB::EventConsumerService VLCB::EventProducerService VLCB::InternalDiagnosticsService VLCB::LEDUserInterface VLCB::LongMessageService VLCB::MinimumNodeService VLCB::NodeVariableService VLCB::SerialUserInterface

Classes

struct  Data
 Container for service data bytes. More...

Public Member Functions

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.
virtual Data getServiceData ()
 Return Data bytes specific for the implementing service. The meaning of each data byte is defined in the service specification.

Protected Member Functions

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

Controllercontroller
 Pointer to the Controller object that can be used by implementing classes.

Detailed Description

Interface base class for all VLCB services.

Each VLCB module sketch shall be set up with a list of services that define capabilities of the module.

This class defines the interface that each such service class must implement.

Member Function Documentation

◆ isThisNodeNumber()

bool VLCB::Service::isThisNodeNumber ( unsigned int nodeNumber)
protected

Helper function to decide if a given node number is the same as that assigned to this node.

◆ setController()

void VLCB::Service::setController ( Controller * ctrl)
inline

Set a pointer to the controller object for use in implementing class.

◆ begin()

virtual void VLCB::Service::begin ( )
inlinevirtual

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.

Reimplemented in VLCB::MinimumNodeService.

◆ getServiceID()

virtual VlcbServiceTypes VLCB::Service::getServiceID ( ) const
pure virtual

Return a unique ID for this service.

This ID is used by configuration utilities to identify the service type. The service IDs are listed in the VLCB service specifications.

Implemented in VLCB::CanService, VLCB::ConsumeOwnEventsService, VLCB::EventConsumerService, VLCB::EventProducerService, VLCB::EventSlotTeachingService, VLCB::EventTeachingService, VLCB::InternalDiagnosticsService, VLCB::LEDUserInterface, VLCB::LongMessageService, VLCB::MinimumNodeService, VLCB::NodeVariableService, and VLCB::SerialUserInterface.

◆ getServiceVersionID()

virtual byte VLCB::Service::getServiceVersionID ( ) const
pure virtual

Return the version of the service specification implemented by this service.

This version is used by configuration utilities to identify which features are implemented by this service.

Implemented in VLCB::CanService, VLCB::ConsumeOwnEventsService, VLCB::EventConsumerService, VLCB::EventProducerService, VLCB::EventSlotTeachingService, VLCB::EventTeachingService, VLCB::InternalDiagnosticsService, VLCB::LEDUserInterface, VLCB::LongMessageService, VLCB::MinimumNodeService, VLCB::NodeVariableService, and VLCB::SerialUserInterface.

◆ process()

virtual void VLCB::Service::process ( )
inlinevirtual

This method that be called regularly from the VLCB core to let the service perform regular tasks.

Implementing service classes shall implement this to perform tasks specific to that service such as polling for changes of input pins. This method does not need to be implemented if there are no such regular tasks for the service.

Reimplemented in VLCB::CanService, VLCB::LEDUserInterface, VLCB::LongMessageService, VLCB::LongMessageServiceEx, VLCB::MinimumNodeService, and VLCB::SerialUserInterface.

◆ processAction()

virtual void VLCB::Service::processAction ( const Action & action)
inlinevirtual

Called when there is an action available.

This method does not need to be implemented if the service does react to any actions.

Parameters
actionThe action that the service may have interest in.

Reimplemented in VLCB::CanService, VLCB::EventConsumerService, VLCB::EventProducerService, VLCB::EventSlotTeachingService, VLCB::EventTeachingService, VLCB::LEDUserInterface, VLCB::LongMessageService, VLCB::MinimumNodeService, VLCB::NodeVariableService, and VLCB::SerialUserInterface.

◆ reportDiagnostics()

void VLCB::Service::reportDiagnostics ( byte serviceIndex,
byte diagnosticsCode )
virtual

Report a given diagnostic value.

Parameters
serviceIndexindex of the service. Not used by the implementation, just passed through to the response message.
diagnosticsCodecode for the diagnostic to report. This code is specific to the implemented service.

Reimplemented in VLCB::CanServiceWithDiagnostics, VLCB::EventConsumerServiceWithDiagnostics, VLCB::EventProducerServiceWithDiagnostics, VLCB::EventTeachingServiceWithDiagnostics, VLCB::InternalDiagnosticsService, and VLCB::MinimumNodeServiceWithDiagnostics.

◆ getDiagnosticCount()

◆ getServiceData()

Service::Data VLCB::Service::getServiceData ( )
virtual

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

Reimplemented in VLCB::AbstractEventTeachingService, VLCB::CanService, and VLCB::NodeVariableService.

Member Data Documentation

◆ controller

Controller* VLCB::Service::controller
protected

Pointer to the Controller object that can be used by implementing classes.


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