... | ... |
@@ -81,8 +81,6 @@ void setup() { |
81 | 81 |
#endif //_HELTEC_H_ |
82 | 82 |
Serial.begin(115200); |
83 | 83 |
|
84 |
- |
|
85 |
- |
|
86 | 84 |
Serial.println("------------------------------"); |
87 | 85 |
|
88 | 86 |
//BLE MAC Address will be new_mac + 2 |
... | ... |
@@ -119,7 +117,7 @@ void setup() { |
119 | 117 |
} |
120 | 118 |
sprintf(macStr,"%02x:%02x:%02x:%02x:%02x:%02x", new_mac[0], new_mac[1], new_mac[2], new_mac[3], new_mac[4], new_mac[5]); |
121 | 119 |
|
122 |
- beaconTypeStr = "Init Safe"; |
|
120 |
+ beaconTypeStr = "Init(Safe) "; |
|
123 | 121 |
|
124 | 122 |
// Create the BLE Device |
125 | 123 |
BLEDevice::init(BEACON_NAME); |
... | ... |
@@ -1,10 +1,7 @@ |
1 | 1 |
#ifndef _BEACON_H |
2 | 2 |
#define _BEACON_H |
3 | 3 |
|
4 |
-//#define BEACON_SLEEP_ADV 1500 //1.5s between uptime |
|
5 |
-#define BEACON_SLEEP_ADV 1000 //1.0s between uptime |
|
6 |
-//#define BEACON_SLEEP_ADV 200 //200ms between uptime |
|
7 |
-//#define BEACON_ADV_DURATION 200 //200ms |
|
4 |
+#define BEACON_SLEEP_ADV 2000 //1.0s between uptime |
|
8 | 5 |
#define BEACON_ADV_DURATION 400 //400ms |
9 | 6 |
#define BEACON_UUID "7c8a68a6-ddd0-11e9-8a34-2a2ae2dbcce4" |
10 | 7 |
#define BEACON_SERVICE_UUID "feaa" |
... | ... |
@@ -18,7 +15,7 @@ enum EN_BEACON_TYPE { |
18 | 15 |
EN_BEACON_TYPE_num = 5 |
19 | 16 |
}; |
20 | 17 |
|
21 |
-uint8_t beacon_type = EN_BEACON_TYPE_safe; |
|
18 |
+uint8_t beacon_type; |
|
22 | 19 |
String beaconTypeStr = ""; |
23 | 20 |
|
24 | 21 |
// Fake MAC Address for BLE beacon |
... | ... |
@@ -15,27 +15,27 @@ void pollPrg() |
15 | 15 |
switch( beacon_type ) { |
16 | 16 |
case EN_BEACON_TYPE_entry: |
17 | 17 |
beacon_type = EN_BEACON_TYPE_hazard; |
18 |
- beaconTypeStr="Hazard"; |
|
18 |
+ beaconTypeStr="Hazard "; |
|
19 | 19 |
break; |
20 | 20 |
case EN_BEACON_TYPE_hazard: |
21 | 21 |
beacon_type = EN_BEACON_TYPE_safe; |
22 |
- beaconTypeStr="Safe"; |
|
22 |
+ beaconTypeStr="Safe "; |
|
23 | 23 |
break; |
24 | 24 |
case EN_BEACON_TYPE_safe: |
25 | 25 |
beacon_type = EN_BEACON_TYPE_exit; |
26 |
- beaconTypeStr="Exit"; |
|
26 |
+ beaconTypeStr="Exit "; |
|
27 | 27 |
break; |
28 | 28 |
case EN_BEACON_TYPE_exit: |
29 | 29 |
beacon_type = EN_BEACON_TYPE_other; |
30 |
- beaconTypeStr="Other"; |
|
30 |
+ beaconTypeStr="Other "; |
|
31 | 31 |
break; |
32 | 32 |
case EN_BEACON_TYPE_other: |
33 | 33 |
beacon_type = EN_BEACON_TYPE_entry; |
34 |
- beaconTypeStr="Entry"; |
|
34 |
+ beaconTypeStr="Entry "; |
|
35 | 35 |
break; |
36 | 36 |
default: |
37 | 37 |
beacon_type = EN_BEACON_TYPE_safe; |
38 |
- beaconTypeStr="Safe"; |
|
38 |
+ beaconTypeStr="Safe "; |
|
39 | 39 |
break; |
40 | 40 |
} |
41 | 41 |
Serial.println("Switching to "+beaconTypeStr); |