mirror of
https://github.com/MeshEnvy/lobbs.git
synced 2026-11-03 03:22:21 +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,31 @@
|
||||
#if !MESHTASTIC_EXCLUDE_LOBBS
|
||||
|
||||
#include "ConfigCommon.h"
|
||||
#include "../../LoBBSModule.h"
|
||||
#include "ConfigDal.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "LoBBSStackGuard.h"
|
||||
|
||||
void lobbsConfigPushKey(std::vector<LoScalar> &keys, const char *key, uint32_t def, uint32_t min, uint32_t max, const char *help)
|
||||
{
|
||||
if (!key)
|
||||
return;
|
||||
LoScalar rec;
|
||||
rec.setString(LODB_F_TITLE, key);
|
||||
if (help)
|
||||
rec.setString(LODB_F_DESCRIPTION, help);
|
||||
rec.setUint32(ConfigKeyField::FIELD_DEFAULT, def);
|
||||
rec.setUint32(ConfigKeyField::FIELD_MIN, min);
|
||||
rec.setUint32(ConfigKeyField::FIELD_MAX, max);
|
||||
keys.push_back(rec);
|
||||
}
|
||||
|
||||
uint32_t lobbsConfigGet(LoBBSCommandCtx &ctx, const char *key)
|
||||
{
|
||||
if (!ctx.mod || !key)
|
||||
return 0;
|
||||
return ctx.mod->config().dal().effectiveValue(ctx, key);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user