summaryrefslogtreecommitdiff
path: root/src/dlt-qnx-system/dlt-qnx-system.h
blob: 270b8be257748386a5425e10d07f09521c99079d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
 * Copyright (C) 2020 Advanced Driver Information Technology.
 * This code is developed by Advanced Driver Information Technology.
 * Copyright of Advanced Driver Information Technology, Bosch and DENSO.
 *
 * DLT QNX system functionality header file.
 *
 * \copyright
 * This Source Code Form is subject to the terms of the
 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 *
 * \author Nguyen Dinh Thi <Thi.NguyenDinh@vn.bosch.com> ADIT 2020
 *
 * \file: dlt-qnx-system.h
 * For further information see http://www.genivi.org/.
 * @licence end@
 */

/*******************************************************************************
**                                                                            **
**  SRC-MODULE: dlt_qnx-system.h                                              **
**                                                                            **
**  TARGET    : QNX                                                           **
**                                                                            **
**  PROJECT   : DLT                                                           **
**                                                                            **
**  AUTHOR    : Thi.NguyenDinh@vn.bosch.com                                   **
**                                                                            **
**  PURPOSE   :                                                               **
**                                                                            **
**  REMARKS   :                                                               **
**                                                                            **
**  PLATFORM DEPENDANT [yes/no]: yes                                          **
**                                                                            **
**  TO BE CHANGED BY USER [yes/no]: no                                        **
**                                                                            **
*******************************************************************************/

/*******************************************************************************
**                      Author Identity                                       **
********************************************************************************
**                                                                            **
** Initials     Name                       Company                            **
** --------     -------------------------  ---------------------------------- **
** ndt          Nguyen Dinh Thi            ADIT                               **
**                                                                            **
*******************************************************************************/

#ifndef DLT_QNX_SYSTEM_H_
#define DLT_QNX_SYSTEM_H_

#include "dlt.h"

/* Constants */
#define DEFAULT_CONF_FILE ( CONFIGURATION_FILES_DIR "/dlt-qnx-system.conf")

#define MAX_LINE 1024
#define MAX_THREADS 8

/* Macros */
#define MALLOC_ASSERT(x)\
    do\
    {\
        if(x == NULL) {\
            fprintf(stderr, "%s - %d: Out of memory\n",  __func__, __LINE__);\
            abort();\
        }\
    }\
    while (0)

#ifdef __cplusplus
extern "C" {
#endif

/* Command line options */
typedef struct {
    char    *configurationFileName;
    int     daemonize;
} DltQnxSystemCliOptions;

/* Configuration slogger2 options */
typedef struct {
    int      enable;
    char     *contextId;
    int      useOriginalTimestamp;
} Qnxslogger2Options;

typedef struct {
    char                 *applicationId;
    char                 *applicationContextId;
    Qnxslogger2Options   qnxslogger2;
} DltQnxSystemConfiguration;

typedef struct {
    pthread_t threads[MAX_THREADS];
    pthread_t mainThread;
    int count;
    int shutdown;
} DltQnxSystemThreads;

void start_qnx_slogger2(DltQnxSystemConfiguration *conf);

#ifdef __cplusplus
} // extern "C"
#endif

#endif /* DLT_QNX_SYSTEM_H_ */