mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 18:09:04 +00:00
Don't send me to null island, please (#1576)
* Don't send me to null island, please * Typo Co-authored-by: Sacha Weatherstone <sachaw100@hotmail.com>
This commit is contained in:
parent
f0518bc99a
commit
fd27a814b7
@ -133,22 +133,22 @@ int32_t PositionModule::runOnce()
|
|||||||
|
|
||||||
// Only send packets if the channel is less than 40% utilized.
|
// Only send packets if the channel is less than 40% utilized.
|
||||||
if (airTime->channelUtilizationPercent() < 40) {
|
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;
|
// If we changed channels, ask everyone else for their latest info
|
||||||
lastGpsLongitude = node->position.longitude_i;
|
bool requestReplies = currentGeneration != radioGeneration;
|
||||||
|
currentGeneration = radioGeneration;
|
||||||
|
|
||||||
// If we changed channels, ask everyone else for their latest info
|
DEBUG_MSG("Sending pos@%x:6 to mesh (wantReplies=%d)\n", node->position.pos_timestamp, requestReplies);
|
||||||
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);
|
|
||||||
|
|
||||||
|
sendOurPosition(NODENUM_BROADCAST, requestReplies);
|
||||||
|
}
|
||||||
} else {
|
} 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) {
|
} else if (!config.position.position_broadcast_smart_disabled) {
|
||||||
|
Loading…
Reference in New Issue
Block a user