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

Mandatory Service for node. More...

#include <MinimumNodeService.h>

Inheritance diagram for VLCB::MinimumNodeService:
VLCB::Service VLCB::MinimumNodeServiceWithDiagnostics

Public Member Functions

virtual void process () override
 This method that be called regularly from the VLCB core to let the service perform regular tasks.
virtual void processAction (const Action &action) override
 Called when there is an action available.
virtual VlcbServiceTypes getServiceID () const override
 Return a unique ID for this service.
virtual byte getServiceVersionID () const override
 Return the version of the service specification implemented by this service.
virtual void begin () override
 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.
Backdoors for testing

Access to these functions is provided purely for the purpose of testing VLCB by forcing specific modes. Under no circumstances should these functions be called from a normal application sketch.

void setHeartBeat (bool f)
void setSetupMode ()
 Forces instantMode to SETUP_MODE for testing purposes only.
void setUninitialised ()
void setNormal (unsigned int nn)
 Called when OPC_SNN is received. It will set MODE_NORMAL and the node number to nn.
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 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

virtual void handleMessage (const VlcbMessage *msg)
virtual void diagNodeNumberChanged ()
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.

Additional Inherited Members

Protected Attributes inherited from VLCB::Service
Controllercontroller
 Pointer to the Controller object that can be used by implementing classes.

Detailed Description

Mandatory Service for node.

Minimum Node Service API

This service is mandatory within the VLCB structure. It manages the setting up of a node by handling all of the communication with the external management system. The MNS will also act upon various Mode Commands either setting flags or instigating operations in other services, if present. In normal sketch use, there are no application calls directly to the MNS.

Member Function Documentation

◆ process()

void VLCB::MinimumNodeService::process ( )
overridevirtual

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 from VLCB::Service.

◆ processAction()

void VLCB::MinimumNodeService::processAction ( const Action & action)
overridevirtual

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 from VLCB::Service.

◆ getServiceID()

virtual VlcbServiceTypes VLCB::MinimumNodeService::getServiceID ( ) const
inlineoverridevirtual

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.

Implements VLCB::Service.

◆ getServiceVersionID()

virtual byte VLCB::MinimumNodeService::getServiceVersionID ( ) const
inlineoverridevirtual

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.

Implements VLCB::Service.

◆ begin()

void VLCB::MinimumNodeService::begin ( )
overridevirtual

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 from VLCB::Service.

◆ setHeartBeat()

void VLCB::MinimumNodeService::setHeartBeat ( bool f)
inline

Forces Heartbeat on or off for testing purposes only.

◆ setSetupMode()

void VLCB::MinimumNodeService::setSetupMode ( )

Forces instantMode to SETUP_MODE for testing purposes only.

◆ setUninitialised()

void VLCB::MinimumNodeService::setUninitialised ( )

Called when ACT_CHANGE_MODE is seen on the Action bus and the current mode status is MODE_SETUP or MODE_NORMAL. It will cause the mode to revert to MODE_UNINITIALISED.

◆ setNormal()

void VLCB::MinimumNodeService::setNormal ( unsigned int nn)

Called when OPC_SNN is received. It will set MODE_NORMAL and the node number to nn.

◆ handleMessage()

void VLCB::MinimumNodeService::handleMessage ( const VlcbMessage * msg)
protectedvirtual

Called when ACT_MESSAGE_IN is seen in the Action queue. If the VLCB message is of relevance to the MNS, it will act upon it before removing it from the Action queue either directly or in a called function.

Reimplemented in VLCB::MinimumNodeServiceWithDiagnostics.

◆ diagNodeNumberChanged()

virtual void VLCB::MinimumNodeService::diagNodeNumberChanged ( )
inlineprotectedvirtual

Called whenever the node number is changed. Count is recorded and held in Minimum Node Service With Diagnostics.

Reimplemented in VLCB::MinimumNodeServiceWithDiagnostics.


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