PUD: clarify unknown movement forcing STATIONARY
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 6 Mar 2012 15:08:56 +0000 (16:08 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 13 Mar 2012 13:44:54 +0000 (14:44 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/receiver.c

index f150246..b64f095 100644 (file)
@@ -703,7 +703,7 @@ bool receiverUpdateGpsInformation(unsigned char * rxBuffer, size_t rxCount) {
 
        bool retval = false;
        PositionUpdateEntry * incomingEntry;
-       MovementState newState = STATIONARY;
+       MovementState newState;
        PositionUpdateEntry * posAvgEntry;
        MovementType movementResult;
        TristateBoolean movingNow;
@@ -795,6 +795,9 @@ bool receiverUpdateGpsInformation(unsigned char * rxBuffer, size_t rxCount) {
                newState = MOVING;
        } else if (movingNow == UNSET) {
                newState = STATIONARY;
+       } else {
+               /* force back to stationary for unknown movement */
+               newState = STATIONARY;
        }
        internalStateChange = (state.internalState != newState);
        state.internalState = newState;