PUD: Introduce an extra 'gateway' flag in the wire format
authorFerry Huberts <f.huberts@mindef.nl>
Fri, 21 Oct 2011 14:26:43 +0000 (16:26 +0200)
committerFerry Huberts <f.huberts@mindef.nl>
Fri, 21 Oct 2011 15:55:41 +0000 (17:55 +0200)
and always clear it

Signed-off-by: Ferry Huberts <f.huberts@mindef.nl>
lib/pud/src/gpsConversion.c
lib/pud/wireformat-java/resources/WireFormatConstants.java.h
lib/pud/wireformat/include/OlsrdPudWireFormat/wireFormat.h

index ca11ca0..733a732 100644 (file)
@@ -253,6 +253,8 @@ unsigned int gpsToOlsr(nmeaINFO *nmeaInfo, union olsr_message *olsrMessage,
        setPositionUpdateVersion(olsrGpsMessage, PUD_WIRE_FORMAT_VERSION);
        setValidityTime(&olsrGpsMessage->validityTime, validityTime);
        setPositionUpdateSmask(olsrGpsMessage, nmeaInfo->smask);
+       setPositionUpdateFlags(olsrGpsMessage,
+                       getPositionUpdateFlags(olsrGpsMessage) & ~PUD_FLAGS_GATEWAY);
 
        /* utc is always present, we make sure of that elsewhere, so just use it */
        setPositionUpdateTime(olsrGpsMessage, nmeaInfo->utc.hour, nmeaInfo->utc.min,
index 81cb5f2..dc89788 100644 (file)
@@ -16,6 +16,7 @@ public class WireFormatConstants {
        public static final int VERSION = PUD_WIRE_FORMAT_VERSION;
 
        public static final int FLAGS_ID = PUD_FLAGS_ID;
+       public static final int FLAGS_GATEWAY = PUD_FLAGS_GATEWAY;
 
        public static final int TIME_BITS = PUD_TIME_BITS;
 
index c5497e0..272b6d0 100644 (file)
@@ -25,6 +25,9 @@
 /** Flags that the GPS information contains the nodeId */
 #define PUD_FLAGS_ID                           0x80
 
+/** Flags that the GPS information is originating from a gateway */
+#define PUD_FLAGS_GATEWAY                      0x40
+
 /*
  * Time
  */