UART Switch

See Application::make_uart_switch().

API Reference

class UARTSwitch : public switch_::Switch, public UARTDevice

Public Functions

UARTSwitch(UARTComponent *parent, const std::string &name, const std::vector<uint8_t> &data)

Protected Functions

void write_state(bool state)

Write the given state to hardware.

You should implement this abstract method if you want to create your own switch.

In the implementation of this method, you should also call publish_state to acknowledge that the state was written to the hardware.

Parameters
  • state: The state to write. Inversion is already applied if user specified it.

Protected Attributes

std::vector<uint8_t> data_