mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-01 11:42:45 +00:00
Merge branch 'master' into nmea-serial
This commit is contained in:
commit
efe2e90a03
@ -283,3 +283,8 @@ int MeshService::onGPSChanged(const meshtastic::GPSStatus *newStatus)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MeshService::isToPhoneQueueEmpty()
|
||||||
|
{
|
||||||
|
return toPhoneQueue.isEmpty();
|
||||||
|
}
|
@ -89,6 +89,8 @@ class MeshService
|
|||||||
/// Send a packet to the phone
|
/// Send a packet to the phone
|
||||||
void sendToPhone(MeshPacket *p);
|
void sendToPhone(MeshPacket *p);
|
||||||
|
|
||||||
|
bool isToPhoneQueueEmpty();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Called when our gps position has changed - updates nodedb and sends Location message out into the mesh
|
/// Called when our gps position has changed - updates nodedb and sends Location message out into the mesh
|
||||||
/// returns 0 to allow futher processing
|
/// returns 0 to allow futher processing
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <OLEDDisplay.h>
|
#include <OLEDDisplay.h>
|
||||||
#include <OLEDDisplayUi.h>
|
#include <OLEDDisplayUi.h>
|
||||||
|
#include "MeshService.h"
|
||||||
|
|
||||||
int32_t DeviceTelemetryModule::runOnce()
|
int32_t DeviceTelemetryModule::runOnce()
|
||||||
{
|
{
|
||||||
@ -18,8 +19,9 @@ int32_t DeviceTelemetryModule::runOnce()
|
|||||||
&& airTime->channelUtilizationPercent() < max_channel_util_percent) {
|
&& airTime->channelUtilizationPercent() < max_channel_util_percent) {
|
||||||
sendTelemetry();
|
sendTelemetry();
|
||||||
lastSentToMesh = now;
|
lastSentToMesh = now;
|
||||||
} else {
|
} else if (service.isToPhoneQueueEmpty()) {
|
||||||
// Just send to phone when it's not our time to send to mesh yet
|
// Just send to phone when it's not our time to send to mesh yet
|
||||||
|
// Only send while queue is empty (phone assumed connected)
|
||||||
sendTelemetry(NODENUM_BROADCAST, true);
|
sendTelemetry(NODENUM_BROADCAST, true);
|
||||||
}
|
}
|
||||||
return sendToPhoneIntervalMs;
|
return sendToPhoneIntervalMs;
|
||||||
|
@ -11,7 +11,8 @@ class DeviceTelemetryModule : private concurrency::OSThread, public ProtobufModu
|
|||||||
DeviceTelemetryModule()
|
DeviceTelemetryModule()
|
||||||
: concurrency::OSThread("DeviceTelemetryModule"), ProtobufModule("DeviceTelemetry", PortNum_TELEMETRY_APP, &Telemetry_msg)
|
: concurrency::OSThread("DeviceTelemetryModule"), ProtobufModule("DeviceTelemetry", PortNum_TELEMETRY_APP, &Telemetry_msg)
|
||||||
{
|
{
|
||||||
lastMeasurementPacket = nullptr;
|
lastMeasurementPacket = nullptr;
|
||||||
|
setIntervalFromNow(10 * 1000);
|
||||||
}
|
}
|
||||||
virtual bool wantUIFrame() { return false; }
|
virtual bool wantUIFrame() { return false; }
|
||||||
|
|
||||||
|
@ -12,7 +12,8 @@ class EnvironmentTelemetryModule : private concurrency::OSThread, public Protobu
|
|||||||
: concurrency::OSThread("EnvironmentTelemetryModule"),
|
: concurrency::OSThread("EnvironmentTelemetryModule"),
|
||||||
ProtobufModule("EnvironmentTelemetry", PortNum_TELEMETRY_APP, &Telemetry_msg)
|
ProtobufModule("EnvironmentTelemetry", PortNum_TELEMETRY_APP, &Telemetry_msg)
|
||||||
{
|
{
|
||||||
lastMeasurementPacket = nullptr;
|
lastMeasurementPacket = nullptr;
|
||||||
|
setIntervalFromNow(10 * 1000);
|
||||||
}
|
}
|
||||||
virtual bool wantUIFrame() override;
|
virtual bool wantUIFrame() override;
|
||||||
#if !HAS_SCREEN
|
#if !HAS_SCREEN
|
||||||
|
Loading…
Reference in New Issue
Block a user