|
Viam C++ SDK current
|
A Switch represents a physical switch with multiple positions.
More...
#include "components/switch.hpp"
Inheritance diagram for viam::sdk::Switch:Classes | |
| struct | position_info |
| Information on the positions supported by this switch and their labels. More... | |
Public Member Functions | |
| void | set_position (uint32_t position) |
| Set the position of the switch. | |
| virtual void | set_position (uint32_t position, const ProtoStruct &extra)=0 |
| Set the position of the switch. | |
| uint32_t | get_position () |
| Get the current position of the switch. | |
| virtual uint32_t | get_position (const ProtoStruct &extra)=0 |
| Get the current position of the switch. | |
| position_info | get_number_of_positions () |
| Get the position_info supported by this 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. | |
| API | api () const override |
Returns the API associated with a particular resource. | |
Public Member Functions inherited from viam::sdk::Component | |
| Name | get_resource_name () const override |
Returns the Name for a particular resource. | |
Public Member Functions inherited from viam::sdk::Resource | |
| Resource (std::string name) | |
| virtual std::string | name () const |
| Return the resource's name. | |
| void | set_log_level (log_level) const |
| Set the log level for log messages originating from this Resource. | |
Protected Member Functions | |
| Switch (std::string name) | |
Protected Member Functions inherited from viam::sdk::Component | |
| Component (std::string name) | |
Protected Member Functions inherited from viam::sdk::Resource | |
| Name | get_resource_name (const std::string &type) const |
Additional Inherited Members | |
Protected Attributes inherited from viam::sdk::Resource | |
| LogSource | logger_ |
A Switch represents a physical switch with multiple positions.
This acts as an abstract parent class to be inherited from by any drivers representing specific switch implementations. This class cannot be used on its own.
|
overridevirtual |
Returns the API associated with a particular resource.
Implements viam::sdk::Resource.
|
pure virtual |
Send/receive arbitrary commands to the resource.
| command | The command to execute. |
Implemented in viam::sdk::impl::SwitchClient.
|
inline |
Get the position_info supported by this switch.
|
pure virtual |
Get the position_info supported by this switch.
| extra | Any additional arguments to the method. |
Implemented in viam::sdk::impl::SwitchClient, and viam::sdk::impl::SwitchClient.
|
inline |
Get the current position of the switch.
|
pure virtual |
Get the current position of the switch.
| extra | Any additional arguments to the method. |
Implemented in viam::sdk::impl::SwitchClient, and viam::sdk::impl::SwitchClient.
|
inline |
Set the position of the switch.
| position | The position to set the switch to. |
|
pure virtual |
Set the position of the switch.
| position | The position to set the switch to. |
| extra | Any additional arguments to the method. |
Implemented in viam::sdk::impl::SwitchClient, and viam::sdk::impl::SwitchClient.