paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [5207] Add periodic support to downlink_transport, i


From: Allen Ibara
Subject: [paparazzi-commits] [5207] Add periodic support to downlink_transport, implement periodic for udp_transport2, and add periodic function call to overo_test_telemetry2
Date: Tue, 03 Aug 2010 22:18:54 +0000

Revision: 5207
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5207
Author:   aibara
Date:     2010-08-03 22:18:53 +0000 (Tue, 03 Aug 2010)
Log Message:
-----------
Add periodic support to downlink_transport, implement periodic for 
udp_transport2, and add periodic function call to overo_test_telemetry2

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/downlink_transport.h
    paparazzi3/trunk/sw/airborne/fms/overo_test_telemetry2.c
    paparazzi3/trunk/sw/airborne/fms/udp_transport2.c

Modified: paparazzi3/trunk/sw/airborne/downlink_transport.h
===================================================================
--- paparazzi3/trunk/sw/airborne/downlink_transport.h   2010-08-03 16:28:27 UTC 
(rev 5206)
+++ paparazzi3/trunk/sw/airborne/downlink_transport.h   2010-08-03 22:18:53 UTC 
(rev 5207)
@@ -58,6 +58,7 @@
        void (*EndMessage)(void *impl);
        void (*Overrun)(void *impl);
        void (*CountBytes)(void *impl, uint8_t len);
+       void (*Periodic)(void *impl);
 
        void *impl;
 };

Modified: paparazzi3/trunk/sw/airborne/fms/overo_test_telemetry2.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/overo_test_telemetry2.c    2010-08-03 
16:28:27 UTC (rev 5206)
+++ paparazzi3/trunk/sw/airborne/fms/overo_test_telemetry2.c    2010-08-03 
22:18:53 UTC (rev 5207)
@@ -49,6 +49,10 @@
   float  foof = 3.14159265358979323846;
   double food = 3.14159265358979323846;
   DOWNLINK_SEND_TEST_FORMAT(udp_transport, &food, &foof);
+  
+  if (udp_transport->Periodic) {
+    udp_transport->Periodic(udp_transport->impl);
+  }
 
   ADD_TIMEOUT();
 

Modified: paparazzi3/trunk/sw/airborne/fms/udp_transport2.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/udp_transport2.c   2010-08-03 16:28:27 UTC 
(rev 5206)
+++ paparazzi3/trunk/sw/airborne/fms/udp_transport2.c   2010-08-03 22:18:53 UTC 
(rev 5207)
@@ -80,6 +80,15 @@
        return len + 2;
 }
 
+static void periodic(void *impl)
+{
+  struct udp_transport *udp = (struct udp_transport *) impl;
+  if (udp->udpt_tx_buf_idx > 0) {
+    network_write(udp->network, udp->updt_tx_buf, udp->udpt_tx_buf_idx);
+    udp->udpt_tx_buf_idx = 0;
+  }
+}
+
 struct DownlinkTransport *udp_transport_new(struct FmsNetwork *network)
 {
   struct DownlinkTransport *tp = calloc(1, sizeof(struct DownlinkTransport));
@@ -97,6 +106,7 @@
   tp->CountBytes = count_bytes;
   tp->SizeOf = size_of;
   tp->CheckFreeSpace = check_free_space;
+  tp->Periodic = periodic;
 
   return tp;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]