enable GPS default,fix SenseBox payload,whitespace

This commit is contained in:
nerdyscout 2019-11-27 20:26:03 +00:00
parent 6feb1c1f65
commit b7a640e02f
5 changed files with 12 additions and 10 deletions

View File

@ -171,7 +171,7 @@ Output of sensor and peripheral data is internally switched by a bitmask registe
| Bit | Sensordata | Default
| --- | ------------- | -------
| 0 | GPS | off*
| 0 | GPS* | on
| 1 | Beacon alarm | on
| 2 | BME280/680 | on
| 3 | Paxcounter | on

View File

@ -8,10 +8,10 @@ static const char TAG[] = "flash";
nvs_handle my_handle;
esp_err_t err;
#define PAYLOADMASK \
((ALARM_DATA | MEMS_DATA | COUNT_DATA | SENSOR1_DATA | SENSOR2_DATA | \
SENSOR3_DATA) & \
(~BATT_DATA) & (~GPS_DATA))
#define PAYLOADMASK \
((GPS_DATA | ALARM_DATA | MEMS_DATA | COUNT_DATA | \
SENSOR1_DATA | SENSOR2_DATA | SENSOR3_DATA) & \
(~BATT_DATA) )
// populate cfg vars with factory settings
void defaultConfig() {

View File

@ -93,7 +93,7 @@
#define RCMDPORT 2 // remote commands
#define STATUSPORT 2 // remote command results
#define CONFIGPORT 3 // config query results
#define GPSPORT 4 // gps - set to 1 to send combined GPS+COUNT payload
#define GPSPORT 4 // gps - set to 1 to send combined GPS+COUNTERPORT payload
#define BUTTONPORT 5 // button pressed signal
#define BEACONPORT 6 // beacon alarms
#define BMEPORT 7 // BME680 sensor

View File

@ -195,10 +195,12 @@ void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime, float cputemp,
void PayloadConvert::addGPS(gpsStatus_t value) {
#if(HAS_GPS)
writeLatLng(value.latitude, value.longitude);
#if (!PAYLOAD_OPENSENSEBOX)
writeUint8(value.satellites);
writeUint16(value.hdop);
writeUint16(value.altitude);
#endif
#endif
}
void PayloadConvert::addSensor(uint8_t buf[]) {

View File

@ -68,7 +68,7 @@ void sendData() {
payload.reset();
#if !(PAYLOAD_OPENSENSEBOX)
if (cfg.wifiscan)
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
if (cfg.blescan)
payload.addCount(macs_ble, MAC_SNIFF_BLE);
#endif
@ -76,15 +76,15 @@ void sendData() {
if (GPSPORT == COUNTERPORT) {
// send GPS position only if we have a fix
if (gps.location.isValid()) {
gps_storelocation(&gps_status);
payload.addGPS(gps_status);
gps_storelocation(&gps_status);
payload.addGPS(gps_status);
} else
ESP_LOGD(TAG, "No valid GPS position");
}
#endif
#if (PAYLOAD_OPENSENSEBOX)
if (cfg.wifiscan)
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
if (cfg.blescan)
payload.addCount(macs_ble, MAC_SNIFF_BLE);
#endif