diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-04 20:57:25 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-04 20:57:25 +0100 |
commit | 0e1a532720a80660b2d4a3b24c1a071a517ec82e (patch) | |
tree | 5d85af3e52a0d3013f46b980f12b7345523e9679 /src/modules/sdlog2/sdlog2.c | |
parent | 2e1ac72b598184ef618beceb10de53606929edf7 (diff) | |
download | px4-firmware-0e1a532720a80660b2d4a3b24c1a071a517ec82e.tar.gz px4-firmware-0e1a532720a80660b2d4a3b24c1a071a517ec82e.tar.bz2 px4-firmware-0e1a532720a80660b2d4a3b24c1a071a517ec82e.zip |
sdlog2: Use .px4log as file format. Fixes #1243
Diffstat (limited to 'src/modules/sdlog2/sdlog2.c')
-rw-r--r-- | src/modules/sdlog2/sdlog2.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c index c3952b77d..a88b6045a 100644 --- a/src/modules/sdlog2/sdlog2.c +++ b/src/modules/sdlog2/sdlog2.c @@ -343,7 +343,7 @@ int create_log_dir() struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); - /* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.bin */ + /* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.px4log */ time_t utc_time_sec = ts.tv_sec + (ts.tv_nsec / 1e9); struct tm tt; struct tm *ttp = gmtime_r(&utc_time_sec, &tt); @@ -403,14 +403,14 @@ int open_log_file() struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); - /* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.bin */ + /* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.px4log */ time_t utc_time_sec = ts.tv_sec + (ts.tv_nsec / 1e9); struct tm tt; struct tm *ttp = gmtime_r(&utc_time_sec, &tt); /* start logging if we have a valid time and the time is not in the past */ if (log_name_timestamp && ttp && (utc_time_sec > PX4_EPOCH_SECS)) { - strftime(log_file_name, sizeof(log_file_name), "%H_%M_%S.bin", &tt); + strftime(log_file_name, sizeof(log_file_name), "%H_%M_%S.px4log", &tt); snprintf(log_file_path, sizeof(log_file_path), "%s/%s", log_dir, log_file_name); } else { @@ -418,8 +418,8 @@ int open_log_file() /* look for the next file that does not exist */ while (file_number <= MAX_NO_LOGFILE) { - /* format log file path: e.g. /fs/microsd/sess001/log001.bin */ - snprintf(log_file_name, sizeof(log_file_name), "log%03u.bin", file_number); + /* format log file path: e.g. /fs/microsd/sess001/log001.px4log */ + snprintf(log_file_name, sizeof(log_file_name), "log%03u.px4log", file_number); snprintf(log_file_path, sizeof(log_file_path), "%s/%s", log_dir, log_file_name); if (!file_exist(log_file_path)) { @@ -458,7 +458,7 @@ int open_perf_file(const char* str) struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); - /* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.bin */ + /* use RTC time for log file naming, e.g. /fs/microsd/2014-01-19/19_37_52.txt */ time_t utc_time_sec = ts.tv_sec + (ts.tv_nsec / 1e9); struct tm tt; struct tm *ttp = gmtime_r(&utc_time_sec, &tt); @@ -472,7 +472,7 @@ int open_perf_file(const char* str) /* look for the next file that does not exist */ while (file_number <= MAX_NO_LOGFILE) { - /* format log file path: e.g. /fs/microsd/sess001/log001.bin */ + /* format log file path: e.g. /fs/microsd/sess001/log001.txt */ snprintf(log_file_name, sizeof(log_file_name), "perf%03u.txt", file_number); snprintf(log_file_path, sizeof(log_file_path), "%s/%s_%s", log_dir, str, log_file_name); |