automotive-dlt
|
Go to the source code of this file.
Data Structures | |
struct | DltControlMsgBody |
Macros | |
#define | DLT_CTRL_TIMEOUT 10 |
#define | DLT_CTRL_ECUID_LEN 10 |
#define | DLT_DAEMON_FLAG_MAX 256 |
#define | pr_fmt(fmt) fmt |
#define | PRINT_OUT stderr |
#define | pr_error(fmt, ...) ({ fprintf(PRINT_OUT, pr_fmt(fmt), ## __VA_ARGS__); fflush(PRINT_OUT); }) |
#define | pr_verbose(fmt, ...) ({ if (get_verbosity()) { fprintf(PRINT_OUT, pr_fmt(fmt), ## __VA_ARGS__); fflush(PRINT_OUT); } }) |
#define | DLT_CTRL_DEFAULT_ECUID "ECU1" |
Functions | |
int | get_verbosity (void) |
void | set_verbosity (int) |
char * | get_ecuid (void) |
void | set_ecuid (char *) |
long | get_timeout (void) |
void | set_timeout (long) |
int | dlt_parse_config_param (char *config_id, char **config_data) |
int | dlt_control_init (int(*response_analyser)(char *, void *, int), char *ecuid, int verbosity) |
Control communication initialization. More... | |
int | dlt_control_send_message (DltControlMsgBody *, int) |
Send a message to the daemon and wait for the asynchronous answer. More... | |
int | dlt_control_deinit (void) |
Control communication clean-up. More... | |
app begin@ Copyright (C) 2015 Advanced Driver Information Technology. This code is developed by Advanced Driver Information Technology. Copyright of Advanced Driver Information Technology, Bosch and DENSO.
This file is part of GENIVI Project Dlt - Diagnostic Log and Trace console apps.
For further information see http://www.genivi.org/. end@
Definition in file dlt-control-common.h.
#define DLT_CTRL_DEFAULT_ECUID "ECU1" |
Definition at line 51 of file dlt-control-common.h.
Referenced by usage().
#define DLT_CTRL_ECUID_LEN 10 |
Definition at line 33 of file dlt-control-common.h.
Referenced by set_ecuid().
#define DLT_CTRL_TIMEOUT 10 |
Definition at line 31 of file dlt-control-common.h.
Referenced by main(), set_timeout(), and usage().
#define DLT_DAEMON_FLAG_MAX 256 |
Definition at line 34 of file dlt-control-common.h.
Referenced by dlt_parse_config_param(), and option_file_parser().
#define pr_error | ( | fmt, | |
... | |||
) | ({ fprintf(PRINT_OUT, pr_fmt(fmt), ## __VA_ARGS__); fflush(PRINT_OUT); }) |
Definition at line 46 of file dlt-control-common.h.
Referenced by catch_signal(), check_mountpoint_from_partition(), dlt_control_callback(), dlt_control_init(), dlt_control_init_connection(), dlt_control_prepare_message(), dlt_control_send_message(), dlt_control_send_message_to_socket(), dlt_logstorage_check_config_file(), dlt_logstorage_check_directory_permission(), dlt_logstorage_ctrl_add_event(), dlt_logstorage_ctrl_execute_event_loop(), dlt_logstorage_ctrl_setup_event_loop(), dlt_logstorage_ctrl_single_request(), dlt_logstorage_send_event(), dlt_logstorage_udev_check_mounted(), dlt_logstorage_udev_get_mount_point(), dlt_logstorage_udev_init(), dlt_passive_node_analyze_response(), dlt_passive_node_ctrl_single_request(), install_signal_handler(), logstorage_store_dev_info(), logstorage_udev_udevd_callback(), main(), parse_args(), prepare_extra_headers(), prepare_headers(), prepare_message_body(), set_connection_state(), set_ecuid(), set_node_id(), and set_timeout().
#define pr_fmt | ( | fmt | ) | fmt |
Definition at line 37 of file dlt-control-common.h.
#define pr_verbose | ( | fmt, | |
... | |||
) | ({ if (get_verbosity()) { fprintf(PRINT_OUT, pr_fmt(fmt), ## __VA_ARGS__); fflush(PRINT_OUT); } }) |
Definition at line 48 of file dlt-control-common.h.
Referenced by analyze_response(), check_mountpoint_from_partition(), dlt_control_init_connection(), dlt_control_listen_to_daemon(), dlt_control_prepare_message(), dlt_logstorage_check_config_file(), dlt_logstorage_ctrl_add_event(), dlt_logstorage_ctrl_execute_event_loop(), dlt_logstorage_ctrl_setup_event_loop(), dlt_logstorage_ctrl_single_request(), dlt_logstorage_udev_check_mounted(), dlt_logstorage_udev_init(), dlt_passive_node_analyze_response(), install_signal_handler(), logstorage_delete_dev_info(), logstorage_find_dev_info(), logstorage_store_dev_info(), logstorage_udev_udevd_callback(), main(), parse_args(), prepare_extra_headers(), prepare_headers(), prepare_message_body(), and print_list().
#define PRINT_OUT stderr |
Definition at line 41 of file dlt-control-common.h.
int dlt_control_deinit | ( | void | ) |
Control communication clean-up.
Cancels the listener thread and clean=up the dlt client structure.
Definition at line 688 of file dlt-control-common.c.
References daemon_connect_thread, dlt_client_cleanup(), and get_verbosity().
Referenced by dlt_logstorage_ctrl_setup_event_loop(), dlt_logstorage_ctrl_single_request(), and dlt_passive_node_ctrl_single_request().
int dlt_control_init | ( | int(*)(char *, void *, int) | response_analyzer, |
char * | ecuid, | ||
int | verbosity | ||
) |
Control communication initialization.
This will prepare the DLT connection and the thread dedicated to the response listening.
response_analyzer | User defined function used to analyze the response |
ecuid | The ECUID to provide to the daemon |
verbosity | The verbosity level |
Definition at line 648 of file dlt-control-common.c.
References daemon_connect_thread, dlt_client_cleanup(), dlt_control_callback(), dlt_control_init_connection(), dlt_control_listen_to_daemon(), get_verbosity(), NULL, pr_error, response_analyzer_cb, set_ecuid(), and set_verbosity().
Referenced by dlt_logstorage_ctrl_setup_event_loop(), dlt_logstorage_ctrl_single_request(), and dlt_passive_node_ctrl_single_request().
int dlt_control_send_message | ( | DltControlMsgBody * | body, |
int | timeout | ||
) |
Send a message to the daemon and wait for the asynchronous answer.
The answer is received and analyzed by a dedicated thread. Thus we need to wait for the signal from this thread and then read the return value to be provided to the user. In case of timeout, this function fails. The message provided by the user is formated in DLT format before sending.
body | The message provided by the user |
timeout | The time to wait before considering that no answer will come |
Definition at line 581 of file dlt-control-common.c.
References answer_cond, answer_lock, callback_return, dlt_control_prepare_message(), dlt_control_send_message_to_socket(), dlt_message_free(), get_verbosity(), NULL, pr_error, and DltClient::sock.
Referenced by dlt_logstorage_send_event(), and dlt_passive_node_ctrl_single_request().
int dlt_parse_config_param | ( | char * | config_id, |
char ** | config_data | ||
) |
Definition at line 161 of file dlt-control-common.c.
References DLT_DAEMON_FLAG_MAX, DLT_RECEIVE_TEXTBUFSIZE, and NULL.
Referenced by dlt_control_init_connection(), main(), and set_ecuid().
char* get_ecuid | ( | void | ) |
Definition at line 106 of file dlt-control-common.c.
References local_ecuid.
Referenced by dlt_logstorage_ctrl_setup_event_loop(), dlt_logstorage_ctrl_single_request(), dlt_passive_node_ctrl_single_request(), and prepare_extra_headers().
long get_timeout | ( | void | ) |
Definition at line 141 of file dlt-control-common.c.
References local_timeout.
Referenced by dlt_logstorage_ctrl_setup_event_loop(), dlt_logstorage_ctrl_single_request(), dlt_logstorage_send_event(), and dlt_passive_node_ctrl_single_request().
int get_verbosity | ( | void | ) |
Definition at line 96 of file dlt-control-common.c.
References local_verbose.
Referenced by dlt_control_callback(), dlt_control_deinit(), dlt_control_init(), dlt_control_init_connection(), dlt_control_listen_to_daemon(), dlt_control_prepare_message(), dlt_control_send_message(), dlt_logstorage_ctrl_setup_event_loop(), dlt_logstorage_ctrl_single_request(), dlt_passive_node_ctrl_single_request(), prepare_extra_headers(), and usage().
void set_ecuid | ( | char * | ) |
Definition at line 111 of file dlt-control-common.c.
References DLT_CTRL_ECUID_LEN, dlt_parse_config_param(), local_ecuid, NULL, and pr_error.
Referenced by dlt_control_init(), main(), and parse_args().
void set_timeout | ( | long | ) |
Definition at line 146 of file dlt-control-common.c.
References DLT_CTRL_TIMEOUT, local_timeout, and pr_error.
Referenced by main(), and parse_args().
void set_verbosity | ( | int | ) |
Definition at line 101 of file dlt-control-common.c.
References local_verbose.
Referenced by dlt_control_init(), and parse_args().