ArPiRobot-CoreLib C++
C++ library for ArPiRobot robots
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
arpirobot::BaseDevice Class Referenceabstract

#include <arpirobot/core/device/BaseDevice.hpp>

Inheritance diagram for arpirobot::BaseDevice:
arpirobot::GPIOPin arpirobot::Gamepad arpirobot::INA260PowerSensor arpirobot::MotorController arpirobot::StatusLED arpirobot::AdafruitMotorHatMotor arpirobot::DRV8833Motor arpirobot::L298NMotor arpirobot::TB6612Motor

Public Member Functions

virtual std::string getDeviceName ()
 
bool isLockedByAction (std::shared_ptr< Action > action=nullptr)
 Check if a given action locks the device. More...
 
bool isLockedByAction (Action &action)
 Check if a given action locks the device. More...
 

Protected Member Functions

virtual void begin ()=0
 
virtual bool isEnabled ()=0
 
virtual bool shouldMatchRobotState ()=0
 
virtual bool shouldDisableWithWatchdog ()=0
 
virtual void enable ()=0
 
virtual void disable ()=0
 

Protected Attributes

bool initialized = false
 
std::string deviceName
 

Friends

class Action
 
class BaseRobot
 

Detailed Description

Base class for any device connected to the raspberry pi.

Member Function Documentation

◆ getDeviceName()

virtual std::string arpirobot::BaseDevice::getDeviceName ( )
virtual

Get the human-readable name of the device

Returns
the devices human readable name

◆ isLockedByAction() [1/2]

bool arpirobot::BaseDevice::isLockedByAction ( Action action)

Check if a given action locks the device.

Parameters
actionThe action to compare to.
Returns
true If the device is locked by the action
false If the device is not locked the action

◆ isLockedByAction() [2/2]

bool arpirobot::BaseDevice::isLockedByAction ( std::shared_ptr< Action action = nullptr)

Check if a given action locks the device.

Parameters
actionThe action to compare to. If nullptr this function checks if any action locks the device
Returns
true If the device is locked by the action
false If the device is not locked the action

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