Files
lobbs/protocol/machine/serialize.cpp
T

27 lines
521 B
C++

#if !MESHTASTIC_EXCLUDE_LOBBS
#include "serialize.h"
#include <cstddef>
#include "LoBBSStackGuard.h"
bool lobbsSerializeMachine(const LoBBSResponse &resp, std::string &out)
{
out.clear();
if (!resp.ok) {
out = resp.error;
return true;
}
for (const LoScalar &rec : resp.records) {
if (!out.empty())
out.push_back('\n');
std::string line;
if (!rec.encode(line, SIZE_MAX))
return false;
out += line;
}
return true;
}
#endif