@@ -337,8 +337,9 @@ bool EnvironmentSensorManager::begin() {
337337bool EnvironmentSensorManager::querySensors (uint8_t requester_permissions, CayenneLPP& telemetry) {
338338 next_available_channel = TELEM_CHANNEL_SELF + 1 ;
339339
340- if (requester_permissions & TELEM_PERM_LOCATION && gps_active && gps_fix_valid ) {
340+ if (requester_permissions & TELEM_PERM_LOCATION && gps_active) {
341341 telemetry.addGPS (TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude);
342+ telemetry.addSwitch (TELEM_CHANNEL_SELF, gps_has_fix);
342343 }
343344
344345 if (requester_permissions & TELEM_PERM_ENVIRONMENT) {
@@ -718,9 +719,9 @@ void EnvironmentSensorManager::loop() {
718719 MESH_DEBUG_PRINTLN (" lat %f lon %f" , node_lat, node_lon);
719720 node_altitude = ((double )_location->getAltitude ()) / 1000.0 ;
720721 MESH_DEBUG_PRINTLN (" lat %f lon %f alt %f" , node_lat, node_lon, node_altitude);
721- gps_fix_valid = true ;
722+ gps_has_fix = true ;
722723 } else {
723- gps_fix_valid = false ;
724+ gps_has_fix = false ;
724725 }
725726 #else
726727 if (_location->isValid ()) {
@@ -729,9 +730,9 @@ void EnvironmentSensorManager::loop() {
729730 MESH_DEBUG_PRINTLN (" lat %f lon %f" , node_lat, node_lon);
730731 node_altitude = ((double )_location->getAltitude ()) / 1000.0 ;
731732 MESH_DEBUG_PRINTLN (" lat %f lon %f alt %f" , node_lat, node_lon, node_altitude);
732- gps_fix_valid = true ;
733+ gps_has_fix = true ;
733734 } else {
734- gps_fix_valid = false ;
735+ gps_has_fix = false ;
735736 }
736737 #endif
737738 }
0 commit comments