openthread: fix wrong OpenThread uart read return value handling

This commit is contained in:
Jiacheng Guo
2021-06-08 19:49:37 +08:00
parent 0ea9ae2920
commit c88e1e3712

View File

@@ -119,7 +119,7 @@ esp_err_t esp_openthread_uart_process()
if (rval > 0) {
otPlatUartReceived(s_uart_buffer, (uint16_t)rval);
} else if (rval > 0) {
} else if (rval < 0) {
if (errno != EAGAIN) {
otLogWarnPlat("read uart failed: %d", errno);
return ESP_FAIL;