Added GPS DOP support (#199)

This commit is contained in:
Professr
2020-06-20 18:59:41 -07:00
parent aaa6af3f38
commit da8a048dce
5 changed files with 26 additions and 4 deletions

View File

@@ -68,6 +68,19 @@ void perhapsSetRTC(struct tm &t)
perhapsSetRTC(&tv);
}
// Generate a string representation of the DOP
// based on Wikipedia "meaning of DOP values" https://en.wikipedia.org/wiki/Dilution_of_precision_(navigation)#Meaning_of_DOP_Values
const char *getDOPString(uint32_t dop) {
dop = dop / 100;
if(dop <= 1) return "GPS Ideal";
if(dop <= 2) return "GPS Exc.";
if(dop <= 5) return "GPS Good";
if(dop <= 10) return "GPS Mod.";
if(dop <= 20) return "GPS Fair";
if(dop > 0) return "GPS Poor";
return "invalid dop";
}
#include <time.h>
uint32_t getTime()