You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the ESPTelnet in serveral tasks on ESP32.
The issue is that telnet.flush() does not flush the telnet stream on esp32.
There is no way to make sure that one stream has been fully sent before sending another one.
The mutex is useless because telnet.print() returns before the stream has been fully sent.
Serial.flush() does the job for Serial.
`template
void ToSerialAndTelnet(T msg)
{
xSemaphoreTake(xMutexPrint, portMAX_DELAY);
Serial.print(msg);
Serial.flush();
telnet.print(msg);
// how to make sure that the msg has been fully sent???
xSemaphoreGive(xMutexPrint);
}
Hi,
I'm using the ESPTelnet in serveral tasks on ESP32.
The issue is that telnet.flush() does not flush the telnet stream on esp32.
There is no way to make sure that one stream has been fully sent before sending another one.
The mutex is useless because telnet.print() returns before the stream has been fully sent.
Serial.flush() does the job for Serial.
`template
void ToSerialAndTelnet(T msg)
{
xSemaphoreTake(xMutexPrint, portMAX_DELAY);
Serial.print(msg);
Serial.flush();
telnet.print(msg);
// how to make sure that the msg has been fully sent???
xSemaphoreGive(xMutexPrint);
}
template <typename... Args>
void SerialAndTelnet(Args &&...args)
{
(ToSerialAndTelnet(args), ...);
}
template <typename... Args>
void SerialAndTelnetln(Args &&...args)
{
if constexpr (sizeof...(Args) == 0)
{
ToSerialAndTelnet('\n');
}
else
{
(ToSerialAndTelnet(args), ...);
ToSerialAndTelnet('\n');
}
}
`
The text was updated successfully, but these errors were encountered: