enable GPS default,fix SenseBox payload,whitespace
This commit is contained in:
parent
6feb1c1f65
commit
b7a640e02f
@ -171,7 +171,7 @@ Output of sensor and peripheral data is internally switched by a bitmask registe
|
|||||||
|
|
||||||
| Bit | Sensordata | Default
|
| Bit | Sensordata | Default
|
||||||
| --- | ------------- | -------
|
| --- | ------------- | -------
|
||||||
| 0 | GPS | off*
|
| 0 | GPS* | on
|
||||||
| 1 | Beacon alarm | on
|
| 1 | Beacon alarm | on
|
||||||
| 2 | BME280/680 | on
|
| 2 | BME280/680 | on
|
||||||
| 3 | Paxcounter | on
|
| 3 | Paxcounter | on
|
||||||
|
@ -8,10 +8,10 @@ static const char TAG[] = "flash";
|
|||||||
nvs_handle my_handle;
|
nvs_handle my_handle;
|
||||||
esp_err_t err;
|
esp_err_t err;
|
||||||
|
|
||||||
#define PAYLOADMASK \
|
#define PAYLOADMASK \
|
||||||
((ALARM_DATA | MEMS_DATA | COUNT_DATA | SENSOR1_DATA | SENSOR2_DATA | \
|
((GPS_DATA | ALARM_DATA | MEMS_DATA | COUNT_DATA | \
|
||||||
SENSOR3_DATA) & \
|
SENSOR1_DATA | SENSOR2_DATA | SENSOR3_DATA) & \
|
||||||
(~BATT_DATA) & (~GPS_DATA))
|
(~BATT_DATA) )
|
||||||
|
|
||||||
// populate cfg vars with factory settings
|
// populate cfg vars with factory settings
|
||||||
void defaultConfig() {
|
void defaultConfig() {
|
||||||
|
@ -93,7 +93,7 @@
|
|||||||
#define RCMDPORT 2 // remote commands
|
#define RCMDPORT 2 // remote commands
|
||||||
#define STATUSPORT 2 // remote command results
|
#define STATUSPORT 2 // remote command results
|
||||||
#define CONFIGPORT 3 // config query 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 BUTTONPORT 5 // button pressed signal
|
||||||
#define BEACONPORT 6 // beacon alarms
|
#define BEACONPORT 6 // beacon alarms
|
||||||
#define BMEPORT 7 // BME680 sensor
|
#define BMEPORT 7 // BME680 sensor
|
||||||
|
@ -195,10 +195,12 @@ void PayloadConvert::addStatus(uint16_t voltage, uint64_t uptime, float cputemp,
|
|||||||
void PayloadConvert::addGPS(gpsStatus_t value) {
|
void PayloadConvert::addGPS(gpsStatus_t value) {
|
||||||
#if(HAS_GPS)
|
#if(HAS_GPS)
|
||||||
writeLatLng(value.latitude, value.longitude);
|
writeLatLng(value.latitude, value.longitude);
|
||||||
|
#if (!PAYLOAD_OPENSENSEBOX)
|
||||||
writeUint8(value.satellites);
|
writeUint8(value.satellites);
|
||||||
writeUint16(value.hdop);
|
writeUint16(value.hdop);
|
||||||
writeUint16(value.altitude);
|
writeUint16(value.altitude);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void PayloadConvert::addSensor(uint8_t buf[]) {
|
void PayloadConvert::addSensor(uint8_t buf[]) {
|
||||||
|
@ -68,7 +68,7 @@ void sendData() {
|
|||||||
payload.reset();
|
payload.reset();
|
||||||
#if !(PAYLOAD_OPENSENSEBOX)
|
#if !(PAYLOAD_OPENSENSEBOX)
|
||||||
if (cfg.wifiscan)
|
if (cfg.wifiscan)
|
||||||
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
|
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
|
||||||
if (cfg.blescan)
|
if (cfg.blescan)
|
||||||
payload.addCount(macs_ble, MAC_SNIFF_BLE);
|
payload.addCount(macs_ble, MAC_SNIFF_BLE);
|
||||||
#endif
|
#endif
|
||||||
@ -76,15 +76,15 @@ void sendData() {
|
|||||||
if (GPSPORT == COUNTERPORT) {
|
if (GPSPORT == COUNTERPORT) {
|
||||||
// send GPS position only if we have a fix
|
// send GPS position only if we have a fix
|
||||||
if (gps.location.isValid()) {
|
if (gps.location.isValid()) {
|
||||||
gps_storelocation(&gps_status);
|
gps_storelocation(&gps_status);
|
||||||
payload.addGPS(gps_status);
|
payload.addGPS(gps_status);
|
||||||
} else
|
} else
|
||||||
ESP_LOGD(TAG, "No valid GPS position");
|
ESP_LOGD(TAG, "No valid GPS position");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if (PAYLOAD_OPENSENSEBOX)
|
#if (PAYLOAD_OPENSENSEBOX)
|
||||||
if (cfg.wifiscan)
|
if (cfg.wifiscan)
|
||||||
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
|
payload.addCount(macs_wifi, MAC_SNIFF_WIFI);
|
||||||
if (cfg.blescan)
|
if (cfg.blescan)
|
||||||
payload.addCount(macs_ble, MAC_SNIFF_BLE);
|
payload.addCount(macs_ble, MAC_SNIFF_BLE);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user