automotive-dlt
dlt_client.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_client.h **
31 ** **
32 ** TARGET : linux **
33 ** **
34 ** PROJECT : DLT **
35 ** **
36 ** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
37 ** Markus Klein **
38 ** **
39 ** PURPOSE : **
40 ** **
41 ** REMARKS : **
42 ** **
43 ** PLATFORM DEPENDANT [yes/no]: yes **
44 ** **
45 ** TO BE CHANGED BY USER [yes/no]: no **
46 ** **
47 *******************************************************************************/
48 
49 /*******************************************************************************
50 ** Author Identity **
51 ********************************************************************************
52 ** **
53 ** Initials Name Company **
54 ** -------- ------------------------- ---------------------------------- **
55 ** aw Alexander Wenzel BMW **
56 ** mk Markus Klein Fraunhofer ESK **
57 *******************************************************************************/
58 
59 /*******************************************************************************
60 ** Revision Control History **
61 *******************************************************************************/
62 
63 /*
64  * $LastChangedRevision$
65  * $LastChangedDate$
66  * $LastChangedBy$
67  */
68 
69 #ifndef DLT_CLIENT_H
70 #define DLT_CLIENT_H
71 
78 #include "dlt_types.h"
79 #include "dlt_common.h"
80 
81 typedef enum
82 {
88 
89 typedef struct
90 {
92  int sock;
93  char *servIP;
94  int port;
95  char *serialDevice;
96  char *socketPath;
97  char ecuid[4];
98  speed_t baudrate;
100 } DltClient;
101 
102 #ifdef __cplusplus
103 extern "C" {
104 #endif
105 
106 void dlt_client_register_message_callback(int (*registerd_callback) (DltMessage *message, void *data));
107 
115 int dlt_client_init_port(DltClient *client, int port, int verbose);
116 
123 DltReturnValue dlt_client_init(DltClient *client, int verbose);
130 DltReturnValue dlt_client_connect(DltClient *client, int verbose);
137 DltReturnValue dlt_client_cleanup(DltClient *client, int verbose);
145 DltReturnValue dlt_client_main_loop(DltClient *client, void *data, int verbose);
155 DltReturnValue dlt_client_send_ctrl_msg(DltClient *client, char *apid, char *ctid, uint8_t *payload, uint32_t size);
166 DltReturnValue dlt_client_send_inject_msg(DltClient *client, char *apid, char *ctid, uint32_t serviceID, uint8_t *buffer, uint32_t size);
175 DltReturnValue dlt_client_send_log_level(DltClient *client, char *apid, char *ctid, uint8_t logLevel);
187 void dlt_getloginfo_init( void );
193 void dlt_getloginfo_free( void );
202 DltReturnValue dlt_client_send_trace_status(DltClient *client, char *apid, char *ctid, uint8_t traceStatus);
209 DltReturnValue dlt_client_send_default_log_level(DltClient *client, uint8_t defaultLogLevel);
216 int dlt_client_send_all_log_level(DltClient *client, uint8_t LogLevel);
223 DltReturnValue dlt_client_send_default_trace_status(DltClient *client, uint8_t defaultTraceStatus);
230 DltReturnValue dlt_client_send_timing_pakets(DltClient *client, uint8_t timingPakets);
243 
250 DltReturnValue dlt_client_setbaudrate(DltClient *client, int baudrate);
251 
258 int dlt_client_set_server_ip(DltClient *client, char *ipaddr);
259 
266 int dlt_client_set_serial_device(DltClient *client, char *serial_device);
267 
274 int dlt_client_set_socket_path(DltClient *client, char *socket_path);
275 
276 #ifdef __cplusplus
277 }
278 #endif
279 
284 #endif /* DLT_CLIENT_H */
DltClientMode
Definition: dlt_client.h:81
DltReturnValue dlt_client_send_timing_pakets(DltClient *client, uint8_t timingPakets)
Definition: dlt_client.c:768
int sock
Definition: dlt_client.h:92
int dlt_client_send_all_log_level(DltClient *client, uint8_t LogLevel)
Definition: dlt_client.c:708
DltReturnValue
Definition: dlt_types.h:86
DltReturnValue dlt_client_send_ctrl_msg(DltClient *client, char *apid, char *ctid, uint8_t *payload, uint32_t size)
Definition: dlt_client.c:409
void dlt_client_register_message_callback(int(*registerd_callback)(DltMessage *message, void *data))
Definition: dlt_client.c:105
DltReturnValue dlt_client_main_loop(DltClient *client, void *data, int verbose)
Definition: dlt_client.c:326
int dlt_client_set_server_ip(DltClient *client, char *ipaddr)
Definition: dlt_client.c:839
int dlt_client_init_port(DltClient *client, int port, int verbose)
Definition: dlt_client.c:109
static DltClient client
int dlt_client_get_log_info(DltClient *client)
Definition: dlt_client.c:603
DltReturnValue dlt_client_setbaudrate(DltClient *client, int baudrate)
Definition: dlt_client.c:827
int dlt_client_set_serial_device(DltClient *client, char *serial_device)
Definition: dlt_client.c:850
DltReceiver receiver
Definition: dlt_client.h:91
static char data[kDataSize]
Definition: city-test.cc:40
DltReturnValue dlt_client_send_reset_to_factory_default(DltClient *client)
Definition: dlt_client.c:812
DltReturnValue dlt_client_init(DltClient *client, int verbose)
Definition: dlt_client.c:133
int dlt_client_set_socket_path(DltClient *client, char *socket_path)
Definition: dlt_client.c:861
DltReturnValue dlt_client_cleanup(DltClient *client, int verbose)
Definition: dlt_client.c:301
unsigned char buffer[BUFFER_SIZE]
Buffer for dlt file transfer. The size is defined by BUFFER_SIZE.
DltReturnValue dlt_client_connect(DltClient *client, int verbose)
Definition: dlt_client.c:168
void dlt_getloginfo_free(void)
Definition: dlt-control.c:798
DltReturnValue dlt_client_send_inject_msg(DltClient *client, char *apid, char *ctid, uint32_t serviceID, uint8_t *buffer, uint32_t size)
Definition: dlt_client.c:539
speed_t baudrate
Definition: dlt_client.h:98
DltReturnValue dlt_client_send_log_level(DltClient *client, char *apid, char *ctid, uint8_t logLevel)
Definition: dlt_client.c:571
DltReturnValue dlt_client_send_default_log_level(DltClient *client, uint8_t defaultLogLevel)
Definition: dlt_client.c:678
char * servIP
Definition: dlt_client.h:93
char * socketPath
Definition: dlt_client.h:96
DltReturnValue dlt_client_send_trace_status(DltClient *client, char *apid, char *ctid, uint8_t traceStatus)
Definition: dlt_client.c:646
char * serialDevice
Definition: dlt_client.h:95
int port
Definition: dlt_client.h:94
void dlt_getloginfo_init(void)
Definition: dlt-control.c:786
DltReturnValue dlt_client_send_default_trace_status(DltClient *client, uint8_t defaultTraceStatus)
Definition: dlt_client.c:738
DltClientMode mode
Definition: dlt_client.h:99
DltReturnValue dlt_client_send_store_config(DltClient *client)
Definition: dlt_client.c:797