Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
Loading...
Searching...
No Matches
State_Modes.cpp File Reference
#include "state/State_Common.h"
#include "Config.h"
#include "Cloud.h"
#include "LocalTimeRK.h"
#include "MyPersistentData.h"
#include "PublishQueuePosixRK.h"
#include "SensorManager.h"
#include "device_pinout.h"
#include "SensorDefinitions.h"

Go to the source code of this file.

Functions

void handleCountingMode ()
 Handle sensor events in COUNTING mode.
void handleOccupancyMode ()
 Handle sensor events in OCCUPANCY mode.
void updateOccupancyState ()
 Update occupancy state based on debounce timeout.

Function Documentation

◆ handleCountingMode()

void handleCountingMode ( )

Handle sensor events in COUNTING mode.

In counting mode, each sensor detection increments counters. Counts are tracked hourly and daily. Used for: traffic counting, people counting, event tracking

Definition at line 24 of file State_Modes.cpp.

References BLUE_LED, countSignalTimer, current, SensorManager::instance(), and loop().

Referenced by loop().

◆ handleOccupancyMode()

void handleOccupancyMode ( )

Handle sensor events in OCCUPANCY mode.

In occupancy mode, first detection marks space as "occupied". Space remains occupied until debounce timeout expires without new detections. Tracks total occupied time for reporting. Used for: room occupancy, parking space detection, resource availability

Definition at line 58 of file State_Modes.cpp.

References BLUE_LED, current, SensorManager::instance(), loop(), sysStatus, and updateOccupancyState().

Referenced by loop().

◆ updateOccupancyState()

void updateOccupancyState ( )

Update occupancy state based on debounce timeout.

If space is occupied and debounce timeout has expired without new sensor events, mark space as unoccupied. Accumulates total occupied time for daily reporting.

Definition at line 91 of file State_Modes.cpp.

References BLUE_LED, current, and sysStatus.

Referenced by handleOccupancyMode().