pud: further adjustments for new nmealib
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 20 Jul 2016 12:36:08 +0000 (14:36 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 20 Jul 2016 13:14:07 +0000 (15:14 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/posAvg.c
lib/pud/src/posAvg.h

index e4143c4..99a325c 100644 (file)
@@ -288,10 +288,26 @@ static void updateCounters(PositionAverageList * positionAverageList,
                assert(add ? (counters->satinuse < maxCount):(counters->satinuse > 0));
                counters->satinuse += amount;
        }
+       if (nmeaInfoIsPresentAll(present, NMEALIB_PRESENT_SATINVIEWCOUNT)) {
+         assert(add ? (counters->satinviewcount < maxCount) : (counters->satinviewcount > 0));
+         counters->satinviewcount += amount;
+       }
        if (nmeaInfoIsPresentAll(present, NMEALIB_PRESENT_SATINVIEW)) {
                assert(add ? (counters->satinview < maxCount):(counters->satinview > 0));
                counters->satinview += amount;
        }
+       if (nmeaInfoIsPresentAll(present, NMEALIB_PRESENT_HEIGHT)) {
+         assert(add ? (counters->height < maxCount) : (counters->height > 0));
+         counters->height += amount;
+       }
+       if (nmeaInfoIsPresentAll(present, NMEALIB_PRESENT_DGPSAGE)) {
+         assert(add ? (counters->dgpsage < maxCount) : (counters->dgpsage > 0));
+         counters->dgpsage += amount;
+       }
+       if (nmeaInfoIsPresentAll(present, NMEALIB_PRESENT_DGPSSID)) {
+         assert(add ? (counters->dgpssid < maxCount) : (counters->dgpssid > 0));
+         counters->dgpssid += amount;
+       }
 
        /* smask */
        if ((smask & NMEALIB_SENTENCE_GPGGA) != 0) {
@@ -418,9 +434,21 @@ static void determineCumulativePresentSmaskSigFix(
        if (counters->satinuse >= count) {
          nmeaInfoSetPresent(&cumulative->nmeaInfo.present, NMEALIB_PRESENT_SATINUSE);
        }
+       if (counters->satinviewcount >= count) {
+         nmeaInfoSetPresent(&cumulative->nmeaInfo.present, NMEALIB_PRESENT_SATINVIEWCOUNT);
+       }
        if (counters->satinview >= count) {
          nmeaInfoSetPresent(&cumulative->nmeaInfo.present, NMEALIB_PRESENT_SATINVIEW);
        }
+       if (counters->height >= count) {
+         nmeaInfoSetPresent(&cumulative->nmeaInfo.present, NMEALIB_PRESENT_HEIGHT);
+       }
+       if (counters->dgpsage >= count) {
+         nmeaInfoSetPresent(&cumulative->nmeaInfo.present, NMEALIB_PRESENT_DGPSAGE);
+       }
+       if (counters->dgpssid >= count) {
+         nmeaInfoSetPresent(&cumulative->nmeaInfo.present, NMEALIB_PRESENT_DGPSSID);
+       }
 
        /* smask */
        cumulative->nmeaInfo.smask = 0;
index e92225c..1be5bc2 100644 (file)
@@ -95,7 +95,11 @@ typedef struct _PositionUpdateCounters {
                unsigned long long magvar; /**< the number of entries with MAGVAR present */
                unsigned long long satinusecount; /**< the number of entries with SATINUSECOUNT present */
                unsigned long long satinuse; /**< the number of entries with SATINUSE present */
+               unsigned long long satinviewcount; /**< the number of entries with SATINVIEWCOUNT present */
                unsigned long long satinview; /**< the number of entries with SATINVIEW present */
+               unsigned long long height; /**< the number of entries with HEIGHT present */
+               unsigned long long dgpsage; /**< the number of entries with DGPSAGE present */
+               unsigned long long dgpssid; /**< the number of entries with DGPSSID present */
 
                /* smask */
                unsigned long long gpgga; /**< the number of GPGGA based entries */