mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-11 07:01:25 +00:00
23 lines
574 B
C
23 lines
574 B
C
![]() |
#pragma once
|
||
|
#include "SinglePortModule.h"
|
||
|
|
||
|
class DetectionSensorModule : public SinglePortModule, private concurrency::OSThread
|
||
|
{
|
||
|
public:
|
||
|
DetectionSensorModule()
|
||
|
: SinglePortModule("detection", meshtastic_PortNum_TEXT_MESSAGE_APP), OSThread("DetectionSensorModule")
|
||
|
{
|
||
|
}
|
||
|
|
||
|
protected:
|
||
|
virtual int32_t runOnce() override;
|
||
|
|
||
|
private:
|
||
|
bool firstTime = true;
|
||
|
uint32_t lastSentToMesh = 0;
|
||
|
void sendDetectionMessage();
|
||
|
void sendCurrentStateMessage();
|
||
|
bool hasDetectionEvent();
|
||
|
};
|
||
|
|
||
|
extern DetectionSensorModule *detectionSensorModule;
|