|
Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
|
Go to the source code of this file.
Functions | |
| void | dailyCleanup () |
| Cleanup function that is run at the beginning of the day. | |
| void | ensureSensorEnabled (const char *context) |
| bool | isRadioPoweredOn () |
| void | publishData () |
| Publish sensor data to Ubidots webhook and device-data ledger. | |
| bool | publishDiagnosticSafe (const char *eventName, const char *data, PublishFlags flags) |
| Publish a state transition to the log handler. | |
| void | requestFullDisconnectAndRadioOff () |
| void | requestRadioPowerOff () |
| void dailyCleanup | ( | ) |
Cleanup function that is run at the beginning of the day.
May or may not be in connected state. Syncs time with remote service and sets low power mode. Called from Reporting State ONLY. Cleans house at the beginning of a new day.
Definition at line 693 of file Generalized-Core-Counter.cpp.
| void ensureSensorEnabled | ( | const char * | context | ) |
Definition at line 15 of file State_Idle.cpp.
References SensorManager::initializeFromConfig(), SensorManager::instance(), and SensorManager::onExitSleep().
Referenced by handleIdleState(), and handleSleepingState().
| bool isRadioPoweredOn | ( | ) |
Definition at line 21 of file State_Connect.cpp.
Referenced by handleSleepingState().
| void publishData | ( | ) |
Publish sensor data to Ubidots webhook and device-data ledger.
1) Builds a compact JSON payload expected by the Ubidots webhook template and enqueues it via PublishQueuePosix to the "Ubidots-Parking-Hook-v1" event. 2) Updates the Particle Ledger "device-data" with a richer JSON snapshot via Cloud::publishDataToLedger() for Console visibility.
Definition at line 509 of file Generalized-Core-Counter.cpp.
|
extern |
Publish a state transition to the log handler.
Safely publish diagnostic message through queue with depth guard.
Routes low-priority diagnostic messages through PublishQueuePosix only when queue depth is below threshold, preventing displacement of critical telemetry data during tight loops or error conditions.
| eventName | The event name for the publish. |
| data | The event data payload. |
| flags | Particle publish flags (e.g., PRIVATE). |
Definition at line 633 of file Generalized-Core-Counter.cpp.
Referenced by dailyCleanup(), handleConnectingState(), sysStatusData::initialize(), and UbidotsHandler().
| void requestFullDisconnectAndRadioOff | ( | ) |
Definition at line 41 of file State_Connect.cpp.
References requestRadioPowerOff().
Referenced by handleConnectingState(), handleErrorState(), and handleSleepingState().
| void requestRadioPowerOff | ( | ) |
Definition at line 31 of file State_Connect.cpp.
Referenced by requestFullDisconnectAndRadioOff().