automotive-dlt
|
Go to the source code of this file.
Data Structures | |
struct | DltOfflineTrace |
Macros | |
#define | DLT_OFFLINETRACE_FILENAME_BASE "dlt_offlinetrace" |
#define | DLT_OFFLINETRACE_FILENAME_DELI "." |
#define | DLT_OFFLINETRACE_FILENAME_EXT ".dlt" |
#define | DLT_OFFLINETRACE_INDEX_MAX_SIZE 10 |
#define | DLT_OFFLINETRACE_FILENAME_TO_COMPARE "dlt_offlinetrace_" |
#define | DLT_OFFLINETRACE_FILENAME_MAX_SIZE |
Functions | |
DltReturnValue | dlt_offline_trace_init (DltOfflineTrace *trace, const char *directory, int fileSize, int maxSize, int filenameTimestampBased) |
DltReturnValue | dlt_offline_trace_free (DltOfflineTrace *buf) |
DltReturnValue | dlt_offline_trace_write (DltOfflineTrace *trace, unsigned char *data1, int size1, unsigned char *data2, int size2, unsigned char *data3, int size3) |
unsigned long | dlt_offline_trace_get_total_size (DltOfflineTrace *trace) |
unsigned int | dlt_offline_trace_storage_dir_info (char *path, char *file_name, char *newest, char *oldest) |
void | dlt_offline_trace_file_name (char *log_file_name, char *name, unsigned int idx) |
unsigned int | dlt_offline_trace_get_idx_of_log_file (char *file) |
Definition in file dlt_offline_trace.h.
#define DLT_OFFLINETRACE_FILENAME_BASE "dlt_offlinetrace" |
Definition at line 64 of file dlt_offline_trace.h.
Referenced by dlt_offline_trace_create_new_file(), dlt_offline_trace_file_name(), and dlt_offline_trace_get_total_size().
#define DLT_OFFLINETRACE_FILENAME_DELI "." |
Definition at line 65 of file dlt_offline_trace.h.
Referenced by dlt_offline_trace_file_name().
#define DLT_OFFLINETRACE_FILENAME_EXT ".dlt" |
Definition at line 66 of file dlt_offline_trace.h.
Referenced by dlt_offline_trace_file_name().
#define DLT_OFFLINETRACE_FILENAME_MAX_SIZE |
Definition at line 70 of file dlt_offline_trace.h.
Referenced by dlt_offline_trace_create_new_file(), dlt_offline_trace_file_name(), and dlt_offline_trace_storage_dir_info().
#define DLT_OFFLINETRACE_FILENAME_TO_COMPARE "dlt_offlinetrace_" |
Definition at line 68 of file dlt_offline_trace.h.
Referenced by dlt_offline_trace_delete_oldest_file().
#define DLT_OFFLINETRACE_INDEX_MAX_SIZE 10 |
Definition at line 67 of file dlt_offline_trace.h.
void dlt_offline_trace_file_name | ( | char * | log_file_name, |
char * | name, | ||
unsigned int | idx | ||
) |
creates filename with index
log | file name created with index |
filename | base |
index | to be used for file name creation |
Definition at line 168 of file dlt_offline_trace.c.
References DLT_OFFLINETRACE_FILENAME_BASE, DLT_OFFLINETRACE_FILENAME_DELI, DLT_OFFLINETRACE_FILENAME_EXT, and DLT_OFFLINETRACE_FILENAME_MAX_SIZE.
Referenced by dlt_offline_trace_create_new_file().
DltReturnValue dlt_offline_trace_free | ( | DltOfflineTrace * | buf | ) |
Uninitialise the offline trace This function call closes currently used log file. This function must be called after usage of offline trace
trace | pointer to offline trace structure |
Definition at line 440 of file dlt_offline_trace.c.
References DLT_RETURN_ERROR, DLT_RETURN_OK, and DltOfflineTrace::ohandle.
Referenced by dlt_daemon_local_cleanup().
unsigned int dlt_offline_trace_get_idx_of_log_file | ( | char * | file | ) |
generates index for log file name
filename | supplied to create index |
Definition at line 181 of file dlt_offline_trace.c.
References NULL.
Referenced by dlt_offline_trace_create_new_file().
unsigned long dlt_offline_trace_get_total_size | ( | DltOfflineTrace * | trace | ) |
Get size of currently used offline trace buffer
Definition at line 264 of file dlt_offline_trace.c.
References DltOfflineTrace::directory, DLT_OFFLINETRACE_FILENAME_BASE, and NULL.
Referenced by dlt_offline_trace_check_size().
DltReturnValue dlt_offline_trace_init | ( | DltOfflineTrace * | trace, |
const char * | directory, | ||
int | fileSize, | ||
int | maxSize, | ||
int | filenameTimestampBased | ||
) |
Initialise the offline trace This function call opens the currently used log file. A check of the complete size of the offline trace is done during startup. Old files are deleted, if there is not enough space left to create new file. This function must be called before using further offline trace functions.
trace | pointer to offline trace structure |
directory | directory where to store offline trace files |
fileSize | maximum size of one offline trace file. |
maxSize | maximum size of complete offline trace in bytes. . |
filenameTimestampBased | filename to be created on timestamp based or index based |
Definition at line 384 of file dlt_offline_trace.c.
References DltOfflineTrace::directory, dlt_offline_trace_check_size(), dlt_offline_trace_create_new_file(), DltOfflineTrace::filenameTimestampBased, DltOfflineTrace::fileSize, and DltOfflineTrace::maxSize.
Referenced by dlt_daemon_local_init_p2().
unsigned int dlt_offline_trace_storage_dir_info | ( | char * | path, |
char * | file_name, | ||
char * | newest, | ||
char * | oldest | ||
) |
Provides info about the offline logs storage directory
path | of the storage directory |
filename | to search for |
pointer | to store newest filename |
pointer | to store oldest filename |
Definition at line 70 of file dlt_offline_trace.c.
References DLT_OFFLINETRACE_FILENAME_MAX_SIZE, and NULL.
Referenced by dlt_offline_trace_create_new_file().
DltReturnValue dlt_offline_trace_write | ( | DltOfflineTrace * | trace, |
unsigned char * | data1, | ||
int | size1, | ||
unsigned char * | data2, | ||
int | size2, | ||
unsigned char * | data3, | ||
int | size3 | ||
) |
Write data into offline trace If the current used log file exceeds the max file size, new log file is created. A check of the complete size of the offline trace is done before new file is created. Old files are deleted, if there is not enough space left to create new file.
trace | pointer to offline trace structure |
data1 | pointer to first data block to be written, null if not used |
size1 | size in bytes of first data block to be written, 0 if not used |
data2 | pointer to second data block to be written, null if not used |
size2 | size in bytes of second data block to be written, 0 if not used |
data3 | pointer to third data block to be written, null if not used |
size3 | size in bytes of third data block to be written, 0 if not used |
Definition at line 398 of file dlt_offline_trace.c.
References dlt_offline_trace_check_size(), dlt_offline_trace_create_new_file(), DLT_RETURN_ERROR, DLT_RETURN_OK, DltOfflineTrace::fileSize, and DltOfflineTrace::ohandle.
Referenced by dlt_daemon_client_send(), and dlt_daemon_process_user_message_log().