Pārlūkot izejas kodu

Moved sensible configuration to an unversionned dedicated file

tags/v1.4.2^2
Bertrand Lemasle pirms 6 gadiem
vecāks
revīzija
a0f4605808
4 mainītis faili ar 25 papildinājumiem un 3 dzēšanām
  1. +4
    -1
      .gitignore
  2. +2
    -1
      src/config/Alerts.h
  3. +2
    -1
      src/config/BackupNetwork.h
  4. +17
    -0
      src/config/User.h

+ 4
- 1
.gitignore Parādīt failu

@@ -2,4 +2,7 @@
[Bb]in/

#Visual Studio code
.vscode/
.vscode/

#Unversionned sensitive data configuration file
/src/config/Sensitive.h

+ 2
- 1
src/config/Alerts.h Parādīt failu

@@ -1,5 +1,7 @@
#pragma once
#include "User.h"
/**
* Configure the values used for alerts triggering.
* Note that the battery level percentage are quite high,
@@ -16,7 +18,6 @@
#define CONFIG_BATTERY_ALERT_LEVEL2 38 ///< Battery percentage at which to trigger the final low battery alert.
#define CONFIG_BATTERY_ALERT_CLEAR 60 ///< Battery percentage at which to clear all battery alerts.
#define CONFIG_ACTIVE_ALERTS 0 ///< Default active alerts
#define CONFIG_CONTACT_PHONE "+642568452" ///< Default phone number to send the alert SMS to.
#define ALERT_SUSPICIOUS_RTC_TEMPERATURE 0 ///< Temperature at which to consider the RTC module as failling.


+ 2
- 1
src/config/BackupNetwork.h Parādīt failu

@@ -4,9 +4,10 @@
#pragma once
#include "User.h"
#define POSITIONS_CONFIG_NET_SAVE_THRESHOLD 30 ///< Determines how many positions will be saved before a network backup is needed (only when not moving though).
#define POSITIONS_CONFIG_NET_APN "Vodafone" ///< APN used for GPRS context
#define POSITIONS_CONFIG_NET_URL "http://yourserver.com/endpoint" ///< URL to which positions data will be send through an HTTP POST request
#define POSITIONS_CONFIG_NET_EXPECTED_RESPONSE 201 ///< Expected response code from the server that indicates that the positions has been successfully backuped.
#define POSITIONS_CONFIG_NET_UNAVAILABLE_NETWORK_POSTPONE_THRESHOLD 5 ///< Determines how many times to deal with an unreliable network before postponing the backup.
///< In an area where cell reception isn't good, this avoid to try to backup the positions


+ 17
- 0
src/config/User.h Parādīt failu

@@ -0,0 +1,17 @@
#pragma once
/**
* Holds all the sensitive data. Provided values are example only.
* Changes values according to your setup. This file changes are untracked so data
* will never go further than your local working copy.
*/
#include "Sensitive.h"
/**
* Copy and uncomment the following lines to a new User.h file. Edit the values according to your setup
*/
// #pragma once
// #define POSITIONS_CONFIG_NET_URL "http://yourserver.com/endpoint" ///< URL to which positions data will be send through an HTTP POST request.
// #define CONFIG_CONTACT_PHONE "+642568452" ///< Phone number to send the alert SMS to.

Notiek ielāde…
Atcelt
Saglabāt