10#include <viam/sdk/common/proto_value.hpp>
11#include <viam/sdk/components/component.hpp>
12#include <viam/sdk/resource/resource_api.hpp>
30 uint32_t num_positions;
31 std::vector<std::string> position_labels;
70 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
Definition resource_api.hpp:21
Definition component.hpp:10
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
API api() const override
Returns the API associated with a particular resource.
virtual void set_position(uint32_t position, const ProtoStruct &extra)=0
Set the position of the switch.
virtual position_info get_number_of_positions(const ProtoStruct &extra)=0
Get the position_info supported by this switch.
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
virtual uint32_t get_position(const ProtoStruct &extra)=0
Get the current position of the switch.
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
Current position of the motor relative to its home.
Definition resource_api.hpp:46
Information on the positions supported by this switch and their labels.
Definition switch.hpp:29