mirror of
https://github.com/meshtastic/firmware.git
synced 2026-03-31 13:34:41 -04:00
24 lines
618 B
C++
24 lines
618 B
C++
#pragma once
|
|
#include "SinglePortModule.h"
|
|
|
|
class DetectionSensorModule : public SinglePortModule, private concurrency::OSThread
|
|
{
|
|
public:
|
|
DetectionSensorModule()
|
|
: SinglePortModule("detection", meshtastic_PortNum_DETECTION_SENSOR_APP), OSThread("DetectionSensorModule")
|
|
{
|
|
}
|
|
|
|
protected:
|
|
virtual int32_t runOnce() override;
|
|
|
|
private:
|
|
bool firstTime = true;
|
|
uint32_t lastSentToMesh = 0;
|
|
bool wasDetected = false;
|
|
void sendDetectionMessage();
|
|
void sendCurrentStateMessage(bool state);
|
|
bool hasDetectionEvent();
|
|
};
|
|
|
|
extern DetectionSensorModule *detectionSensorModule; |