Include Libpax - WIP

This commit is contained in:
Thomas Göttgens
2023-12-17 16:00:57 +01:00
parent f1b380882d
commit add78a459b
6 changed files with 133 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
#pragma once
#include "ProtobufModule.h"
#include "configuration.h"
#if defined(ARCH_ESP32)
#include "../mesh/generated/meshtastic/paxcount.pb.h"
#include "NodeDB.h"
#include <libpax_api.h>
/**
* A simple example module that just replies with "Message received" to any message it receives.
*/
class PaxcounterModule : private concurrency::OSThread, public ProtobufModule<meshtastic_Paxcount>
{
bool firstTime = true;
public:
PaxcounterModule();
protected:
struct count_payload_t count_from_libpax;
virtual int32_t runOnce() override;
bool sendInfo(NodeNum dest = NODENUM_BROADCAST);
virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Paxcount *p) override;
virtual meshtastic_MeshPacket *allocReply() override;
};
extern PaxcounterModule *paxcounterModule;
#endif