|
VLCB
|
Interface base class for all VLCB services. More...
#include <Service.h>
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 | |
| Controller * | controller |
| Pointer to the Controller object that can be used by implementing classes. | |
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.
|
protected |
Helper function to decide if a given node number is the same as that assigned to this node.
|
inline |
Set a pointer to the controller object for use in implementing class.
|
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.
|
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.
|
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.
|
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.
|
inlinevirtual |
Called when there is an action available.
This method does not need to be implemented if the service does react to any actions.
| action | The 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.
|
virtual |
Report a given diagnostic value.
| serviceIndex | index of the service. Not used by the implementation, just passed through to the response message. |
| diagnosticsCode | code 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.
|
inlinevirtual |
report how many diagnostics this service supports.
Reimplemented in VLCB::CanServiceWithDiagnostics, VLCB::EventConsumerServiceWithDiagnostics, VLCB::EventProducerServiceWithDiagnostics, VLCB::EventTeachingServiceWithDiagnostics, VLCB::InternalDiagnosticsService, and VLCB::MinimumNodeServiceWithDiagnostics.
|
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.
|
protected |
Pointer to the Controller object that can be used by implementing classes.