6#include <viam/api/component/switch/v1/switch.grpc.pb.h>
9#include <viam/sdk/rpc/dial.hpp>
30 ProtoStruct
do_command(
const ProtoStruct& command)
override;
39 using StubType = viam::component::switch_::v1::SwitchService::StubInterface;
40 std::unique_ptr<StubType> stub_;
virtual std::string name() const
Return the resource's name.
A Switch represents a physical switch with multiple positions.
Definition switch.hpp:25
void set_position(uint32_t position)
Set the position of the switch.
Definition switch.hpp:36
uint32_t get_position()
Get the current position of the switch.
Definition switch.hpp:47
position_info get_number_of_positions()
Get the position_info supported by this switch.
Definition switch.hpp:58
gRPC client implementation of a Switch component.
Definition switch_client.hpp:18
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
uint32_t get_position(const ProtoStruct &extra) override
Get the current position of the switch.
void set_position(uint32_t position, const ProtoStruct &extra) override
Set the position of the switch.
Switch::position_info get_number_of_positions(const ProtoStruct &extra) override
Get the position_info supported by this switch.
Current position of the motor relative to its home.
Information on the positions supported by this switch and their labels.
Definition switch.hpp:29
Defines a Switch component.