2 * @licence app begin@
\r
3 * Copyright (C) 2012 BMW AG
\r
5 * This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
\r
7 * Contributions are licensed to the GENIVI Alliance under one or more
\r
8 * Contribution License Agreements.
\r
11 * This Source Code Form is subject to the terms of the
\r
12 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
\r
13 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
\r
16 * \author Alexander Wenzel <alexander.aw.wenzel@bmw.de> BMW 2011-2012
\r
18 * \file dlt_client.h
\r
19 * For further information see http://www.genivi.org/.
\r
24 /*******************************************************************************
\r
26 ** SRC-MODULE: dlt_client.h **
\r
32 ** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
39 ** PLATFORM DEPENDANT [yes/no]: yes **
41 ** TO BE CHANGED BY USER [yes/no]: no **
43 *******************************************************************************/
45 /*******************************************************************************
47 ********************************************************************************
49 ** Initials Name Company **
50 ** -------- ------------------------- ---------------------------------- **
51 ** aw Alexander Wenzel BMW **
52 ** mk Markus Klein Fraunhofer ESK **
53 *******************************************************************************/
\r
55 /*******************************************************************************
\r
56 ** Revision Control History **
\r
57 *******************************************************************************/
\r
60 * $LastChangedRevision$
\r
65 #ifndef DLT_CLIENT_H
\r
66 #define DLT_CLIENT_H
\r
69 \defgroup clientapi DLT Client API
\r
70 \addtogroup clientapi
\r
74 #include "dlt_types.h"
\r
75 #include "dlt_common.h"
\r
79 DltReceiver receiver; /**< receiver pointer to dlt receiver structure */
\r
80 int sock; /**< sock Connection handle/socket */
\r
81 char *servIP; /**< servIP IP adress/Hostname of TCP/IP interface */
\r
82 char *serialDevice; /**< serialDevice Devicename of serial device */
\r
83 speed_t baudrate; /**< baudrate Baudrate of serial interface, as speed_t */
\r
84 int serial_mode; /**< serial_mode Serial mode enabled =1, disabled =0 */
\r
91 void dlt_client_register_message_callback(int (*registerd_callback) (DltMessage *message, void *data));
94 * Initialising dlt client structure
95 * @param client pointer to dlt client structure
96 * @param verbose if set to true verbose information is printed out.
97 * @return negative value if there was an error
99 int dlt_client_init(DltClient *client, int verbose);
101 * Connect to dlt daemon using the information from the dlt client structure
102 * @param client pointer to dlt client structure
103 * @param verbose if set to true verbose information is printed out.
104 * @return negative value if there was an error
106 int dlt_client_connect(DltClient *client, int verbose);
108 * Cleanup dlt client structure
109 * @param client pointer to dlt client structure
110 * @param verbose if set to true verbose information is printed out.
111 * @return negative value if there was an error
113 int dlt_client_cleanup(DltClient *client, int verbose);
115 * Main Loop of dlt client application
116 * @param client pointer to dlt client structure
117 * @param data pointer to data to be provided to the main loop
118 * @param verbose if set to true verbose information is printed out.
119 * @return negative value if there was an error
121 int dlt_client_main_loop(DltClient *client, void *data, int verbose);
123 * Send ancontrol message to the dlt daemon
\r
124 * @param client pointer to dlt client structure
\r
125 * @param apid application id
\r
126 * @param ctid context id
\r
127 * @param payload Buffer filled with control message data
\r
128 * @param size Size of control message data
\r
129 * @return negative value if there was an error
\r
131 int dlt_client_send_ctrl_msg(DltClient *client, char *apid, char *ctid, uint8_t *payload, uint32_t size);
\r
133 * Send an injection message to the dlt daemon
134 * @param client pointer to dlt client structure
135 * @param apid application id
136 * @param ctid context id
137 * @param serviceID service id
138 * @param buffer Buffer filled with injection message data
139 * @param size Size of injection data within buffer
140 * @return negative value if there was an error
142 int dlt_client_send_inject_msg(DltClient *client, char *apid, char *ctid, uint32_t serviceID, uint8_t *buffer, uint32_t size);
144 * Send an set log level message to the dlt daemon
\r
145 * @param client pointer to dlt client structure
\r
146 * @param apid application id
\r
147 * @param ctid context id
\r
148 * @param SendLogLevel Log Level
\r
149 * @return negative value if there was an error
\r
151 int dlt_client_send_log_level(DltClient *client, char *apid, char *ctid, uint8_t logLevel);
\r
153 * Send a set trace status message to the dlt daemon
\r
154 * @param client pointer to dlt client structure
\r
155 * @param apid application id
\r
156 * @param ctid context id
\r
157 * @param defaultTraceStatus Default Trace Status
\r
158 * @return negative value if there was an error
\r
160 int dlt_client_send_trace_status(DltClient *client, char *apid, char *ctid, uint8_t traceStatus);
\r
162 * Send the default log level to the dlt daemon
\r
163 * @param client pointer to dlt client structure
\r
164 * @param defaultLogLevel Default Log Level
\r
165 * @return negative value if there was an error
\r
167 int dlt_client_send_default_log_level(DltClient *client, uint8_t defaultLogLevel);
\r
169 * Send the default trace status to the dlt daemon
\r
170 * @param client pointer to dlt client structure
\r
171 * @param defaultTraceStatus Default Trace Status
\r
172 * @return negative value if there was an error
\r
174 int dlt_client_send_default_trace_status(DltClient *client, uint8_t defaultTraceStatus);
\r
176 * Send the timing pakets status to the dlt daemon
\r
177 * @param client pointer to dlt client structure
\r
178 * @param timingPakets Timing pakets enabled
\r
179 * @return negative value if there was an error
\r
181 int dlt_client_send_timing_pakets(DltClient *client, uint8_t timingPakets);
\r
183 * Send the store config command to the dlt daemon
\r
184 * @param client pointer to dlt client structure
\r
185 * @return negative value if there was an error
\r
187 int dlt_client_send_store_config(DltClient *client);
\r
189 * Send the reset to factory default command to the dlt daemon
\r
190 * @param client pointer to dlt client structure
\r
191 * @return negative value if there was an error
\r
193 int dlt_client_send_reset_to_factory_default(DltClient *client);
\r
196 * Set baudrate within dlt client structure
197 * @param client pointer to dlt client structure
198 * @param baudrate Baudrate
199 * @return negative value if there was an error
201 int dlt_client_setbaudrate(DltClient *client, int baudrate);
\r
211 #endif /* DLT_CLIENT_H */
\r