From 032cfa0f8e099132b1b7ab1a14a8181d0ab72b2c Mon Sep 17 00:00:00 2001 From: nerdyscout Date: Thu, 21 Nov 2019 20:18:03 +0000 Subject: [PATCH] changes opensensebox payload struct --- include/globals.h | 2 -- src/gpsread.cpp | 2 -- src/payload.cpp | 2 ++ 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/globals.h b/include/globals.h index 8f2ef032..43902886 100644 --- a/include/globals.h +++ b/include/globals.h @@ -95,11 +95,9 @@ typedef struct { typedef struct { int32_t latitude; int32_t longitude; -#if !(PAYLOAD_OPENSENSEBOX) uint8_t satellites; uint16_t hdop; int16_t altitude; -#endif } gpsStatus_t; typedef struct { diff --git a/src/gpsread.cpp b/src/gpsread.cpp index e8540a1c..eab3b3b3 100644 --- a/src/gpsread.cpp +++ b/src/gpsread.cpp @@ -76,11 +76,9 @@ void gps_storelocation(gpsStatus_t *gps_store) { (gps.location.age() < 1500)) { gps_store->latitude = (int32_t)(gps.location.lat() * 1e6); gps_store->longitude = (int32_t)(gps.location.lng() * 1e6); -#if !(PAYLOAD_OPENSENSEBOX) gps_store->satellites = (uint8_t)gps.satellites.value(); gps_store->hdop = (uint16_t)gps.hdop.value(); gps_store->altitude = (int16_t)gps.altitude.meters(); -#endif } } diff --git a/src/payload.cpp b/src/payload.cpp index 1ddf1fbf..3c3001d0 100644 --- a/src/payload.cpp +++ b/src/payload.cpp @@ -89,12 +89,14 @@ void PayloadConvert::addGPS(gpsStatus_t value) { buffer[cursor++] = (byte)((value.longitude & 0x00FF0000) >> 16); buffer[cursor++] = (byte)((value.longitude & 0x0000FF00) >> 8); buffer[cursor++] = (byte)((value.longitude & 0x000000FF)); +#if (!PAYLOAD_OPENSENSEBOX) buffer[cursor++] = value.satellites; buffer[cursor++] = highByte(value.hdop); buffer[cursor++] = lowByte(value.hdop); buffer[cursor++] = highByte(value.altitude); buffer[cursor++] = lowByte(value.altitude); #endif +#endif } void PayloadConvert::addSensor(uint8_t buf[]) {