mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-17 04:22:14 +02:00
esp_modem: Return true from on_data callback in data mode
The callback should return false only if there is a problem with the received data. The updated UART Terminal implementation cannot longer clear is callback. It is DTE's responsibility to clear the callback.
This commit is contained in:
@ -87,7 +87,7 @@ void Netif::start()
|
||||
{
|
||||
ppp_dte->set_read_cb([this](uint8_t *data, size_t len) -> bool {
|
||||
receive(data, len);
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
esp_netif_action_start(driver.base.netif, nullptr, 0, nullptr);
|
||||
signal.set(PPP_STARTED);
|
||||
|
@ -39,7 +39,7 @@ void Netif::start()
|
||||
{
|
||||
ppp_dte->set_read_cb([this](uint8_t *data, size_t len) -> bool {
|
||||
receive(data, len);
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
netif->transmit = esp_modem_dte_transmit;
|
||||
netif->ctx = (void *)this;
|
||||
|
@ -125,9 +125,7 @@ void UartTerminal::task()
|
||||
case UART_DATA:
|
||||
uart_get_buffered_data_len(uart.port, &len);
|
||||
if (len && on_read) {
|
||||
if (on_read(nullptr, len)) {
|
||||
on_read = nullptr;
|
||||
}
|
||||
on_read(nullptr, len);
|
||||
}
|
||||
break;
|
||||
case UART_FIFO_OVF:
|
||||
|
Reference in New Issue
Block a user