|
|
|
@ -103,7 +103,7 @@ bool HWTSensorManager::begin() { |
|
|
|
|
|
|
|
bool HWTSensorManager::querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) { |
|
|
|
if (requester_permissions & TELEM_PERM_LOCATION) { // does requester have permission?
|
|
|
|
telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, 0.0f); |
|
|
|
telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
@ -117,6 +117,7 @@ void HWTSensorManager::loop() { |
|
|
|
if (gps_active && _location->isValid()) { |
|
|
|
node_lat = ((double)_location->getLatitude())/1000000.; |
|
|
|
node_lon = ((double)_location->getLongitude())/1000000.; |
|
|
|
node_altitude = ((double)_location->getAltitude()) / 1000.0; |
|
|
|
MESH_DEBUG_PRINTLN("lat %f lon %f", node_lat, node_lon); |
|
|
|
} |
|
|
|
next_gps_update = millis() + 1000; |
|
|
|
|