some more experiments

This commit is contained in:
Robin Müller 2020-06-04 17:58:22 +02:00
parent 1cb241ca0c
commit d466921aa0

View File

@ -75,6 +75,8 @@ int ServiceInterfaceBuffer::sync(void) {
size_t preambleSize = 0; size_t preambleSize = 0;
auto preamble = getPreamble(&preambleSize); auto preamble = getPreamble(&preambleSize);
uint8_t debugArray[96];
memcpy(debugArray, preamble.data(), preambleSize);
// Write logMessage and time // Write logMessage and time
this->putChars(preamble.c_str(), preamble.c_str() + preambleSize); this->putChars(preamble.c_str(), preamble.c_str() + preambleSize);
// Handle output // Handle output
@ -124,12 +126,11 @@ std::string ServiceInterfaceBuffer::getPreamble(size_t * preambleSize) {
//// + zero_padded(loggerTime.second, 2) + "." //// + zero_padded(loggerTime.second, 2) + "."
//// + zero_padded(loggerTime.usecond/1000, 3) + " | "; //// + zero_padded(loggerTime.usecond/1000, 3) + " | ";
// currentSize += logMessage.size(); //+ 4 +2 +1 +2 +1 +2 +1 + 3 + 3; // currentSize += logMessage.size(); //+ 4 +2 +1 +2 +1 +2 +1 + 3 + 3;
// preamble[currentSize] = '\0'; preamble[++currentSize] = '\0';
// printf("%s", preamble.c_str()); uint8_t debugArray[96];
// uint8_t debugArray[96]; memcpy(debugArray, preamble.data(), currentSize);
// memcpy(debugArray, preamble.data(), currentSize); *preambleSize = currentSize;
// *preambleSize = currentSize; return std::move(preamble);
return preamble;
} }