Skip to content

Commit 7ab9a94

Browse files
committed
just off the coast of NULL Island isn't OK either.
1 parent 3c3d391 commit 7ab9a94

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/modules/PositionModule.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ meshtastic_MeshPacket *PositionModule::allocReply()
116116
}
117117
localPosition.seq_number++;
118118

119+
if (localPosition.latitude_i == 0 && localPosition.longitude_i == 0) {
120+
LOG_WARN("Skipping position send because lat/lon are zero!\n");
121+
return nullptr;
122+
}
123+
119124
// lat/lon are unconditionally included - IF AVAILABLE!
120125
LOG_DEBUG("Sending location with precision %i\n", precision);
121126
if (precision < 32 && precision > 0) {
@@ -176,11 +181,6 @@ meshtastic_MeshPacket *PositionModule::allocReply()
176181
LOG_INFO("Providing time to mesh %u\n", p.time);
177182
}
178183

179-
if (p.latitude_i == 0 && p.longitude_i == 0) {
180-
LOG_WARN("Skipping position send because lat/lon are zero!\n");
181-
return nullptr;
182-
}
183-
184184
LOG_INFO("Position reply: time=%i, latI=%i, lonI=%i\n", p.time, p.latitude_i, p.longitude_i);
185185

186186
// TAK Tracker devices should send their position in a TAK packet over the ATAK port

0 commit comments

Comments
 (0)