added duplicate console to mqtt

This commit is contained in:
2022-02-14 19:31:24 +01:00
parent 6cacea2df3
commit 3a2e51713b
19 changed files with 262 additions and 166 deletions
+30
View File
@@ -0,0 +1,30 @@
/**
* @file outputStreamMqtt.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @version 0.1
* @date 2022-02-14
*
* @copyright Copyright (c) 2022
*
*/
#include "outputBufMqtt.h"
OutputBufMqtt::OutputBufMqtt(DebugMqtt* debugMqtt)
: std::streambuf() {
this->debugMqtt = debugMqtt;
}
std::streambuf::int_type OutputBufMqtt::overflow(std::streambuf::int_type c) {
if (c != EOF) {
// c = std::toupper(static_cast<char>(c), getloc());
this->debugMqtt->addCharacter((char) c);
Serial.print((char) c);
// if (putchar(c) == EOF) {
// return EOF;
// }
}
return c;
}