aboutsummaryrefslogtreecommitdiff
path: root/apps/mavlink/mavlink_log.h
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-10-22 08:14:43 +0200
committerLorenz Meier <lm@inf.ethz.ch>2012-10-22 08:14:43 +0200
commitdf8148033a1f60400693e80c3732a43cc26e0ee2 (patch)
tree5d2cbc85bbe40ad41ff8e0cb2854e17c3d4149d8 /apps/mavlink/mavlink_log.h
parent096bf2dc93fe8360fa83bee409452f8db7bc3593 (diff)
downloadpx4-firmware-df8148033a1f60400693e80c3732a43cc26e0ee2.tar.gz
px4-firmware-df8148033a1f60400693e80c3732a43cc26e0ee2.tar.bz2
px4-firmware-df8148033a1f60400693e80c3732a43cc26e0ee2.zip
Cleaned up calibration, added text messages ring buffer
Diffstat (limited to 'apps/mavlink/mavlink_log.h')
-rw-r--r--apps/mavlink/mavlink_log.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/apps/mavlink/mavlink_log.h b/apps/mavlink/mavlink_log.h
index 1ad1364be..cb6fd9d98 100644
--- a/apps/mavlink/mavlink_log.h
+++ b/apps/mavlink/mavlink_log.h
@@ -1,7 +1,7 @@
/****************************************************************************
*
- * Copyright (C) 2008-2012 PX4 Development Team. All rights reserved.
- * Author: @author Lorenz Meier <lm@inf.ethz.ch>
+ * Copyright (C) 2012 PX4 Development Team. All rights reserved.
+ * Author: Lorenz Meier <lm@inf.ethz.ch>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,6 +35,8 @@
/**
* @file mavlink_log.h
* MAVLink text logging.
+ *
+ * @author Lorenz Meier <lm@inf.ethz.ch>
*/
#ifndef MAVLINK_LOG
@@ -79,5 +81,28 @@
*/
#define mavlink_log_info(_fd, _text) ioctl(_fd, MAVLINK_IOC_SEND_TEXT_INFO, (unsigned long)_text);
+struct mavlink_logmessage {
+ char text[51];
+ unsigned char severity;
+};
+
+struct mavlink_logbuffer {
+ unsigned int start;
+ // unsigned int end;
+ unsigned int size;
+ int count;
+ struct mavlink_logmessage *elems;
+};
+
+void mavlink_logbuffer_init(struct mavlink_logbuffer *lb, int size);
+
+int mavlink_logbuffer_is_full(struct mavlink_logbuffer *lb);
+
+int mavlink_logbuffer_is_empty(struct mavlink_logbuffer *lb);
+
+void mavlink_logbuffer_write(struct mavlink_logbuffer *lb, const struct mavlink_logmessage *elem);
+
+int mavlink_logbuffer_read(struct mavlink_logbuffer *lb, struct mavlink_logmessage *elem);
+
#endif