GPS-Logging
Logging von GPS Daten direkt auf einer SD-Karte, bzw. übers netzwerk zu einem syslog server.
Speicherung auf SD-Karte und Netzwerk übertragung:
#if SERIAL_LINE_LOG_SUPPORT || VFS_SD_SUPPORT || TCP_SUPPORT
#else
#error Please define VFS_SD_SUPPORT, SERIAL_LINE_LOG_SUPPORT and TCP_SUPPORT
#endif
#include "protocols/serial_line_log/serial_line_log.h"
extern struct serial_line_log_data sll_data;
CONTROL_START
ON STARTUP DO
TCP_CONNECT(10.0.0.77, 99, message_handler);
END
TCP_HANDLER_PERSIST(message_handler)
for (;;) {
if ( sll_data.len >= 1 ) {
TCP_SEND("%s\n", sll_data.data);
VFS_LOG("gps-data.log", "%s\n", sll_data.data);
sll_data.len = 0;
}
PT_YIELD(pt);
}
TCP_HANDLER_END();
CONTROL_END
Speicherung Aleine auf SD-Karte:
#if SERIAL_LINE_LOG_SUPPORT || VFS_SD_SUPPORT
#else
#error Please define VFS_SD_SUPPORT and SERIAL_LINE_LOG_SUPPORT
#endif
#include "protocols/serial_line_log/serial_line_log.h"
extern struct serial_line_log_data sll_data;
CONTROL_START
ON STARTUP DO
END
if ( sll_data.len >= 1 ) {
VFS_LOG("gps-data.log", "%s\n", sll_data.data);
sll_data.len = 0;
}
CONTROL_END