Viam C++ SDK current
Loading...
Searching...
No Matches
power_sensor_client.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <viam/api/component/powersensor/v1/powersensor.grpc.pb.h>
7
10#include <viam/sdk/config/resource.hpp>
12#include <viam/sdk/rpc/dial.hpp>
13
14namespace viam {
15namespace sdk {
16namespace impl {
17
22 public:
24 PowerSensorClient(std::string name, const ViamChannel& channel);
25
26 const ViamChannel& channel() const {
27 return *channel_;
28 }
29 voltage get_voltage(const ProtoStruct& extra) override;
30 current get_current(const ProtoStruct& extra) override;
31 double get_power(const ProtoStruct& extra) override;
32 ProtoStruct get_readings(const ProtoStruct& extra) override;
33 ProtoStruct do_command(const ProtoStruct& command) override;
34
39
40 private:
41 using StubType = viam::component::powersensor::v1::PowerSensorService::StubInterface;
42 std::unique_ptr<StubType> stub_;
43 const ViamChannel* channel_;
44};
45
46} // namespace impl
47} // namespace sdk
48} // namespace viam
Definition power_sensor.hpp:22
current get_current()
Returns the current reading of this sensor.
Definition power_sensor.hpp:55
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
voltage get_voltage()
Returns the voltage reading of this sensor.
Definition power_sensor.hpp:44
virtual std::string name() const
Return the resource's name.
Definition dial.hpp:25
gRPC client implementation of a PowerSensor component.
Definition power_sensor_client.hpp:21
double get_power(const ProtoStruct &extra) override
Returns the power reading of this sensor.
voltage get_voltage(const ProtoStruct &extra) override
Returns the voltage reading of this sensor.
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
ProtoStruct get_readings(const ProtoStruct &extra) override
Returns the measurements/data specific to this sensor.
current get_current(const ProtoStruct &extra) override
Returns the current reading of this sensor.
gRPC client implementation for a robot.
Defines a PowerSensor component.
Implements a gRPC server for the PowerSensor component.
Definition power_sensor.hpp:33
Definition power_sensor.hpp:25