combined gps payload (issue #482)
This commit is contained in:
1 parent
c826240d94
commit
bc9d550b7d
5 files changed
+32
-18
No files matched your search
@@ -9,9 +9,9 @@ nvs_handle my_handle;
|
||||
esp_err_t err;
|
||||
|
||||
#define PAYLOADMASK \
|
||||
((GPS_DATA | ALARM_DATA | MEMS_DATA | COUNT_DATA | SENSOR1_DATA | \
|
||||
SENSOR2_DATA | SENSOR3_DATA) & \
|
||||
~BATT_DATA)
|
||||
((ALARM_DATA | MEMS_DATA | COUNT_DATA | SENSOR1_DATA | SENSOR2_DATA | \
|
||||
SENSOR3_DATA) & \
|
||||
(~BATT_DATA) & (~GPS_DATA))
|
||||
|
||||
// populate cfg vars with factory settings
|
||||
void defaultConfig() {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define SENDCYCLE 30 // payload send cycle [seconds/2], 0 .. 255
|
||||
#define PAYLOAD_ENCODER 2 // payload encoder: 1=Plain, 2=Packed, 3=Cayenne LPP dynamic, 4=Cayenne LPP packed
|
||||
#define COUNTERMODE 0 // 0=cyclic, 1=cumulative, 2=cyclic confirmed
|
||||
#define PAYLOAD_GPS 1 // add gps location to pax count payload: 0=no, 1=yes
|
||||
|
||||
// Set this to include BLE counting and vendor filter functions, or to switch off WIFI counting
|
||||
#define VENDORFILTER 1 // set to 0 if you want to count things, not people
|
||||
|
||||
+13
-1
@@ -65,9 +65,21 @@ void sendData() {
|
||||
#if ((WIFICOUNTER) || (BLECOUNTER))
|
||||
case COUNT_DATA:
|
||||
payload.reset();
|
||||
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
|
||||
if (cfg.wifiscan)
|
||||
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
|
||||
if (cfg.blescan)
|
||||
payload.addCount(macs_ble, MAC_SNIFF_BLE);
|
||||
|
||||
#if (PAYLOAD_GPS)
|
||||
// send GPS position only if we have a fix
|
||||
if (gps.location.isValid()) {
|
||||
gpsStatus_t gps_status;
|
||||
gps_storelocation(&gps_status);
|
||||
payload.addGPS(gps_status);
|
||||
} else
|
||||
ESP_LOGD(TAG, "No valid GPS position");
|
||||
#endif
|
||||
|
||||
SendPayload(COUNTERPORT, prio_normal);
|
||||
// clear counter if not in cumulative counter mode
|
||||
if (cfg.countermode != 1) {
|
||||
|
||||
Reference in new issue
Block a user