Update optoma_rs232.cpp
Add some more debugging messages for queries/commands being sent
This commit is contained in:
@@ -70,6 +70,7 @@ void OptomaRS232Component::loop() {
|
||||
|
||||
void OptomaRS232Component::update() {
|
||||
last_query_ = (last_query_ + 1) % std::size(QUERY_DATA);
|
||||
ESP_LOGD(TAG, "Sending query: %.*s", (int)(strlen(QUERY_DATA[last_query_]) - 1), QUERY_DATA[last_query_]);
|
||||
write_array(reinterpret_cast<const uint8_t *>(QUERY_DATA[last_query_]), strlen(QUERY_DATA[last_query_]));
|
||||
}
|
||||
|
||||
@@ -93,11 +94,13 @@ void OptomaRS232Component::beamer_input_select_changed(const std::string &state,
|
||||
if (inp == current_input_)
|
||||
return;
|
||||
current_input_ = inp;
|
||||
ESP_LOGD(TAG, "Sending command: %.*s", (int)(strlen(data) - 1), data);
|
||||
write_array(reinterpret_cast<const uint8_t *>(data), strlen(data));
|
||||
}
|
||||
|
||||
void OptomaRS232Component::beamer_power_switch_changed(const bool state) {
|
||||
const char *cmd = state ? "~0000 1\r" : "~0000 2\r";
|
||||
ESP_LOGD(TAG, "Sending command: %.*s", (int)(strlen(cmd) - 1), cmd);
|
||||
write_array(reinterpret_cast<const uint8_t *>(cmd), strlen(cmd));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user