Skip to content

Commit

Permalink
set alert flag on api initiate send #37
Browse files Browse the repository at this point in the history
  • Loading branch information
Claypuppet committed May 14, 2019
1 parent c61fea7 commit 7d0be30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions bgeigiecast/i_api_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bool IApiConnector::time_to_send() const {

void IApiConnector::init_reading_report(Reading* reading) {
set_state(new ApiProcessReadingState(*this, reading));
_alert = reading->get_cpm() > 100; // TODO: configurable value
}

void IApiConnector::process_reading(Reading* reading) {
Expand Down
3 changes: 1 addition & 2 deletions bgeigiecast/user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#define API_SEND_FREQUENCY_SECONDS_ALERT 60 // 1 minute
#define API_SEND_FREQUENCY_SECONDS_DEV 30 // 30 seconds
#define API_SEND_FREQUENCY_SECONDS_ALERT_DEV 10 // 10 seconds
// max 3 with sending every 5 minutes would mean saving the last 15 minutes if connection failed
#define MAX_MISSED_READINGS 3
#define MAX_MISSED_READINGS 20 // Keep up to 20 readings in memory if connection to the api failed

/** Access point settings **/
#define ACCESS_POINT_SSID "bGeigie-%d"
Expand Down

0 comments on commit 7d0be30

Please sign in to comment.