   (let [ba ^"[B" (Arrays/copyOfRange
                   ^"[B" (.array bb)
                   offset
-                  (+ offset len))]
-    (ByteBuffer/wrap ba)))
+                  (+ offset len))
+        bb (ByteBuffer/wrap ba)]
+    (.order bb ByteOrder/LITTLE_ENDIAN)
+    bb))
 
 (defn get-ushort [^ByteBuffer bb]
   (bit-and 0xFFFF (Integer. (int (.getShort bb)))))

      :vision-flag vision-flag
      :state pstate)))

;;    (swap! navdata merge new-data)))

(defn new-datagram-packet [^bytes data ^InetAddress host ^long port]
  (DatagramPacket. data (count data) host port))

    :seqnum :uint32-le
    :vision-flag :uint32-le)))


(defn parse-navdata [navdata-bytes]
  (log/debug "-- parse-navdata")
  (let [^ByteBuffer bb (doto ^ByteBuffer (gloss.io/to-byte-buffer navdata-bytes)
