PUD: initial state is MOVING again
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 5 Mar 2012 09:56:26 +0000 (10:56 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 5 Mar 2012 09:58:57 +0000 (10:58 +0100)
We want to start updating peers with our position
on a high update rate right from the start since
it improves convergence.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/receiver.c

index 21811b3..036a577 100644 (file)
@@ -75,8 +75,8 @@ typedef struct _StateType {
 
 /** The state */
 static StateType state = {
-               .internalState = STATIONARY,
-               .externalState = STATIONARY,
+               .internalState = MOVING,
+               .externalState = MOVING,
                .hysteresisCounter = 0
 };
 
@@ -916,8 +916,8 @@ bool startReceiver(void) {
        nmea_zero_INFO(&txPosition.nmeaInfo);
        memset(&txGateway, 0, sizeof(txGateway));
 
-       state.internalState = STATIONARY;
-       state.externalState = STATIONARY;
+       state.internalState = MOVING;
+       state.externalState = MOVING;
        state.hysteresisCounter = 0;
 
        initPositionAverageList(&positionAverageList, getAverageDepth());
@@ -948,8 +948,8 @@ void stopReceiver(void) {
        destroyPositionAverageList(&positionAverageList);
 
        state.hysteresisCounter = 0;
-       state.externalState = STATIONARY;
-       state.internalState = STATIONARY;
+       state.externalState = MOVING;
+       state.internalState = MOVING;
 
        memset(&txGateway, 0, sizeof(txGateway));
        nmea_zero_INFO(&txPosition.nmeaInfo);