mirror of
https://github.com/esphome/esphome.git
synced 2026-08-22 22:26:21 +00:00
Drop dead stub enum, gate get_modem_pins error ack on client 1.16, clarify ack comment
This commit is contained in:
@@ -2816,9 +2816,9 @@ message SerialProxyRequest {
|
|||||||
SerialProxyRequestType type = 2; // Request type
|
SerialProxyRequestType type = 2; // Request type
|
||||||
}
|
}
|
||||||
|
|
||||||
// Acknowledges a serial proxy operation (subscribe, unsubscribe, flush,
|
// Acknowledges a serial proxy operation; the type field identifies which
|
||||||
// configure, or modem pin change). Sent since API 1.16; the type field
|
// operation is being acknowledged. Flush has been acknowledged since the
|
||||||
// identifies which operation is being acknowledged.
|
// message was introduced; all other acknowledgements are sent since API 1.16.
|
||||||
message SerialProxyRequestResponse {
|
message SerialProxyRequestResponse {
|
||||||
option (id) = 147;
|
option (id) = 147;
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
|
|||||||
@@ -1632,6 +1632,11 @@ void APIConnection::on_serial_proxy_get_modem_pins_request(const SerialProxyGetM
|
|||||||
resp.instance = msg.instance;
|
resp.instance = msg.instance;
|
||||||
if (msg.instance >= proxies.size()) {
|
if (msg.instance >= proxies.size()) {
|
||||||
ESP_LOGW(TAG, "Serial proxy instance %" PRIu32 " out of range", msg.instance);
|
ESP_LOGW(TAG, "Serial proxy instance %" PRIu32 " out of range", msg.instance);
|
||||||
|
// Pre-1.16 clients do not read the status field and would take this error
|
||||||
|
// for a successful "both pins deasserted" answer; let them time out as before
|
||||||
|
if (!this->client_supports_api_version(1, 16)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
resp.status = enums::SERIAL_PROXY_STATUS_INVALID_ARGUMENT;
|
resp.status = enums::SERIAL_PROXY_STATUS_INVALID_ARGUMENT;
|
||||||
} else {
|
} else {
|
||||||
resp.line_states = proxies[msg.instance]->get_modem_pins();
|
resp.line_states = proxies[msg.instance]->get_modem_pins();
|
||||||
|
|||||||
@@ -13,15 +13,6 @@ namespace api {
|
|||||||
class APIConnection;
|
class APIConnection;
|
||||||
} // namespace api
|
} // namespace api
|
||||||
|
|
||||||
namespace uart {
|
|
||||||
enum class UARTFlushResult : uint8_t {
|
|
||||||
UART_FLUSH_RESULT_SUCCESS,
|
|
||||||
UART_FLUSH_RESULT_ASSUMED_SUCCESS,
|
|
||||||
UART_FLUSH_RESULT_TIMEOUT,
|
|
||||||
UART_FLUSH_RESULT_FAILED,
|
|
||||||
};
|
|
||||||
} // namespace uart
|
|
||||||
|
|
||||||
namespace serial_proxy {
|
namespace serial_proxy {
|
||||||
|
|
||||||
enum class SerialProxyResult : uint8_t {
|
enum class SerialProxyResult : uint8_t {
|
||||||
|
|||||||
Reference in New Issue
Block a user