From 1776fd3bd3d539dcf17f00d5ee4cd9f2ef672c12 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 14 Nov 2024 22:07:53 -0800 Subject: [PATCH 1/2] docs: added documentation to private members of class DataUpload documented exitState, can_upload, initSuccess --- src/cellular/dataUpload.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/cellular/dataUpload.hpp b/src/cellular/dataUpload.hpp index dac4bafc..13fe4d25 100644 --- a/src/cellular/dataUpload.hpp +++ b/src/cellular/dataUpload.hpp @@ -44,9 +44,24 @@ class DataUpload : public Task{ void exit(void); private: + /** + * @brief Stores if data upload state successfully initializes. + * Variable storing 1 if system successfully enters data upload state, or 0 if system times out + * before entering data upload state. + */ int initSuccess; system_tick_t lastConnectTime; + /** + * @brief Exits data upload state. + * Function ends data upload process then enters deep sleep state. + */ 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. Otherwise, + * changes current state from upload state to deep sleep, or deployed if currently in water. + */ STATES_e can_upload(void); }; #endif \ No newline at end of file From c926f212c53b3e385c55a1b61574d8f6ab9332e3 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 21 Nov 2024 22:38:00 -0800 Subject: [PATCH 2/2] fix: in DataUpload, commented unused function & added docs documented initSuccess, and canUpload commented out exitState (unused function) --- src/cellular/dataUpload.cpp | 5 ++++- src/cellular/dataUpload.hpp | 11 ++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cellular/dataUpload.cpp b/src/cellular/dataUpload.cpp index fe2d626b..10af155e 100644 --- a/src/cellular/dataUpload.cpp +++ b/src/cellular/dataUpload.cpp @@ -157,7 +157,10 @@ void DataUpload::exit(void) } } +// 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 DataUpload::exitState(void) { return STATE_DEEP_SLEEP; -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/src/cellular/dataUpload.hpp b/src/cellular/dataUpload.hpp index 13fe4d25..e6a3830d 100644 --- a/src/cellular/dataUpload.hpp +++ b/src/cellular/dataUpload.hpp @@ -51,16 +51,13 @@ class DataUpload : public Task{ */ int initSuccess; system_tick_t lastConnectTime; - /** - * @brief Exits data upload state. - * Function ends data upload process then enters deep sleep state. - */ - STATES_e exitState(void); + //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. Otherwise, - * changes current state from upload state to deep sleep, or deployed if currently in water. + * 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. + * @return Returns state enumeration of STATE_UPLOAD, STATE_DEEP_SLEEP, or STATE_DEPLOYED upon execution. */ STATES_e can_upload(void); };