Include Libpax - WIP
This commit is contained in:
29
src/modules/esp32/PaxcounterModule.h
Normal file
29
src/modules/esp32/PaxcounterModule.h
Normal 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
|
||||
Reference in New Issue
Block a user