mirror of
https://github.com/MeshEnvy/lobbs.git
synced 2026-11-03 11:32:25 +01:00
feat(meshtastic): extract LoBBS plugin library
This commit is contained in:
1 parent
1f7ded8f3f
commit
5bffe8d259
124 files changed
+10907
-39
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#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
|
||||
Reference in new issue
Block a user