Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send me to null island, please #1576

Merged
merged 4 commits into from
Jul 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/modules/PositionModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,22 @@ int32_t PositionModule::runOnce()

// Only send packets if the channel is less than 40% utilized.
if (airTime->channelUtilizationPercent() < 40) {
if (node->has_position && (node->position.latitude_i != 0 || node->position.longitude_i != 0)) {
lastGpsSend = now;

lastGpsSend = now;
lastGpsLatitude = node->position.latitude_i;
lastGpsLongitude = node->position.longitude_i;

lastGpsLatitude = node->position.latitude_i;
lastGpsLongitude = node->position.longitude_i;
// If we changed channels, ask everyone else for their latest info
bool requestReplies = currentGeneration != radioGeneration;
currentGeneration = radioGeneration;

// If we changed channels, ask everyone else for their latest info
bool requestReplies = currentGeneration != radioGeneration;
currentGeneration = radioGeneration;

DEBUG_MSG("Sending pos@%x:6 to mesh (wantReplies=%d)\n", node->position.pos_timestamp, requestReplies);

sendOurPosition(NODENUM_BROADCAST, requestReplies);
DEBUG_MSG("Sending pos@%x:6 to mesh (wantReplies=%d)\n", node->position.pos_timestamp, requestReplies);

sendOurPosition(NODENUM_BROADCAST, requestReplies);
}
} else {
DEBUG_MSG("Channel utilization is >50 percent. Skipping this opportunity to send.\n");
DEBUG_MSG("Channel utilization is >40 percent. Skipping this opportunity to send.\n");
}

} else if (!config.position.position_broadcast_smart_disabled) {
Expand Down