mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 18:52:30 +00:00
Initial Detection sensor module feature (#2722)
* WIP * Updates * Doh! * Move it out of the macro guard so portduino can build * Changes from feedback
This commit is contained in:
23
src/modules/DetectionSensorModule.h
Normal file
23
src/modules/DetectionSensorModule.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#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;
|
||||
Reference in New Issue
Block a user