Merge pull request #522 from cyberman54/development

hotfix gps position data wrong in payload
This commit is contained in:
Verkehrsrot 2020-01-05 12:30:43 +01:00 committed by GitHub
commit 04850fd5c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,12 +74,8 @@ int gps_config() {
void gps_storelocation(gpsStatus_t *gps_store) {
if (gps.location.isUpdated() && gps.location.isValid() &&
(gps.location.age() < 1500)) {
// gps_store->latitude = (int32_t)(gps.location.lat() * 1e6);
// gps_store->longitude = (int32_t)(gps.location.lng() * 1e6);
gps_store->latitude =
(int32_t)((gps.location.lat() + 90) / 180.0) * 16777215;
gps_store->longitude =
(int32_t)((gps.location.lng() + 180) / 360.0) * 16777215;
gps_store->latitude = (int32_t)(gps.location.lat() * 1e6);
gps_store->longitude = (int32_t)(gps.location.lng() * 1e6);
gps_store->satellites = (uint8_t)gps.satellites.value();
gps_store->hdop = (uint16_t)gps.hdop.value();
gps_store->altitude = (int16_t)gps.altitude.meters();