trikRuntime
trikControl::DeviceInterface Class Referenceabstract

TRIK device interface, base interface for everything that can be plugged to a brick or already on board. More...

#include <deviceInterface.h>

Inheritance diagram for trikControl::DeviceInterface:

Public Types

enum  Status {
  Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting,
  Status::ready, Status::stopping
}
 Device status. More...
 

Public Member Functions

 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 
virtual Status status () const =0
 Returns current status of the device. More...
 

Static Public Member Functions

static Status combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent)
 Helper method to return status of a device relying on other device to work. More...
 

Detailed Description

TRIK device interface, base interface for everything that can be plugged to a brick or already on board.

Member Enumeration Documentation

Device status.

Enumerator
permanentFailure 

Device can not be turned on due to hardware or configuration failure that will likely not be fixed at least until reboot.

Device is not ready due to a hardware or software failure that can fix itself at some time in the future, so the device will try to reinitialize itself from time to time.

temporaryFailure 

Device is turned off.

off 

Device received command to turn on, but is starting now, and it may take some time.

starting 

Device is ready and working properly.

ready 

Device received command to turn off and stopping now, it may take some time.

stopping 

Constructor & Destructor Documentation

trikControl::DeviceInterface::DeviceInterface ( )
default
virtual trikControl::DeviceInterface::~DeviceInterface ( )
virtualdefault

Member Function Documentation

static Status trikControl::DeviceInterface::combine ( const DeviceInterface underlying,
const DeviceInterface::Status dependent 
)
inlinestatic

Helper method to return status of a device relying on other device to work.

If first device is ready, status of a second device is returned, otherwise it is status of a first device.


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