automotive-dlt
dlt_offline_trace.h
Go to the documentation of this file.
1 /*
2  * @licence app begin@
3  * SPDX license identifier: MPL-2.0
4  *
5  * Copyright (C) 2011-2015, BMW AG
6  *
7  * This file is part of GENIVI Project DLT - Diagnostic Log and Trace.
8  *
9  * This Source Code Form is subject to the terms of the
10  * Mozilla Public License (MPL), v. 2.0.
11  * If a copy of the MPL was not distributed with this file,
12  * You can obtain one at http://mozilla.org/MPL/2.0/.
13  *
14  * For further information see http://www.genivi.org/.
15  * @licence end@
16  */
17 
28 /*******************************************************************************
29 ** **
30 ** SRC-MODULE: dlt_offline_trace.h **
31 ** **
32 ** TARGET : linux **
33 ** **
34 ** PROJECT : DLT **
35 ** **
36 ** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
37 ** **
38 ** PURPOSE : **
39 ** **
40 ** REMARKS : **
41 ** **
42 ** PLATFORM DEPENDANT [yes/no]: yes **
43 ** **
44 ** TO BE CHANGED BY USER [yes/no]: no **
45 ** **
46 *******************************************************************************/
47 
48 /*******************************************************************************
49 ** Author Identity **
50 ********************************************************************************
51 ** **
52 ** Initials Name Company **
53 ** -------- ------------------------- ---------------------------------- **
54 ** aw Alexander Wenzel BMW **
55 *******************************************************************************/
56 
57 #ifndef DLT_OFFLINE_TRACE_H
58 #define DLT_OFFLINE_TRACE_H
59 
60 #include <limits.h>
61 
62 #include "dlt_types.h"
63 
64 #define DLT_OFFLINETRACE_FILENAME_BASE "dlt_offlinetrace"
65 #define DLT_OFFLINETRACE_FILENAME_DELI "."
66 #define DLT_OFFLINETRACE_FILENAME_EXT ".dlt"
67 #define DLT_OFFLINETRACE_INDEX_MAX_SIZE 10
68 #define DLT_OFFLINETRACE_FILENAME_TO_COMPARE "dlt_offlinetrace_"
69 /* "dlt_offlinetrace.4294967295.dlt" -> MAX 32byte include NULL terminate */
70 #define DLT_OFFLINETRACE_FILENAME_MAX_SIZE (sizeof(DLT_OFFLINETRACE_FILENAME_BASE) + \
71  sizeof(DLT_OFFLINETRACE_FILENAME_DELI) + \
72  DLT_OFFLINETRACE_INDEX_MAX_SIZE + \
73  sizeof(DLT_OFFLINETRACE_FILENAME_EXT) + 1)
74 
75 typedef struct
76 {
77  char directory[NAME_MAX + 1];
78  char filename[NAME_MAX + 1];
79  int fileSize;
80  int maxSize;
82  int ohandle;
84 
98 extern DltReturnValue dlt_offline_trace_init(DltOfflineTrace *trace,const char *directory,int fileSize,int maxSize,int filenameTimestampBased);
99 
108 
123 extern DltReturnValue dlt_offline_trace_write(DltOfflineTrace *trace,unsigned char *data1,int size1,unsigned char *data2,int size2,unsigned char *data3,int size3);
124 
129 extern unsigned long dlt_offline_trace_get_total_size(DltOfflineTrace *trace);
130 
139 unsigned int dlt_offline_trace_storage_dir_info(char *path, char *file_name, char *newest, char *oldest);
140 
147 void dlt_offline_trace_file_name(char *log_file_name, char *name, unsigned int idx);
148 
154 unsigned int dlt_offline_trace_get_idx_of_log_file(char *file);
155 
156 
157 #endif /* DLT_OFFLINE_TRACE_H */
void dlt_offline_trace_file_name(char *log_file_name, char *name, unsigned int idx)
DltReturnValue
Definition: dlt_types.h:86
DltReturnValue dlt_offline_trace_write(DltOfflineTrace *trace, unsigned char *data1, int size1, unsigned char *data2, int size2, unsigned char *data3, int size3)
DltReturnValue dlt_offline_trace_init(DltOfflineTrace *trace, const char *directory, int fileSize, int maxSize, int filenameTimestampBased)
DltReturnValue dlt_offline_trace_free(DltOfflineTrace *buf)
unsigned long dlt_offline_trace_get_total_size(DltOfflineTrace *trace)
unsigned int dlt_offline_trace_get_idx_of_log_file(char *file)
unsigned int dlt_offline_trace_storage_dir_info(char *path, char *file_name, char *newest, char *oldest)