8#include <viam/sdk/common/proto_value.hpp>
9#include <viam/sdk/common/utils.hpp>
10#include <viam/sdk/config/resource.hpp>
73 virtual double get_power(
const ProtoStruct& extra) = 0;
89 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition component.hpp:10
Definition power_sensor.hpp:22
current get_current()
Returns the current reading of this sensor.
Definition power_sensor.hpp:55
API api() const override
Returns the API associated with a particular resource.
virtual current get_current(const ProtoStruct &extra)=0
Returns the current reading of this sensor.
virtual double get_power(const ProtoStruct &extra)=0
Returns the power reading of this sensor.
virtual voltage get_voltage(const ProtoStruct &extra)=0
Returns the voltage reading of this sensor.
double get_power()
Returns the power reading of this sensor.
Definition power_sensor.hpp:66
ProtoStruct get_readings()
Returns the measurements/data specific to this sensor.
Definition power_sensor.hpp:77
virtual ProtoStruct get_readings(const ProtoStruct &extra)=0
Returns the measurements/data specific to this sensor.
voltage get_voltage()
Returns the voltage reading of this sensor.
Definition power_sensor.hpp:44
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
virtual std::string name() const
Return the resource's name.
Definition resource_api.hpp:50
Definition power_sensor.hpp:33
double amperes
Current in amperes.
Definition power_sensor.hpp:35
bool is_ac
Whether the current is DC or AC.
Definition power_sensor.hpp:37
Definition power_sensor.hpp:25
double volts
Voltage in volts.
Definition power_sensor.hpp:27
bool is_ac
Whether the voltage is DC or AC.
Definition power_sensor.hpp:29