![]() |
Data Gator
Hardware and software documentation for the Data Gator project.
|
Utilities for scheduling tasks and saving persistent data. More...
#include <NimBLEDevice.h>
#include <Adafruit_MAX1704X.h>
#include <OWMAdafruit_ADS1015.h>
#include <ble_util.hpp>
#include <VWCSensor.hpp>
#include <Teros10.hpp>
#include <Atlas_EZO-pH.hpp>
#include <Atlas_Gravity_pH.hpp>
Go to the source code of this file.
Classes | |
struct | planner |
Data structure for task scheduling stored in NVS. More... | |
Functions | |
void | init_nvs () |
Open NVS, check if it is initialized with data, if not, initialize it. | |
bool | task_is_scheduled (int reset_count) |
Check if a task will run this time, NVS must be initialized first! | |
void | ReadHT () |
Reads temperature and humidity sensors via BLE and then sends complete data to the database. | |
void | ReadWired () |
Reads all wired sensors attached to the aggregator. | |
void | OTAUpdate () |
Checks and updates from new code published at HTTPS address. | |
void | PatWDT () |
Pat the watchdog by raising watchdog done pin high, and then setting it low. | |
void | SendTLM () |
Send a telemetry message to the MQTT broker. | |
void | Scheduler (int reset_count) |
Perform a state transition based on the number of reset counts. | |
void | SchedulerClearAll (int reset_count) |
Clear all tasks so that none are scheduled to run. | |
Variables | |
bool | maxlipo_attached |
Fuel Gauge successfully initialized? | |
Adafruit_MAX17048 | maxlipo |
MAX17048 battery Fuel Gauge. | |
Adafruit_ADS1115 | ads |
Analog to digital converter object (I2C) | |
int | reset_count = -1 |
number of resets retrieved for NVS | |
struct planner | planner |
Utilities for scheduling tasks and saving persistent data.
Defines the mechanism for implementing task scheduling for sensors, OTA updates, etc. Timing is measured in "ticks". One tick is approximately 64 seconds or the time that the watchdog timer waits before reseting the device and waking it from hibernation. Ticks are tracked between power cycles using the non-volatile storage (NVS) system.
Perform a state transition based on the number of reset counts.
[in] | reset_count | The number of resets that have been performed in this epoch |
Clear all tasks so that none are scheduled to run.
[in] | reset_count | The number of reset counts to have elapsed. |
Check if a task will run this time, NVS must be initialized first!
[in] | reset_count | The number of resets recorded. |
true
if a task is scheduled to run this reboot cycle, false
otherwise
|
extern |
Analog to digital converter object (I2C)
Interface for the analog to digital converter.
|
extern |
MAX17048 battery Fuel Gauge.
Interface for the battery fuel gauge.
|
extern |
Fuel Gauge successfully initialized?
External flag indicating whether maxlipo was initialized successfully.
int reset_count = -1 |
number of resets retrieved for NVS
External variable holding the number of resets recorded by the system. Stored and loaded from non-volatile storage.