10#include <viam/sdk/common/proto_value.hpp>
11#include <viam/sdk/components/component.hpp>
12#include <viam/sdk/resource/resource_api.hpp>
63 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
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
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 uint32_t get_number_of_positions(const ProtoStruct &extra)=0
Get the number of positions that the switch supports.
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:40
Current position of the motor relative to its home.
Definition resource_api.hpp:46