gps.fix broken
This commit is contained in:
1 parent
59f6bc6d28
commit
6feb1c1f65
3 files changed
+22
-21
No files matched your search
@@ -195,12 +195,10 @@ 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[]) {
|
||||
|
||||
+21
-18
@@ -58,6 +58,7 @@ void sendData() {
|
||||
|
||||
uint8_t bitmask = cfg.payloadmask;
|
||||
uint8_t mask = 1;
|
||||
gpsStatus_t gps_status;
|
||||
|
||||
while (bitmask) {
|
||||
switch (bitmask & mask) {
|
||||
@@ -71,14 +72,15 @@ void sendData() {
|
||||
if (cfg.blescan)
|
||||
payload.addCount(macs_ble, MAC_SNIFF_BLE);
|
||||
#endif
|
||||
#if (HAS_GPS) && (GPSPORT == 1)
|
||||
// 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");
|
||||
#if (HAS_GPS)
|
||||
if (GPSPORT == COUNTERPORT) {
|
||||
// send GPS position only if we have a fix
|
||||
if (gps.location.isValid()) {
|
||||
gps_storelocation(&gps_status);
|
||||
payload.addGPS(gps_status);
|
||||
} else
|
||||
ESP_LOGD(TAG, "No valid GPS position");
|
||||
}
|
||||
#endif
|
||||
#if (PAYLOAD_OPENSENSEBOX)
|
||||
if (cfg.wifiscan)
|
||||
@@ -108,17 +110,18 @@ void sendData() {
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if (HAS_GPS) && (GPSPORT != 1)
|
||||
#if (HAS_GPS)
|
||||
case GPS_DATA:
|
||||
// send GPS position only if we have a fix
|
||||
if (gps.location.isValid()) {
|
||||
gpsStatus_t gps_status;
|
||||
gps_storelocation(&gps_status);
|
||||
payload.reset();
|
||||
payload.addGPS(gps_status);
|
||||
SendPayload(GPSPORT, prio_high);
|
||||
} else
|
||||
ESP_LOGD(TAG, "No valid GPS position");
|
||||
if (GPSPORT != COUNTERPORT) {
|
||||
// send GPS position only if we have a fix
|
||||
if (gps.location.isValid()) {
|
||||
gps_storelocation(&gps_status);
|
||||
payload.reset();
|
||||
payload.addGPS(gps_status);
|
||||
SendPayload(GPSPORT, prio_high);
|
||||
} else
|
||||
ESP_LOGD(TAG, "No valid GPS position");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user