diff --git a/protobufs b/protobufs index 9e61b8233..a45a6154d 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 9e61b8233181715363aba2aa6c91e85a2d61fc73 +Subproject commit a45a6154d0721027bf63f85cfc5abd9f6fab2422 diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp index 864b246a3..d60e3825c 100644 --- a/src/gps/RTC.cpp +++ b/src/gps/RTC.cpp @@ -222,9 +222,8 @@ bool perhapsSetRTC(RTCQuality q, struct tm &t) */ int32_t getTZOffset() { - time_t now; + time_t now = getTime(false); struct tm *gmt; - now = time(NULL); gmt = gmtime(&now); gmt->tm_isdst = -1; return (int32_t)difftime(now, mktime(gmt)); @@ -265,4 +264,4 @@ time_t gm_mktime(struct tm *tm) setenv("TZ", "UTC0", 1); } return res; -} +} \ No newline at end of file diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 7748dd6b3..f0ff9bed0 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -57,7 +57,9 @@ typedef enum _meshtastic_TelemetrySensorType { /* Lite On LTR-390UV-01 UV Light Sensor */ meshtastic_TelemetrySensorType_LTR390UV = 21, /* AMS TSL25911FN RGB Light Sensor */ - meshtastic_TelemetrySensorType_TSL25911FN = 22 + meshtastic_TelemetrySensorType_TSL25911FN = 22, + /* AHT10 Integrated temperature and humidity sensor */ + meshtastic_TelemetrySensorType_AHT10 = 23 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -168,8 +170,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_TSL25911FN -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_TSL25911FN+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_AHT10 +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_AHT10+1)) diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index f3a70f4c5..002111171 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -211,11 +211,11 @@ meshtastic_MeshPacket *PositionModule::allocReply() // Strip out any time information before sending packets to other nodes - to keep the wire size small (and because other // nodes shouldn't trust it anyways) Note: we allow a device with a local GPS to include the time, so that gpsless // devices can get time. - if (getRTCQuality() < RTCQualityDevice) { + if (getRTCQuality() < RTCQualityGPS) { LOG_INFO("Stripping time %u from position send\n", p.time); p.time = 0; } else { - p.time = getValidTime(RTCQualityDevice); + p.time = getValidTime(RTCQualityGPS); LOG_INFO("Providing time to mesh %u\n", p.time); } @@ -454,4 +454,4 @@ void PositionModule::handleNewPosition() } } -#endif \ No newline at end of file +#endif