automotive-dlt
DLT Client API

Data Structures

struct  DltClient
 

Enumerations

enum  DltClientMode { DLT_CLIENT_MODE_UNDEFINED = -1, DLT_CLIENT_MODE_TCP, DLT_CLIENT_MODE_SERIAL, DLT_CLIENT_MODE_UNIX }
 

Functions

void dlt_client_register_message_callback (int(*registerd_callback)(DltMessage *message, void *data))
 
int dlt_client_init_port (DltClient *client, int port, int verbose)
 
DltReturnValue dlt_client_init (DltClient *client, int verbose)
 
DltReturnValue dlt_client_connect (DltClient *client, int verbose)
 
DltReturnValue dlt_client_cleanup (DltClient *client, int verbose)
 
DltReturnValue dlt_client_main_loop (DltClient *client, void *data, int verbose)
 
DltReturnValue dlt_client_send_ctrl_msg (DltClient *client, char *apid, char *ctid, uint8_t *payload, uint32_t size)
 
DltReturnValue dlt_client_send_inject_msg (DltClient *client, char *apid, char *ctid, uint32_t serviceID, uint8_t *buffer, uint32_t size)
 
DltReturnValue dlt_client_send_log_level (DltClient *client, char *apid, char *ctid, uint8_t logLevel)
 
int dlt_client_get_log_info (DltClient *client)
 
void dlt_getloginfo_init (void)
 
void dlt_getloginfo_free (void)
 
DltReturnValue dlt_client_send_trace_status (DltClient *client, char *apid, char *ctid, uint8_t traceStatus)
 
DltReturnValue dlt_client_send_default_log_level (DltClient *client, uint8_t defaultLogLevel)
 
int dlt_client_send_all_log_level (DltClient *client, uint8_t LogLevel)
 
DltReturnValue dlt_client_send_default_trace_status (DltClient *client, uint8_t defaultTraceStatus)
 
DltReturnValue dlt_client_send_timing_pakets (DltClient *client, uint8_t timingPakets)
 
DltReturnValue dlt_client_send_store_config (DltClient *client)
 
DltReturnValue dlt_client_send_reset_to_factory_default (DltClient *client)
 
DltReturnValue dlt_client_setbaudrate (DltClient *client, int baudrate)
 
int dlt_client_set_server_ip (DltClient *client, char *ipaddr)
 
int dlt_client_set_serial_device (DltClient *client, char *serial_device)
 
int dlt_client_set_socket_path (DltClient *client, char *socket_path)
 

Detailed Description

Enumeration Type Documentation

Enumerator
DLT_CLIENT_MODE_UNDEFINED 
DLT_CLIENT_MODE_TCP 
DLT_CLIENT_MODE_SERIAL 
DLT_CLIENT_MODE_UNIX 

Definition at line 81 of file dlt_client.h.

Function Documentation

DltReturnValue dlt_client_cleanup ( DltClient client,
int  verbose 
)

Cleanup dlt client structure

Parameters
clientpointer to dlt client structure
verboseif set to true verbose information is printed out.
Returns
Value from DltReturnValue enum

Definition at line 301 of file dlt_client.c.

References dlt_receiver_free(), DLT_RETURN_ERROR, DLT_RETURN_OK, DltClient::receiver, and DltClient::sock.

Referenced by dlt_control_deinit(), dlt_control_init(), dlt_gateway_deinit(), dlt_gateway_process_on_demand_request(), dlt_receive_message_callback(), main(), and receive().

DltReturnValue dlt_client_connect ( DltClient client,
int  verbose 
)

Connect to dlt daemon using the information from the dlt client structure

Parameters
clientpointer to dlt client structure
verboseif set to true verbose information is printed out.
Returns
Value from DltReturnValue enum

Definition at line 168 of file dlt_client.c.

References DltClient::baudrate, DLT_CLIENT_MODE_SERIAL, DLT_CLIENT_MODE_TCP, DLT_CLIENT_MODE_UNIX, DLT_CLIENT_RCVBUFSIZE, DLT_CLIENT_TEXTBUFSIZE, dlt_log(), dlt_receiver_init(), DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_setup_serial(), DltClient::mode, NULL, DltClient::port, DltClient::receiver, DltClient::serialDevice, DltClient::servIP, DltClient::sock, DltClient::socketPath, and str.

Referenced by dlt_control_init_connection(), dlt_gateway_establish_connections(), dlt_gateway_process_on_demand_request(), and main().

int dlt_client_get_log_info ( DltClient client)

Send an request to get log info message to the dlt daemon

Parameters
clientpointer to dlt client structure
Returns
negative value if there was an error

Definition at line 603 of file dlt_client.c.

References dlt_client_main_loop(), dlt_client_send_ctrl_msg(), DLT_SERVICE_ID_GET_LOG_INFO, dlt_set_id(), and NULL.

Referenced by dlt_process_get_log_info().

DltReturnValue dlt_client_init ( DltClient client,
int  verbose 
)

Initialising dlt client structure

Parameters
clientpointer to dlt client structure
verboseif set to true verbose information is printed out.
Returns
Value from DltReturnValue enum

Definition at line 133 of file dlt_client.c.

References DLT_CLIENT_ENV_DAEMON_TCP_PORT, dlt_client_init_port(), DLT_DAEMON_TCP_PORT, DLT_RETURN_ERROR, dlt_vlog(), and NULL.

Referenced by dlt_control_init_connection(), and main().

int dlt_client_init_port ( DltClient client,
int  port,
int  verbose 
)

Initialising dlt client structure with a specific port

Parameters
clientpointer to dlt client structure
portThe port for the tcp connection
verboseif set to true verbose information is printed out.
Returns
negative value if there was an error

Definition at line 109 of file dlt_client.c.

References DltClient::baudrate, DltReceiver::buffer, DLT_CLIENT_INITIAL_BAUDRATE, DLT_CLIENT_MODE_TCP, DLT_DAEMON_TCP_PORT, DLT_RETURN_ERROR, DLT_RETURN_OK, dlt_vlog(), DltClient::mode, NULL, DltClient::port, DltClient::receiver, DltClient::serialDevice, DltClient::servIP, DltClient::sock, and DltClient::socketPath.

Referenced by dlt_client_init(), and dlt_gateway_store_connection().

DltReturnValue dlt_client_main_loop ( DltClient client,
void *  data,
int  verbose 
)

Main Loop of dlt client application

Parameters
clientpointer to dlt client structure
datapointer to data to be provided to the main loop
verboseif set to true verbose information is printed out.
Returns
Value from DltReturnValue enum

Definition at line 326 of file dlt_client.c.

References DltReceiver::buf, DltReceiver::bytesRcvd, data, sDltMessage::datasize, DLT_MESSAGE_ERROR_OK, dlt_message_free(), dlt_message_init(), dlt_message_read(), dlt_receiver_move_to_begin(), dlt_receiver_receive_fd(), dlt_receiver_receive_socket(), dlt_receiver_remove(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_RETURN_TRUE, dltSerialHeader, sDltMessage::found_serialheader, sDltMessage::headersize, message_callback_function, DltClient::mode, and DltClient::receiver.

Referenced by dlt_client_get_log_info(), dlt_control_listen_to_daemon(), and main().

void dlt_client_register_message_callback ( int(*)(DltMessage *message, void *data registerd_callback)

Definition at line 105 of file dlt_client.c.

References message_callback_function.

Referenced by dlt_control_init_connection(), and main().

int dlt_client_send_all_log_level ( DltClient client,
uint8_t  LogLevel 
)

Send the log level to all contexts registered with dlt daemon

Parameters
clientpointer to dlt client structure
LogLevelLog Level to be set
Returns
negative value if there was an error

Definition at line 708 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SERVICE_ID_SET_ALL_LOG_LEVEL, and dlt_set_id().

Referenced by main().

DltReturnValue dlt_client_send_ctrl_msg ( DltClient client,
char *  apid,
char *  ctid,
uint8_t *  payload,
uint32_t  size 
)
DltReturnValue dlt_client_send_default_log_level ( DltClient client,
uint8_t  defaultLogLevel 
)

Send the default log level to the dlt daemon

Parameters
clientpointer to dlt client structure
defaultLogLevelDefault Log Level
Returns
Value from DltReturnValue enum

Definition at line 678 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SERVICE_ID_SET_DEFAULT_LOG_LEVEL, and dlt_set_id().

Referenced by main().

DltReturnValue dlt_client_send_default_trace_status ( DltClient client,
uint8_t  defaultTraceStatus 
)

Send the default trace status to the dlt daemon

Parameters
clientpointer to dlt client structure
defaultTraceStatusDefault Trace Status
Returns
Value from DltReturnValue enum

Definition at line 738 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SERVICE_ID_SET_DEFAULT_TRACE_STATUS, and dlt_set_id().

Referenced by main().

DltReturnValue dlt_client_send_inject_msg ( DltClient client,
char *  apid,
char *  ctid,
uint32_t  serviceID,
uint8_t *  buffer,
uint32_t  size 
)

Send an injection message to the dlt daemon

Parameters
clientpointer to dlt client structure
apidapplication id
ctidcontext id
serviceIDservice id
bufferBuffer filled with injection message data
sizeSize of injection data within buffer
Returns
Value from DltReturnValue enum

Definition at line 539 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, and DLT_RETURN_OK.

Referenced by main().

DltReturnValue dlt_client_send_log_level ( DltClient client,
char *  apid,
char *  ctid,
uint8_t  logLevel 
)

Send an set log level message to the dlt daemon

Parameters
clientpointer to dlt client structure
apidapplication id
ctidcontext id
SendLogLevelLog Level
Returns
Value from DltReturnValue enum

Definition at line 571 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SERVICE_ID_SET_LOG_LEVEL, and dlt_set_id().

Referenced by main().

DltReturnValue dlt_client_send_reset_to_factory_default ( DltClient client)

Send the reset to factory default command to the dlt daemon

Parameters
clientpointer to dlt client structure
Returns
Value from DltReturnValue enum

Definition at line 812 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SERVICE_ID_RESET_TO_FACTORY_DEFAULT, and service_id.

Referenced by main().

DltReturnValue dlt_client_send_store_config ( DltClient client)

Send the store config command to the dlt daemon

Parameters
clientpointer to dlt client structure
Returns
Value from DltReturnValue enum

Definition at line 797 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SERVICE_ID_STORE_CONFIG, and service_id.

Referenced by main().

DltReturnValue dlt_client_send_timing_pakets ( DltClient client,
uint8_t  timingPakets 
)

Send the timing pakets status to the dlt daemon

Parameters
clientpointer to dlt client structure
timingPaketsTiming pakets enabled
Returns
Value from DltReturnValue enum

Definition at line 768 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, DLT_RETURN_OK, and DLT_SERVICE_ID_SET_TIMING_PACKETS.

Referenced by main().

DltReturnValue dlt_client_send_trace_status ( DltClient client,
char *  apid,
char *  ctid,
uint8_t  traceStatus 
)

Send a set trace status message to the dlt daemon

Parameters
clientpointer to dlt client structure
apidapplication id
ctidcontext id
defaultTraceStatusDefault Trace Status
Returns
Value from DltReturnValue enum

Definition at line 646 of file dlt_client.c.

References dlt_client_send_ctrl_msg(), DLT_RETURN_ERROR, DLT_RETURN_OK, DLT_SERVICE_ID_SET_TRACE_STATUS, and dlt_set_id().

Referenced by main().

int dlt_client_set_serial_device ( DltClient client,
char *  serial_device 
)

Set serial device pointer to dlt client structure

Parameters
parampointer to command line argument
Returns
negative value if there was an error

Definition at line 850 of file dlt_client.c.

References dlt_log(), DLT_RETURN_ERROR, DLT_RETURN_OK, NULL, and DltClient::serialDevice.

Referenced by init_dlt_connect(), and main().

int dlt_client_set_server_ip ( DltClient client,
char *  ipaddr 
)

Set server ip

Parameters
clientpointer to dlt client structure
pointerto command line argument
Returns
negative value if there was an error

Definition at line 839 of file dlt_client.c.

References dlt_log(), DLT_RETURN_ERROR, DLT_RETURN_OK, NULL, and DltClient::servIP.

Referenced by dlt_gateway_store_connection(), init_dlt_connect(), and main().

int dlt_client_set_socket_path ( DltClient client,
char *  socket_path 
)

Set socket path pointer to dlt client structure

Parameters
parampointer to socket path string
Returns
negative value if there was an error

Definition at line 861 of file dlt_client.c.

References dlt_log(), DLT_RETURN_ERROR, DLT_RETURN_OK, NULL, and DltClient::socketPath.

Referenced by dlt_control_init_connection().

DltReturnValue dlt_client_setbaudrate ( DltClient client,
int  baudrate 
)

Set baudrate within dlt client structure

Parameters
clientpointer to dlt client structure
baudrateBaudrate
Returns
Value from DltReturnValue enum

Definition at line 827 of file dlt_client.c.

References DltClient::baudrate, dlt_convert_serial_speed(), DLT_RETURN_ERROR, and DLT_RETURN_OK.

Referenced by init_dlt_connect(), and main().

void dlt_getloginfo_free ( void  )

To free the memory allocated for app description in get log info

Parameters
void
Returns
void

Definition at line 798 of file dlt-control.c.

References DltLoginfoDetail::apid_desc, DltLoginfoDetail::ctid_desc, DLT_GLOGINFO_DATA_MAX, and DltLoginfo::info.

Referenced by dlt_process_get_log_info().

void dlt_getloginfo_init ( void  )

Initialise get log info structure

Parameters
void
Returns
void

Definition at line 786 of file dlt-control.c.

References DltLoginfoDetail::apid_desc, DltLoginfo::count, DltLoginfoDetail::ctid_desc, DLT_GLOGINFO_DATA_MAX, DltLoginfo::info, and NULL.

Referenced by dlt_process_get_log_info().