Viam C++ SDK current
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
viam::sdk::PowerSensor Class Referenceabstract

#include "components/power_sensor.hpp"

+ Inheritance diagram for viam::sdk::PowerSensor:

Classes

struct  current
 
struct  voltage
 

Public Member Functions

API api () const override
 Returns the API associated with a particular resource.
 
voltage get_voltage ()
 Returns the voltage reading of this sensor.
 
virtual voltage get_voltage (const ProtoStruct &extra)=0
 Returns the voltage reading of this sensor.
 
current get_current ()
 Returns the current reading of this sensor.
 
virtual current get_current (const ProtoStruct &extra)=0
 Returns the current reading of this sensor.
 
double get_power ()
 Returns the power reading of this sensor.
 
virtual double get_power (const ProtoStruct &extra)=0
 Returns the power reading of this sensor.
 
ProtoStruct get_readings ()
 Returns the measurements/data specific to this sensor.
 
virtual ProtoStruct get_readings (const ProtoStruct &extra)=0
 Returns the measurements/data specific to this sensor.
 
virtual ProtoStruct do_command (const ProtoStruct &command)=0
 Send/receive arbitrary commands to the resource.
 
- Public Member Functions inherited from viam::sdk::Component
Name get_resource_name () const override
 Returns the Name for a particular resource.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
virtual std::string name () const
 Return the resource's name.
 

Protected Member Functions

 PowerSensor (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Resource
Name get_resource_name (const std::string &type) const
 

Detailed Description

This acts as an abstract base class to be inherited from by any drivers representing specific powersensor implementations. This class cannot be used on its own.

Member Function Documentation

◆ api()

API viam::sdk::PowerSensor::api ( ) const
overridevirtual

Returns the API associated with a particular resource.

Implements viam::sdk::Resource.

◆ do_command()

virtual ProtoStruct viam::sdk::PowerSensor::do_command ( const ProtoStruct & command)
pure virtual

Send/receive arbitrary commands to the resource.

Parameters
Commandthe command to execute.
Returns
The result of the executed command.

Implemented in viam::sdk::impl::PowerSensorClient.

◆ get_current() [1/2]

current viam::sdk::PowerSensor::get_current ( )
inline

Returns the current reading of this sensor.

Returns
The current reading of this sensor.

◆ get_current() [2/2]

virtual current viam::sdk::PowerSensor::get_current ( const ProtoStruct & extra)
pure virtual

Returns the current reading of this sensor.

Parameters
extraAny additional arguments to this method.
Returns
The current reading of this sensor.

Implemented in viam::sdk::impl::PowerSensorClient, and viam::sdk::impl::PowerSensorClient.

◆ get_power() [1/2]

double viam::sdk::PowerSensor::get_power ( )
inline

Returns the power reading of this sensor.

Returns
The power reading of this sensor.

◆ get_power() [2/2]

virtual double viam::sdk::PowerSensor::get_power ( const ProtoStruct & extra)
pure virtual

Returns the power reading of this sensor.

Parameters
extraAny additional arguments to this method.
Returns
The power reading of this sensor.

Implemented in viam::sdk::impl::PowerSensorClient, and viam::sdk::impl::PowerSensorClient.

◆ get_readings() [1/2]

ProtoStruct viam::sdk::PowerSensor::get_readings ( )
inline

Returns the measurements/data specific to this sensor.

Returns
The requested measurements/data specific to this sensor.

◆ get_readings() [2/2]

virtual ProtoStruct viam::sdk::PowerSensor::get_readings ( const ProtoStruct & extra)
pure virtual

Returns the measurements/data specific to this sensor.

Parameters
extraAny additional arguments to the method.
Returns
The requested measurements/data specific to this sensor.

Implemented in viam::sdk::impl::PowerSensorClient, and viam::sdk::impl::PowerSensorClient.

◆ get_voltage() [1/2]

voltage viam::sdk::PowerSensor::get_voltage ( )
inline

Returns the voltage reading of this sensor.

Returns
The voltage reading of this sensor.

◆ get_voltage() [2/2]

virtual voltage viam::sdk::PowerSensor::get_voltage ( const ProtoStruct & extra)
pure virtual

Returns the voltage reading of this sensor.

Parameters
extraAny additional arguments to this method.
Returns
The voltage reading of this sensor.

Implemented in viam::sdk::impl::PowerSensorClient, and viam::sdk::impl::PowerSensorClient.


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