diff --git a/docs/software/TODO.md b/docs/software/TODO.md index a33d090bc..3b75aca29 100644 --- a/docs/software/TODO.md +++ b/docs/software/TODO.md @@ -2,6 +2,7 @@ You probably don't care about this section - skip to the next one. +- report battery level to android app - @feh123 Sony Xperia Z1 C6903 running Android 5.1.1 - don't stop advertising BLE - first message sent is still doubled for some people diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index eebfb227e..59da36389 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -11,6 +11,7 @@ #include "PowerFSM.h" #include "main.h" #include "mesh-pb-constants.h" +#include "power.h" /* receivedPacketQueue - this is a queue of messages we've received from the mesh, which we are keeping to deliver to the phone. @@ -298,6 +299,9 @@ int MeshService::onGPSChanged(void *unused) pos.time = getValidTime(); } + // Include our current battery voltage in our position announcement + pos.battery_level = powerStatus.batteryChargePercent; + // We limit our GPS broadcasts to a max rate static uint32_t lastGpsSend; uint32_t now = millis();