6#include <grpcpp/channel.h>
8#include <viam/api/component/switch/v1/switch.grpc.pb.h>
27 ProtoStruct
do_command(
const ProtoStruct& command)
override;
36 using StubType = viam::component::switch_::v1::SwitchService::StubInterface;
37 std::unique_ptr<StubType> stub_;
38 std::shared_ptr<grpc::Channel> channel_;
virtual std::string name() const
Return the resource's name.
A Switch represents a physical switch with multiple positions.
Definition switch.hpp:25
uint32_t get_number_of_positions()
Get the number of positions that the switch supports.
Definition switch.hpp:51
void set_position(uint32_t position)
Set the position of the switch.
Definition switch.hpp:29
uint32_t get_position()
Get the current position of the switch.
Definition switch.hpp:40
gRPC client implementation of a Switch component.
Definition switch_client.hpp:19
uint32_t get_number_of_positions(const ProtoStruct &extra) override
Get the number of positions that the switch supports.
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.
Current position of the motor relative to its home.
Defines a Switch component.