Skip to content

Commit

Permalink
Limit set of exported symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix-El committed Dec 8, 2023
1 parent 2118762 commit 5795d33
Show file tree
Hide file tree
Showing 17 changed files with 335 additions and 321 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#######

# Set minimum Cmake version and setup policy behavior
cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.12)

if(${CMAKE_VERSION} VERSION_GREATER "3.20" OR ${CMAKE_VERSION} VERSION_EQUAL "3.20")
cmake_policy(SET CMP0115 OLD)
Expand Down
6 changes: 5 additions & 1 deletion include/dlt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ endif()

configure_file(dlt_user.h.in dlt_user.h)

include(GenerateExportHeader)
generate_export_header(dlt)

set(HEADER_LIST dlt.h dlt_user_macros.h dlt_client.h dlt_protocol.h
dlt_common.h dlt_types.h dlt_shm.h dlt_offline_trace.h
dlt_filetransfer.h dlt_common_api.h dlt_multiple_files.h
${CMAKE_CURRENT_BINARY_DIR}/dlt_version.h
${CMAKE_CURRENT_BINARY_DIR}/dlt_user.h)
${CMAKE_CURRENT_BINARY_DIR}/dlt_user.h
${CMAKE_CURRENT_BINARY_DIR}/dlt_export.h)

if(WITH_DLT_DISABLE_MACRO)
list(REMOVE_ITEM HEADER_LIST dlt_user_macros.h)
Expand Down
65 changes: 33 additions & 32 deletions include/dlt/dlt_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
\{
*/

# include "dlt_export.h"
# include "dlt_types.h"
# include "dlt_common.h"
#include <stdbool.h>
Expand Down Expand Up @@ -106,8 +107,8 @@ typedef struct
extern "C" {
# endif

void dlt_client_register_message_callback(int (*registerd_callback)(DltMessage *message, void *data));
void dlt_client_register_fetch_next_message_callback(bool (*registerd_callback)(void *data));
DLT_EXPORT void dlt_client_register_message_callback(int (*registerd_callback)(DltMessage *message, void *data));
DLT_EXPORT void dlt_client_register_fetch_next_message_callback(bool (*registerd_callback)(void *data));

/**
* Initialising dlt client structure with a specific port
Expand All @@ -116,45 +117,45 @@ void dlt_client_register_fetch_next_message_callback(bool (*registerd_callback)(
* @param verbose if set to true verbose information is printed out.
* @return negative value if there was an error
*/
int dlt_client_init_port(DltClient *client, int port, int verbose);
DLT_EXPORT int dlt_client_init_port(DltClient *client, int port, int verbose);

/**
* Initialising dlt client structure
* @param client pointer to dlt client structure
* @param verbose if set to true verbose information is printed out.
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_init(DltClient *client, int verbose);
DLT_EXPORT DltReturnValue dlt_client_init(DltClient *client, int verbose);
/**
* Connect to dlt daemon using the information from the dlt client structure
* @param client pointer to dlt client structure
* @param verbose if set to true verbose information is printed out.
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_connect(DltClient *client, int verbose);
DLT_EXPORT DltReturnValue dlt_client_connect(DltClient *client, int verbose);
/**
* Cleanup dlt client structure
* @param client pointer to dlt client structure
* @param verbose if set to true verbose information is printed out.
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_cleanup(DltClient *client, int verbose);
DLT_EXPORT DltReturnValue dlt_client_cleanup(DltClient *client, int verbose);
/**
* Main Loop of dlt client application
* @param client pointer to dlt client structure
* @param data pointer to data to be provided to the main loop
* @param verbose if set to true verbose information is printed out.
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_main_loop(DltClient *client, void *data, int verbose);
DLT_EXPORT DltReturnValue dlt_client_main_loop(DltClient *client, void *data, int verbose);

/**
* Send a message to the daemon through the socket.
* @param client pointer to dlt client structure.
* @param msg The message to be send in DLT format.
* @return Value from DltReturnValue enum.
*/
DltReturnValue dlt_client_send_message_to_socket(DltClient *client, DltMessage *msg);
DLT_EXPORT DltReturnValue dlt_client_send_message_to_socket(DltClient *client, DltMessage *msg);

/**
* Send ancontrol message to the dlt daemon
Expand All @@ -165,7 +166,7 @@ DltReturnValue dlt_client_send_message_to_socket(DltClient *client, DltMessage *
* @param size Size of control message data
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_ctrl_msg(DltClient *client, char *apid, char *ctid, uint8_t *payload, uint32_t size);
DLT_EXPORT DltReturnValue dlt_client_send_ctrl_msg(DltClient *client, char *apid, char *ctid, uint8_t *payload, uint32_t size);
/**
* Send an injection message to the dlt daemon
* @param client pointer to dlt client structure
Expand All @@ -176,7 +177,7 @@ DltReturnValue dlt_client_send_ctrl_msg(DltClient *client, char *apid, char *cti
* @param size Size of injection data within buffer
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_inject_msg(DltClient *client,
DLT_EXPORT DltReturnValue dlt_client_send_inject_msg(DltClient *client,
char *apid,
char *ctid,
uint32_t serviceID,
Expand All @@ -190,35 +191,35 @@ DltReturnValue dlt_client_send_inject_msg(DltClient *client,
* @param logLevel Log Level
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_log_level(DltClient *client, char *apid, char *ctid, uint8_t logLevel);
DLT_EXPORT DltReturnValue dlt_client_send_log_level(DltClient *client, char *apid, char *ctid, uint8_t logLevel);
/**
* Send an request to get log info message to the dlt daemon
* @param client pointer to dlt client structure
* @return negative value if there was an error
*/
int dlt_client_get_log_info(DltClient *client);
DLT_EXPORT int dlt_client_get_log_info(DltClient *client);
/**
* Send an request to get default log level to the dlt daemon
* @param client pointer to dlt client structure
* @return negative value if there was an error
*/
DltReturnValue dlt_client_get_default_log_level(DltClient *client);
DLT_EXPORT DltReturnValue dlt_client_get_default_log_level(DltClient *client);
/**
* Send an request to get software version to the dlt daemon
* @param client pointer to dlt client structure
* @return negative value if there was an error
*/
int dlt_client_get_software_version(DltClient *client);
DLT_EXPORT int dlt_client_get_software_version(DltClient *client);
/**
* Initialise get log info structure
* @return void
*/
void dlt_getloginfo_init(void);
DLT_EXPORT void dlt_getloginfo_init(void);
/**
* To free the memory allocated for app description in get log info
* @return void
*/
void dlt_getloginfo_free(void);
DLT_EXPORT void dlt_getloginfo_free(void);
/**
* Send a set trace status message to the dlt daemon
* @param client pointer to dlt client structure
Expand All @@ -227,118 +228,118 @@ void dlt_getloginfo_free(void);
* @param traceStatus Default Trace Status
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_trace_status(DltClient *client, char *apid, char *ctid, uint8_t traceStatus);
DLT_EXPORT DltReturnValue dlt_client_send_trace_status(DltClient *client, char *apid, char *ctid, uint8_t traceStatus);
/**
* Send the default log level to the dlt daemon
* @param client pointer to dlt client structure
* @param defaultLogLevel Default Log Level
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_default_log_level(DltClient *client, uint8_t defaultLogLevel);
DLT_EXPORT DltReturnValue dlt_client_send_default_log_level(DltClient *client, uint8_t defaultLogLevel);
/**
* Send the log level to all contexts registered with dlt daemon
* @param client pointer to dlt client structure
* @param LogLevel Log Level to be set
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_all_log_level(DltClient *client, uint8_t LogLevel);
DLT_EXPORT DltReturnValue dlt_client_send_all_log_level(DltClient *client, uint8_t LogLevel);
/**
* Send the default trace status to the dlt daemon
* @param client pointer to dlt client structure
* @param defaultTraceStatus Default Trace Status
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_default_trace_status(DltClient *client, uint8_t defaultTraceStatus);
DLT_EXPORT DltReturnValue dlt_client_send_default_trace_status(DltClient *client, uint8_t defaultTraceStatus);
/**
* Send the trace status to all contexts registered with dlt daemon
* @param client pointer to dlt client structure
* @param traceStatus trace status to be set
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_all_trace_status(DltClient *client, uint8_t traceStatus);
DLT_EXPORT DltReturnValue dlt_client_send_all_trace_status(DltClient *client, uint8_t traceStatus);
/**
* Send the timing pakets status to the dlt daemon
* @param client pointer to dlt client structure
* @param timingPakets Timing pakets enabled
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_timing_pakets(DltClient *client, uint8_t timingPakets);
DLT_EXPORT DltReturnValue dlt_client_send_timing_pakets(DltClient *client, uint8_t timingPakets);
/**
* Send the store config command to the dlt daemon
* @param client pointer to dlt client structure
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_store_config(DltClient *client);
DLT_EXPORT DltReturnValue dlt_client_send_store_config(DltClient *client);
/**
* Send the reset to factory default command to the dlt daemon
* @param client pointer to dlt client structure
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_send_reset_to_factory_default(DltClient *client);
DLT_EXPORT DltReturnValue dlt_client_send_reset_to_factory_default(DltClient *client);

/**
* Set baudrate within dlt client structure
* @param client pointer to dlt client structure
* @param baudrate Baudrate
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_setbaudrate(DltClient *client, int baudrate);
DLT_EXPORT DltReturnValue dlt_client_setbaudrate(DltClient *client, int baudrate);

/**
* Set mode within dlt client structure
* @param client pointer to dlt client structure
* @param mode DltClientMode
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_set_mode(DltClient *client, DltClientMode mode);
DLT_EXPORT DltReturnValue dlt_client_set_mode(DltClient *client, DltClientMode mode);

/**
* Set server ip
* @param client pointer to dlt client structure
* @param ipaddr pointer to command line argument
* @return negative value if there was an error
*/
int dlt_client_set_server_ip(DltClient *client, char *ipaddr);
DLT_EXPORT int dlt_client_set_server_ip(DltClient *client, char *ipaddr);

/**
* Set server UDP host receiver interface address
* @param client pointer to dlt client structure
* @param hostip pointer to multicast group address
* @return negative value if there was an error
*/
int dlt_client_set_host_if_address(DltClient *client, char *hostip);
DLT_EXPORT int dlt_client_set_host_if_address(DltClient *client, char *hostip);

/**
* Set serial device
* @param client pointer to dlt client structure
* @param serial_device pointer to command line argument
* @return negative value if there was an error
*/
int dlt_client_set_serial_device(DltClient *client, char *serial_device);
DLT_EXPORT int dlt_client_set_serial_device(DltClient *client, char *serial_device);

/**
* Set socket path
* @param client pointer to dlt client structure
* @param socket_path pointer to socket path string
* @return negative value if there was an error
*/
int dlt_client_set_socket_path(DltClient *client, char *socket_path);
DLT_EXPORT int dlt_client_set_socket_path(DltClient *client, char *socket_path);

/**
* Parse GET_LOG_INFO response text
* @param resp GET_LOG_INFO response
* @param resp_text response text represented by ASCII
* @return Value from DltReturnValue enum
*/
DltReturnValue dlt_client_parse_get_log_info_resp_text(DltServiceGetLogInfoResponse *resp,
DLT_EXPORT DltReturnValue dlt_client_parse_get_log_info_resp_text(DltServiceGetLogInfoResponse *resp,
char *resp_text);

/**
* Free memory allocated for get log info message
* @param resp response
* @return 0 on success, -1 otherwise
*/
int dlt_client_cleanup_get_log_info(DltServiceGetLogInfoResponse *resp);
DLT_EXPORT int dlt_client_cleanup_get_log_info(DltServiceGetLogInfoResponse *resp);
# ifdef __cplusplus
}
# endif
Expand Down
Loading

0 comments on commit 5795d33

Please sign in to comment.