 
 
 (defn raise-event [drone event-type & args]
+  (log/debug "Event" event-type args)
   (when-let [handler (:event-handler drone)]
     (apply handler event-type args)))
 
+(defn communication-check [drone navdata]
+  (when (= :problem (-> navdata :state :com-watchdog))
+    (log/info "Watchdog Reset")
+    (command drone :reset-watchdog)))
+
 (defn process-navdata [drone navdata]
+  (communication-check drone navdata)
   (raise-event drone :navdata navdata))
 
 (defn- navdata-thread-fn [drone]

        ^DatagramPacket packet (navdata/new-datagram-packet
                                (byte-array 2048) (:host drone) navdata-port)]
    (loop []
      (when @(:keep-streaming-navdata drone)
        (try
          (do
            (navdata/receive-navdata socket packet)
            (log/debug packet)
            (process-navdata drone (navdata/parse-navdata (.getData packet))))
          (catch IOException e
            (reset! (:keep-streaming-navdata drone) false)
            (raise-event drone :error e)))
        (recur)))))

(defn- start-navdata! [drone]
  (reset! (:keep-streaming-navdata drone) true)

(defn get-nav-data [drone]
  (:nav-data drone))

