51 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
67 bool setPowerLEDEnabled(
bool enabled);
68 bool setUSBHubEnabled(
bool enabled);
70 bool setUSBPortEnabled(uint8_t port,
bool enabled);
71 void setFirmwareVersion();
72 void setBootstrapUSB();
73 void updateUSBPower();
76 bool sendCommand(
const char *command,
char *res);
77 void cleanupResponse(
char *response);
78 std::vector<std::string> split(
const std::string &input,
const std::string ®ex);
82 bool initialized {
false };
106 enum { USB_OFF, USB_ON };
109 std::map<int, SwitchMap> usbPort =
111 { 0, { .S = USBPort1S, .SP = &USBPort1SP } },
112 { 1, { .S = USBPort2S, .SP = &USBPort2SP } },
113 { 2, { .S = USBPort3S, .SP = &USBPort3SP } },
114 { 3, { .S = USBPort4S, .SP = &USBPort4SP } },
115 { 4, { .S = USBPort5S, .SP = &USBPort5SP } },
116 { 5, { .S = USBPort6S, .SP = &USBPort6SP } }
155 static constexpr const uint8_t PEGASUS_TIMEOUT {3};
156 static constexpr const uint8_t PEGASUS_LEN {32};
157 static constexpr const char *USB_TAB {
"USB"};
158 static constexpr const char *INFO_TAB {
"INFO"};
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Text vector property descriptor.