init

Dependencies:   aconno_I2C Lis2dh12 WatchdogTimer

Revision:
52:bd7678eade77
Parent:
51:9078e6928412
Child:
54:2840f2d50734
--- a/main.h	Thu May 23 11:39:28 2019 +0000
+++ b/main.h	Wed May 29 22:59:12 2019 +0000
@@ -14,18 +14,19 @@
 #define MAIN_INTERFACE_H_
 
 //------------------------------------------------------------------------------
-//DEFINES
+//FW DETAILS
 //------------------------------------------------------------------------------ 
-#define FW_VERSION          20
+#define FW_VERSION          328
 //#define SKU                 "GPSPLUSDEV"
 #define SKU                 "GPSPLUS"
 #define HW_MAJORREVISION    "001"
 
-//MODES
-#define USE_NRF_TEMP_SENSOR                 1
+//OPTIONS
+#define USE_NRF_TEMP_SENSOR                 false
+#define BLE_ENABLED                         true
 
-//DEFAULT SETTINGS
-#define DEFAULT_SLEEP_FRAME                 60000
+//DEFAULT VELUES
+#define DEFAULT_SLEEP_FRAME                 30000
 #define DEFAULT_FORCE2G                     false
 #define DEFAULT_LOCATION_MODE               1
 #define DEFAULT_LOCATION_ACCURACY           1  // 0 = no location, 1 = cl only, 2 = gps then cl
@@ -40,6 +41,9 @@
 #define DEFAULT_CONNECTION_TIMEOUT          140
 #define DEFAULT_MAX_FAILED_CONNECTIONS      3 //max number of failed connections before device stops broadcasting until movement detected
 #define DEFAULT_MAX_FAILED_GPS              3 //max number of failed gps searches before device stops trying gps until movement detected
+#define DEFAULT_MAX_MODEMBROWNOUTS          2
+#define DEFAULT_BEACON_INTERVAL_SECONDS     10
+#define DEFAULT_BEACON_POWER                4 //(accepted values are -40, -30, -20, -16, -12, -8, -4, 0, and 4 dBm)
 
 //CONSTS
 #define ONEDAYINSECONDS                     86400
@@ -55,23 +59,23 @@
 
 //DEFINES
 #define ACTIVITY_BUFFERSIZE                 100
+#define DEBUG_BUFFERSIZE                    200
 
 //------------------------------------------------------------------------------
 //mbed Libraries
 //------------------------------------------------------------------------------
 #include "mbed.h"
 //#include "nrf_soc.h"
-#include "nrf_temp.h"
 #include "board.h"
-//#include "ble/BLE.h"
-//#include "FlashIAPBlockDevice.h"
-
+#if BLE_ENABLED 
+    #include "ble/BLE.h" 
+#endif
 //------------------------------------------------------------------------------
 //peripheral Libraries
 //------------------------------------------------------------------------------
 #include "WatchdogTimer.h"
 #include "LIS3DH.h"
-//#include "SI7060.h"
+#include "SI7060.h"
 #include "acd_nrf52_saadc.h"
 
 //------------------------------------------------------------------------------
@@ -84,6 +88,13 @@
 #include "sensors.h"
 #include "modem.h"
 
+//BLE SERVICE IDS
+#define BLE_SERVICEID_GPSPLUS               0xfb10
+#define BLE_SERVICEID_PFDETECTOR1           0x4e96
+#define BLE_SERVICEID_PFBEACON1             0xfe9a //ESTIMOTE
+#define BLE_SERVICEID_BT04                  0xcbff //TZBT04 Temp/humid
+#define BLE_SERVICEID_PFBEACON2             0xfb20
+
 //------------------------------------------------------------------------------
 //Global macros
 //------------------------------------------------------------------------------
@@ -104,7 +115,9 @@
 extern bool GLOBAL_LEDSequenceinProgress;
 extern time_t GLOBAL_RTCunixtime;
 extern time_t GLOBAL_wakeTime;
-extern char GLOBAL_debug_buffer[200];
+extern char GLOBAL_debug_buffer[DEBUG_BUFFERSIZE];
+extern char GLOBAL_GPSlocString_prev[70];
+extern bool GLOBAL_have_GPSlocString_prev;
 //FUNCS
 extern void watchdogKick();