PUD: clarify unknown movement forcing STATIONARY
[olsrd.git] / 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;