31 lines
652 B
C++
31 lines
652 B
C++
/**
|
|
* @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;
|
|
}
|