paparazzi-commits
[Top][All Lists]
Advanced

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

[paparazzi-commits] [5180] Add overo_test_telemetry2 to test new message


From: Allen Ibara
Subject: [paparazzi-commits] [5180] Add overo_test_telemetry2 to test new messages2/ dowlink_transport telemetry on overo
Date: Tue, 27 Jul 2010 22:01:40 +0000

Revision: 5180
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5180
Author:   aibara
Date:     2010-07-27 22:01:40 +0000 (Tue, 27 Jul 2010)
Log Message:
-----------
Add overo_test_telemetry2 to test new messages2/dowlink_transport telemetry on 
overo

Modified Paths:
--------------
    paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile

Added Paths:
-----------
    paparazzi3/trunk/sw/airborne/fms/overo_test_telemetry2.c

Modified: paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile    2010-07-27 
21:44:42 UTC (rev 5179)
+++ paparazzi3/trunk/conf/autopilot/lisa_test_progs.makefile    2010-07-27 
22:01:40 UTC (rev 5180)
@@ -56,6 +56,15 @@
 overo_test_telemetry.srcs    += $(SRC_FMS)/fms_network.c
 overo_test_telemetry.LDFLAGS += -levent
 
+# test network based telemetry on overo (using udp_transport2/messages2)
+overo_test_telemetry2.ARCHDIR  = omap
+overo_test_telemetry2.CFLAGS  += -I$(ACINCLUDE) -I. 
-I$(PAPARAZZI_HOME)/var/include
+overo_test_telemetry2.srcs     = $(SRC_FMS)/overo_test_telemetry2.c
+overo_test_telemetry2.CFLAGS  += -DDOWNLINK -DDOWNLINK_TRANSPORT=UdpTransport
+overo_test_telemetry2.srcs    += $(SRC_FMS)/udp_transport2.c downlink.c
+overo_test_telemetry2.srcs    += $(SRC_FMS)/fms_network.c
+overo_test_telemetry2.LDFLAGS += -levent
+
 # test periodic tasks on the overo
 overo_test_periodic.ARCHDIR  = omap
 overo_test_periodic.CFLAGS  += -I$(ACINCLUDE) -I. 
-I$(PAPARAZZI_HOME)/var/include

Added: paparazzi3/trunk/sw/airborne/fms/overo_test_telemetry2.c
===================================================================
--- paparazzi3/trunk/sw/airborne/fms/overo_test_telemetry2.c                    
        (rev 0)
+++ paparazzi3/trunk/sw/airborne/fms/overo_test_telemetry2.c    2010-07-27 
22:01:40 UTC (rev 5180)
@@ -0,0 +1,68 @@
+
+#include <inttypes.h>
+
+#include <stdio.h>
+
+#include <event.h>
+#include <evutil.h>
+
+#include "downlink_transport.h"
+#include "messages2.h"
+#include "udp_transport2.h"
+#include "fms_network.h"
+
+#define GCS_HOST "10.10.13.32"
+#define GCS_PORT 4242
+#define DATALINK_PORT 4243
+
+#define TIMEOUT_DT_SEC  0
+//#define TIMEOUT_DT_USEC 500000
+#define TIMEOUT_DT_USEC 50000
+
+
+#define ADD_TIMEOUT() {                                \
+    struct timeval tv;                         \
+    evutil_timerclear(&tv);                    \
+    tv.tv_sec  = TIMEOUT_DT_SEC;               \
+    tv.tv_usec = TIMEOUT_DT_USEC;              \
+    event_add(&timeout, &tv);                  \
+  }
+
+static void timeout_cb(int fd, short event, void *arg);
+
+static struct event timeout;
+static struct FmsNetwork* network;
+static struct DownlinkTrasport *udp_transport;
+
+void timeout_cb(int fd, short event, void *arg) {
+
+  //  printf("in timeout_cb\n");
+
+  DOWNLINK_SEND_ALIVE(udp_transport, 16, MD5SUM);
+
+  float  foof = 3.14159265358979323846;
+  double food = 3.14159265358979323846;
+  DOWNLINK_SEND_TEST_FORMAT(udp_transport, &food, &foof);
+
+  ADD_TIMEOUT();
+
+}
+
+
+int main(int argc, char** argv) {
+
+  network = network_new(GCS_HOST, GCS_PORT, DATALINK_PORT, FALSE);
+  udp_transport = udp_transport_new(network);
+
+  /* Initalize the event library */
+  event_init();
+
+  /* Add a timeout event */
+  evtimer_set(&timeout, timeout_cb, &timeout);
+
+  ADD_TIMEOUT();
+
+  event_dispatch();
+
+  return 0;
+}




reply via email to

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