Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: in DataUpload, commented unused function & added docs #132

Merged
merged 9 commits into from
Feb 5, 2025
Prev Previous commit
Next Next commit
docs: set a truth table for dataUpload return state
dataupload returns if data upload is possible, if we should go to
redeployment, or sleep, depending on if the recorder has data, if we are
connected to cloud services, if we are in water, and if battery has
sufficient voltage. illustrated in the docs via a truth table.
Tylody committed Jan 10, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c083ee44bbbcb2017ae3495c3e09db52c6a4288f
22 changes: 18 additions & 4 deletions src/cellular/dataUpload.hpp
Original file line number Diff line number Diff line change
@@ -51,12 +51,26 @@ class DataUpload : public Task{
*/
int initSuccess;
system_tick_t lastConnectTime;
//In smartfin-fw2/src/dataUpload::DataUpload::exitState(void), we return based on the water sensor state. If the system is in the water, we redeploy, otherwise we go to sleep.
//STATES_e exitState(void);
/**
* @brief Identifies if data upload is possible.
* Returns that the data upload is possible if: the recorder has data, is connected to a cloud
* service, is not in water, and the battery has enough voltage for an upload. If the system is currently in water, we redeploy, otherwise we go to sleep.
* | recorder has data | connected to cloud service | in water | battery has sufficient voltage | data upload is possible | smartfin redeploys | smartfin goes to sleep |
* |-------------------|----------------------------|----------|--------------------------------|-------------------------|--------------------|------------------------|
* | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
* | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
* | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
* | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
* | 0 | 1 | 0 | 0 | 0 | 0 | 1 |
* | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
* | 0 | 1 | 1 | 0 | 0 | 0 | 1 |
* | 0 | 1 | 1 | 1 | 0 | 0 | 1 |
* | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
* | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
* | 1 | 0 | 1 | 0 | 0 | 0 | 1 |
* | 1 | 0 | 1 | 1 | 0 | 0 | 1 |
* | 1 | 1 | 0 | 0 | 0 | 0 | 1 |
* | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
* | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
* | 1 | 1 | 1 | 1 | 0 | 1 | 0 |
* @return Returns state enumeration of STATE_UPLOAD, STATE_DEEP_SLEEP, or STATE_DEPLOYED upon execution.
*/
STATES_e can_upload(void);