mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-29 22:20:37 +00:00
Add ourGroupInfo to NodeDB
This commit is contained in:
@@ -2,9 +2,13 @@
|
||||
#include "MeshService.h"
|
||||
#include "Router.h"
|
||||
#include "configuration.h"
|
||||
#include "NodeDB.h"
|
||||
|
||||
|
||||
GroupPlugin *groupPlugin;
|
||||
|
||||
|
||||
|
||||
GroupPlugin::GroupPlugin()
|
||||
: ProtobufPlugin("group", PortNum_GROUP_APP, GroupInfo_fields), concurrency::OSThread("GroupPlugin")
|
||||
{
|
||||
@@ -14,7 +18,7 @@ GroupPlugin::GroupPlugin()
|
||||
|
||||
bool GroupPlugin::handleReceivedProtobuf(const MeshPacket &mp, GroupInfo *pptr)
|
||||
{
|
||||
auto p = *pptr;
|
||||
//auto p = *pptr;
|
||||
|
||||
|
||||
|
||||
@@ -23,15 +27,17 @@ bool GroupPlugin::handleReceivedProtobuf(const MeshPacket &mp, GroupInfo *pptr)
|
||||
|
||||
MeshPacket *GroupPlugin::allocReply()
|
||||
{
|
||||
return allocDataProtobuf(p);
|
||||
GroupInfo gi = GroupInfo_init_default; // Start with an empty structure
|
||||
|
||||
return allocDataProtobuf(gi);
|
||||
}
|
||||
|
||||
int32_t GroupPlugin::runOnce()
|
||||
{
|
||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
||||
|
||||
|
||||
|
||||
|
||||
//ourGroupInfo.group[0][1] = "a";
|
||||
|
||||
return 5000; // to save power only wake for our callback occasionally
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/**
|
||||
* Position plugin for sending/receiving positions into the mesh
|
||||
*/
|
||||
class GroupPlugin : private concurrency::OSThread, public ProtobufPlugin<GroupInfo>
|
||||
class GroupPlugin : public ProtobufPlugin<GroupInfo>, private concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
GroupPlugin();
|
||||
|
||||
Reference in New Issue
Block a user