Skip to content

Commit 500a46c

Browse files
committed
chore: enable gps temporarily if permission is set
1 parent 699d1cd commit 500a46c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

variants/t1000-e/target.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,14 @@ bool T1000SensorManager::begin() {
151151

152152
bool T1000SensorManager::querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) {
153153
if (requester_permissions & TELEM_PERM_LOCATION) { // does requester have permission?
154-
telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude);
154+
if (gps_active) {
155+
telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude);
156+
} else {
157+
start_gps();
158+
// TODO: wait for fix
159+
stop_gps();
160+
telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude);
161+
}
155162
}
156163
if (requester_permissions & TELEM_PERM_ENVIRONMENT) {
157164
// Firmware reports light as a 0-100 % scale, but expose it via Luminosity so app labels it "Luminosity".

0 commit comments

Comments
 (0)