|
Generalized-Core-Counter 3.20
Particle-based generalized core counter firmware
|
This class is a singleton; you do not create one as a global, on the stack, or with new. More...
#include <Cloud.h>
Public Member Functions | |
| bool | loadConfigurationFromCloud () |
| Load and apply configuration from cloud ledgers. | |
| void | loop () |
| Service deferred cloud work; call from main loop. | |
| bool | publishDataToLedger () |
| Publish latest sensor data to device-data ledger. | |
| void | setup () |
| Perform setup operations; call this from global application setup(). | |
| bool | writeDeviceStatusToCloud () |
| Write current device configuration to device-status ledger. | |
Static Public Member Functions | |
| static Cloud & | instance () |
| Gets the singleton instance of this class, allocating it if necessary. | |
Protected Member Functions | |
| Cloud () | |
| The constructor is protected because the class is a singleton. | |
| Cloud (const Cloud &)=delete | |
| This class is a singleton and cannot be copied. | |
| Cloud & | operator= (const Cloud &)=delete |
| This class is a singleton and cannot be copied. | |
| virtual | ~Cloud () |
| The destructor is protected because the class is a singleton and cannot be deleted. | |
Static Protected Attributes | |
| static Cloud * | _instance |
| Singleton instance of this class. | |
This class is a singleton; you do not create one as a global, on the stack, or with new.
From global application setup you must call: Cloud::instance().setup();
|
protected |
The constructor is protected because the class is a singleton.
Use Cloud::instance() to instantiate the singleton.
Definition at line 27 of file Cloud.cpp.
Referenced by Cloud(), instance(), and operator=().
|
protectedvirtual |
|
protecteddelete |
This class is a singleton and cannot be copied.
References Cloud().
|
static |
Gets the singleton instance of this class, allocating it if necessary.
Use Cloud::instance() to instantiate the singleton.
Definition at line 20 of file Cloud.cpp.
References _instance, and Cloud().
Referenced by handleConnectingState(), handleFirmwareUpdateState(), loop(), publishData(), and setup().
| bool Cloud::loadConfigurationFromCloud | ( | ) |
Load and apply configuration from cloud ledgers.
Reads merged configuration from default-settings (Product scope) and device-settings (Device scope), with device settings overriding defaults.
Definition at line 153 of file Cloud.cpp.
Referenced by handleConnectingState(), and handleFirmwareUpdateState().
| void Cloud::loop | ( | ) |
Service deferred cloud work; call from main loop.
Used to keep any ledger/status publishing out of callback context and to avoid stacking multiple expensive operations in a single loop() iteration.
Definition at line 188 of file Cloud.cpp.
References writeDeviceStatusToCloud().
Referenced by loop().
This class is a singleton and cannot be copied.
References Cloud().
| bool Cloud::publishDataToLedger | ( | ) |
Publish latest sensor data to device-data ledger.
Updates the Device→Cloud ledger with current sensor readings, making data visible in Particle Console even when device is offline
Definition at line 589 of file Cloud.cpp.
References COUNTING, current, OCCUPANCY, SCHEDULED, and sysStatus.
| void Cloud::setup | ( | ) |
| bool Cloud::writeDeviceStatusToCloud | ( | ) |
Write current device configuration to device-status ledger.
Updates Device→Cloud ledger with current configuration for Console visibility.
Definition at line 520 of file Cloud.cpp.
References FIRMWARE_VERSION, sensorConfig, and sysStatus.
Referenced by loop().
|
staticprotected |
Singleton instance of this class.
The object pointer to this class is stored here. It's NULL at system boot.
Definition at line 257 of file Cloud.h.
Referenced by instance().