From 8a24430f7305072713dff98d1fd7aba9d45e8518 Mon Sep 17 00:00:00 2001 From: rex-schilasky <49162693+rex-schilasky@users.noreply.github.com> Date: Fri, 9 Feb 2024 15:41:40 +0100 Subject: [PATCH 1/2] ecal_clang added CMake folder structure aligned with eclipse-ecal --- src/core/CMakeLists.txt | 9 +- src/core/include/ecal/ecal_clang.h | 608 ++++++++++++++++++ src/core/src/ecal_clang.cpp | 808 ++++++++++++++++++++++++ src/service/ecal_service/CMakeLists.txt | 2 +- src/service/sample/CMakeLists.txt | 2 +- src/service/test/CMakeLists.txt | 2 +- src/time/linuxptp/CMakeLists.txt | 2 +- src/time/localtime/CMakeLists.txt | 2 +- src/utils/CMakeLists.txt | 2 +- 9 files changed, 1427 insertions(+), 10 deletions(-) create mode 100644 src/core/include/ecal/ecal_clang.h create mode 100644 src/core/src/ecal_clang.cpp diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index cd7f135..a286aad 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -19,6 +19,7 @@ project(core VERSION ${eCAL_VERSION_STRING}) find_package(asio REQUIRED) +find_package(Threads REQUIRED) if (ECAL_CORE_CONFIG_INIFILE) find_package(simpleini REQUIRED) @@ -410,12 +411,12 @@ if (ECAL_CORE_COMMAND_LINE) ) endif() - ###################################### # common ###################################### set(ecal_cmn_src src/ecal.cpp + src/ecal_clang.cpp src/ecal_def.h src/ecal_def_ini.h src/ecal_descgate.cpp @@ -463,6 +464,7 @@ set(ecal_header_cmn include/ecal/types/monitoring.h include/ecal/ecal.h include/ecal/ecal_callback.h + include/ecal/ecal_clang.h include/ecal/ecal_client.h include/ecal/ecal_config.h include/ecal/ecal_core.h @@ -674,6 +676,7 @@ target_link_libraries(${PROJECT_NAME} $<$:wsock32> $<$:socket> asio::asio + Threads::Threads eCAL::ecal-utils ) @@ -712,9 +715,7 @@ if(NOT ${CMAKE_VERSION} VERSION_LESS "3.8.0") ${ecal_pub_src} ${ecal_sub_src} ${ecal_writer_src} - ${ecal_writer_udp_src} ${ecal_reader_src} - ${ecal_reader_udp_src} ${ecal_registration_src} ${ecal_serialization_src} ${ecal_service_src} @@ -738,5 +739,5 @@ if(UNIX) ecal_install_app(${PROJECT_NAME_PROCESS_STUB}) - set_property(TARGET ${PROJECT_NAME_PROCESS_STUB} PROPERTY FOLDER ecal/core) + set_property(TARGET ${PROJECT_NAME_PROCESS_STUB} PROPERTY FOLDER core) endif(UNIX) diff --git a/src/core/include/ecal/ecal_clang.h b/src/core/include/ecal/ecal_clang.h new file mode 100644 index 0000000..2103668 --- /dev/null +++ b/src/core/include/ecal/ecal_clang.h @@ -0,0 +1,608 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2016 - 2019 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + +/** + * @file ecal_clang.h + * @brief eCAL C language interface (to wrap ecal into other languages easily) +**/ + +#ifndef ECAL_CLANG_H_INCLUDED +#define ECAL_CLANG_H_INCLUDED + +#include + +/*************************************************************************/ +/* common */ +/*************************************************************************/ +/** + * @brief Get eCAL version string. + * + * @return Full eCAL version string. +**/ +ECAL_API const char* ecal_getversion(); + +/** + * @brief Get eCAL version as separated integer values. + * + * @param [out] major_ The eCAL major version number. + * @param [out] minor_ The eCAL minor version number. + * @param [out] patch_ The eCAL patch version number. + * + * @return Zero if succeeded. +**/ +ECAL_API int ecal_getversion_components(int* major_, int* minor_, int* patch_); + +/** + * @brief Get eCAL version date. + * + * @return Full eCAL version date string. +**/ +ECAL_API const char* ecal_getdate(); + +/** + * @brief Initialize eCAL API. + * + * @param argc_ Number of command line arguments. + * @param argv_ Array of command line arguments. + * @param unit_name_ Defines the name of the eCAL unit. + * + * @return Zero if succeeded, 1 if already initialized, -1 if failed. +**/ +ECAL_API int ecal_initialize(int argc_, char **argv_, const char* unit_name_); + +/** + * @brief Finalize eCAL API. + * + * @return Zero if succeeded, 1 if already initialized, -1 if failed. +**/ +ECAL_API int ecal_finalize(); + +/** + * @brief Check eCAL initialize state. + * + * @return 1 if eCAL is initialized. +**/ +ECAL_API int ecal_is_initialized(); + +/** + * @brief Set/change the unit name of current module. + * + * @param unit_name_ Defines the name of the eCAL unit. + * + * @return Zero if succeeded. +**/ +ECAL_API int ecal_set_unit_name(const char *unit_name_); + +/** + * @brief Set process state info. + * + * @param severity_ Severity. + * @param level_ Severity level. + * @param info_ Info message. + * +**/ +ECAL_API void ecal_set_process_state(const int severity_, const int level_, const char* info_); + +/** + * @brief Return the eCAL process state. + * + * @return True if eCAL is in proper state. +**/ +ECAL_API bool ecal_ok(); + +/** + * @brief Free an eCAL memory block allocated by functions like + * mon_get_monitoring, mon_get_logging, + * sub_receive, that let eCAL allocate + * the memory internally. +**/ +/** + * @code + * // let eCAL allocate memory for the subscriber buffer and return the pointer to 'rcv_buf' + * const char* rcv_buf = nullptr; + * int rcv_buf_len = 0; + * long long rcv_time = 0; + * int timeout = 0; + * int ret = sub_receive(subscriber_handle, &rcv_buf, &rcv_buf_len, &rcv_time, timeout); + * if(rcv_buf_len > 0) + * { + * ... + * // PROCESS THE BUFFER CONTENT HERE + * ... + * // finally free the allocated memory + * ecal_free_mem((void*)rcv_buf); + * } + * @endcode +**/ +ECAL_API void ecal_free_mem(void* mem_); + +/** + * @brief Sleep current thread. + * + * @param time_ms_ Time to sleep in ms. +**/ +ECAL_API void ecal_sleep_ms(const long time_ms_); + +/** + * @brief Send shutdown event to specified local user process using it's unit name. + * + * @param unit_name_ Process unit name. +**/ +ECAL_API void ecal_shutdown_process_uname(const char* unit_name_); + +/** + * @brief Send shutdown event to specified local user process using it's process id. + * + * @param process_id_ Process id. +**/ +ECAL_API void ecal_shutdown_process_id(const int process_id_); + +/** + * @brief Send shutdown event to all local user processes. +**/ +ECAL_API void ecal_shutdown_processes(); + +/** + * @brief Send shutdown event to all local core components. +**/ +ECAL_API void ecal_shutdown_core(); + +/** + * @brief Enable eCAL message loop back, + * that means subscriber will receive messages from + * publishers of the same process (default == false). + * + * @param state_ Switch on message loop back.. +**/ +ECAL_API void ecal_enable_loopback(const int state_); + +/** + * @brief Gets type name of the specified topic. + * + * @param topic_name_ Topic name. + * @param [out] topic_type_ Pointer to store the type name information. + * @param [out] topic_type_len_ Length of allocated buffer, + * eCAL is allocating the buffer for you, use ecal_free_mem to free the buffer finally. + * + * @return True if succeeded. +**/ +ECAL_API bool ecal_get_type_name(const char* topic_name_, const char** topic_type_, int* topic_type_len_); + +/** + * @brief Gets type encoding of the specified topic. + * + * @param topic_name_ Topic name. + * @param [out] topic_encoding_ Pointer to store the type encoding information. + * @param [out] topic_encoding_len_ Length of allocated buffer, + * eCAL is allocating the buffer for you, use ecal_free_mem to free the buffer finally. + * + * @return True if succeeded. +**/ +ECAL_API bool ecal_get_type_encoding(const char* topic_name_, const char** topic_encoding_, int* topic_encoding_len_); + +/** + * @brief Gets type description of the specified topic. + * + * @param topic_name_ Topic name. + * @param [out] topic_desc_ Pointer to store the type description information. + * @param [out] topic_desc_len_ Length of allocated buffer, + * eCAL is allocating the buffer for you, use ecal_free_mem to free the buffer finally. + * + * @return True if succeeded. +**/ +ECAL_API bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int* topic_desc_len_); + +/*************************************************************************/ +/* logging */ +/*************************************************************************/ +/** + * @brief Sets the log level. + * + * @param level_ The level. +**/ +ECAL_API void log_setlevel(const int level_); + +/** + * @brief Log a message (with current log level). + * + * @param message_ The log message string. +**/ +ECAL_API void log_message(const char* message_); + +/*************************************************************************/ +/* publisher */ +/*************************************************************************/ +/** + * @brief Create a publisher. + * + * @param topic_name_ Unique topic name. + * @param topic_type_ Topic type name. + * + * @return Handle of the created publisher or NULL if failed. +**/ +ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_); + +/** + * @brief Destroy a publisher. + * + * @param handle_ Publisher handle. + * + * @return True if succeeded. +**/ +ECAL_API bool pub_destroy(ECAL_HANDLE handle_); + +/** + * @brief Send a message to all subscribers. + * + * @param handle_ Publisher handle. + * @param payload_ Buffer that contains content to send. + * @param length_ Send buffer length. + * @param time_ Send time (-1 = use eCAL system time in us, default = -1). + * + * @return Number of bytes sent. +**/ +ECAL_API int pub_send(ECAL_HANDLE handle_, const char* payload_, const int length_, const long long time_); + +/** + * @brief Add callback function for publisher events. + * + * @param handle_ Publisher handle. + * @param type_ The event type to react on. + * @param callback_ The callback function to add. + * @param par_ User defined context that will be forwarded to the callback function. + * + * @return True if succeeded. +**/ +ECAL_API bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_, const PubEventCallbackCT callback_, void* par_); + +/** + * @brief Remove callback function for publisher events. + * + * @param handle_ Publisher handle. + * @param type_ The event type to remove. + * + * @return True if succeeded. +**/ +ECAL_API bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_); + +/*************************************************************************/ +/* subscriber */ +/*************************************************************************/ +/** +* @brief Create a subscriber. + * + * @param topic_name_ Unique topic name. + * @param topic_type_ Topic type name. + * + * @return Handle of the created subscriber or NULL if failed. +**/ +ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_); + +/** + * @brief Destroy a subscriber. + * + * @param handle_ Subscriber handle. + * + * @return True if succeeded. +**/ +ECAL_API bool sub_destroy(ECAL_HANDLE handle_); + +/** + * @brief Receive a message from the publisher. + * + * @param handle_ Subscriber handle. + * @param [out] rcv_buf_ Buffer to store the received message content. + * @param [out] rcv_buf_len_ Length of allocated buffer, + * eCAL is allocating the buffer for you, use ecal_free_mem to free the buffer finally. + * @param [out] rcv_time_ Time from publisher in us. + * @param timeout_ Maximum time before receive operation returns (in milliseconds, -1 means infinite). + * + * @return Length of received buffer. +**/ +ECAL_API int sub_receive(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, const int timeout_); + +/** + * @brief Receive a message from the publisher (able to process zero length buffer). + * + * @param handle_ Subscriber handle. + * @param [out] rcv_buf_ Buffer to store the received message content. + * @param [out] rcv_buf_len_ Length of allocated buffer, + * eCAL is allocating the buffer for you, use ecal_free_mem to free the buffer finally. + * @param [out] rcv_time_ Time from publisher in us. + * @param timeout_ Maximum time before receive operation returns (in milliseconds, -1 means infinite). + * + * @return True if succeeded. +**/ +ECAL_API bool sub_receive_buffer(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, const int timeout_); + +/** + * @brief Add callback function for incoming receives. + * + * @param handle_ Subscriber handle. + * @param callback_ The callback function to add. + * @param par_ User defined context that will be forwarded to the callback function. + * + * @return True if succeeded. +**/ +ECAL_API bool sub_add_receive_callback(ECAL_HANDLE handle_, const ReceiveCallbackCT callback_, void* par_); + +/** + * @brief Remove callback function for incoming receives. + * + * @param handle_ Subscriber handle. + * + * @return True if succeeded. +**/ +ECAL_API bool sub_rem_receive_callback(ECAL_HANDLE handle_); + +/** + * @brief Add callback function for subscriber events. + * + * @param handle_ Subscriber handle. + * @param type_ The event type to react on. + * @param callback_ The callback function to add. + * @param par_ User defined context that will be forwarded to the callback function. + * + * @return True if succeeded. +**/ +ECAL_API bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, const SubEventCallbackCT callback_, void* par_); + +/** + * @brief Remove callback function for subscriber events. + * + * @param handle_ Subscriber handle. + * @param type_ The event type to remove. + * + * @return True if succeeded. +**/ +ECAL_API bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_); + +/*************************************************************************/ +/* dyn_json_subscriber */ +/*************************************************************************/ +/** + * @brief Create a subscriber. + * + * @param topic_name_ Unique topic name. + * + * @return Handle to created subscriber or NULL if failed. +**/ +ECAL_API ECAL_HANDLE dyn_json_sub_create(const char* topic_name_); + +/** + * @brief Destroy a subscriber. + * + * @param handle_ Subscriber handle. + * + * @return True if succeeded. +**/ +ECAL_API bool dyn_json_sub_destroy(ECAL_HANDLE handle_); + +/** + * @brief Add callback function for incoming receives. + * + * @param handle_ Subscriber handle. + * @param callback_ The callback function to add. + * @param par_ User defined context that will be forwarded to the callback function. + * + * @return True if succeeded. +**/ +ECAL_API bool dyn_json_sub_add_receive_callback(ECAL_HANDLE handle_, const ReceiveCallbackCT callback_, void* par_); + +/** + * @brief Remove callback function for incoming receives. + * + * @param handle_ Subscriber handle. + * + * @return True if succeeded. +**/ +ECAL_API bool dyn_json_sub_rem_receive_callback(ECAL_HANDLE handle_); + +/* TODO: not implemented and not used for now */ +//ECAL_API bool dyn_json_sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, const EventCallbackCT callback_, void* par_); +//ECAL_API bool dyn_json_sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_); +//ECAL_API bool dyn_json_sub_set_timeout(ECAL_HANDLE handle_, int timeout_); + +/*************************************************************************/ +/* service */ +/*************************************************************************/ +/** + * @brief Create a server. + * + * @param service_name_ Service name. + * + * @return Handle to created server or NULL if failed. +**/ +ECAL_API ECAL_HANDLE server_create(const char* service_name_); + +/** + * @brief Destroy a server. + * + * @param handle_ Server handle. + * + * @return True if succeeded. +**/ +ECAL_API bool server_destroy(ECAL_HANDLE handle_); + +/** + * @brief Add server method callback. + * + * @param handle_ Server handle. + * @param method_name_ Service method name. + * @param req_type_ Method request type (default = ""). + * @param resp_type_ Method response type (default = ""). + * @param callback_ Callback function for server request. + * @param par_ User defined context that will be forwarded to the request function. + * + * @return True if succeeded. +**/ +ECAL_API bool server_add_method_callback(ECAL_HANDLE handle_, const char* method_name_, const char* req_type_, const char* resp_type_, const MethodCallbackCT callback_, void* par_); + +/** + * @brief Remove server method callback. + * + * @param handle_ Server handle. + * @param method_name_ Service method name. + * + * @return True if succeeded. +**/ +ECAL_API bool server_rem_method_callback(ECAL_HANDLE handle_, const char* method_name_); + +/** + * @brief Create a client. + * + * @param service_name_ Service name. + * + * @return Handle to created client or NULL if failed. +**/ +ECAL_API ECAL_HANDLE client_create(const char* service_name_); + +/** + * @brief Destroy a client. + * + * @param handle_ Client handle. + * + * @return True if succeeded. +**/ +ECAL_API bool client_destroy(ECAL_HANDLE handle_); + +/** + * @brief Change the host name filter for that client instance + * + * @param handle_ Client handle. + * @param host_name_ Host name filter (empty or "*" == all hosts) + * + * @return True if succeeded. +**/ +ECAL_API bool client_set_hostname(ECAL_HANDLE handle_, const char* host_name_); + +/** + * @brief Call method of this service (none blocking variant with callback). + * + * @param handle_ Client handle. + * @param method_name_ Method name. + * @param request_ Request message buffer. + * @param request_len_ Request message length. + * @param timeout_ Maximum time before operation returns (in milliseconds, -1 means infinite). + * + * @return True if succeeded. +**/ +ECAL_API bool client_call_method(ECAL_HANDLE handle_, const char* method_name_, const char* request_, const int request_len_, const int timeout_); + +/** + * @brief Call method of this service (asynchronously with callback). + * + * @param handle_ Client handle. + * @param method_name_ Method name. + * @param request_ Request message buffer. + * @param request_len_ Request message length. + * @param timeout_ Maximum time before operation returns (in milliseconds, -1 means infinite). + * + * @return True if succeeded. +**/ +ECAL_API bool client_call_method_async(ECAL_HANDLE handle_, const char* method_name_, const char* request_, const int request_len_, const int timeout_); + +/* TODO: not implemented and not used for now */ +//ECAL_API client_add_response_callback +//ECAL_API client_rem_response_callback + + +/*************************************************************************/ +/* monitoring */ +/*************************************************************************/ +/** + * @brief Initialize eCAL monitoring API. + * + * @return Zero if succeeded, 1 if already initialized, -1 if failed. +**/ +ECAL_API int mon_initialize(); + +/** + * @brief Finalize eCAL monitoring API. + * + * @return Zero if succeeded, 1 if already initialized, -1 if failed. +**/ +ECAL_API int mon_finalize(); + +/** + * @brief Set topics filter blacklist regular expression. + * + * @param filter_ Topic filter as regular expression. + * + * @return Zero if succeeded. +**/ +ECAL_API int mon_set_excl_filter(const char* filter_); + +/** + * @brief Set topics filter whitelist regular expression. + * + * @param filter_ Topic filter as regular expression. + * + * @return Zero if succeeded. +**/ +ECAL_API int mon_set_incl_filter(const char* filter_); + +/** + * @brief Switch topics filter using regular expression on/off. + * + * @param state_ Filter on / off state. + * + * @return Zero if succeeded. +**/ +ECAL_API int mon_set_filter_state(const bool state_); + +/** + * @brief Get monitoring protobuf string. + * + * @param [out] mon_buf_ Pointer to store the monitoring information. + * @param [out] mon_buf_len_ Length of allocated buffer, + * eCAL is allocating the buffer for you, use ecal_free_mem to free the buffer finally. + * + * @return Monitoring buffer length or zero if failed. +**/ +/** + * @code + * // let eCAL allocate memory for the monitoring buffer and return the pointer to 'buf' + * const char* mon_buf_ = NULL; + * int mon_buf_len_ = 0; + * mon_get_monitoring(subscriber_handle, &mon_buf_, &mon_buf_len_); + * if(mon_buf_len_ > 0) + * { + * ... + * // PROCESS THE BUFFER CONTENT HERE + * ... + * // finally free the allocated memory + * ecal_free_mem(((void*)rcv_buf);); + * } + * @endcode +**/ +ECAL_API int mon_get_monitoring(const char** mon_buf_, int* mon_buf_len_); + +/** + * @brief Get logging string. + * + * @param [out] log_buf_ Pointer to store the monitoring information. + * @param [out] log_buf_len_ Length of allocated buffer, + * eCAL is allocating the buffer for you, use ecal_free_mem to free the buffer finally. + * + * @return Logging buffer length or zero if failed. +**/ +ECAL_API int mon_get_logging(const char** log_buf_, int* log_buf_len_); + +#endif /* ECAL_CLANG_H_INCLUDED */ diff --git a/src/core/src/ecal_clang.cpp b/src/core/src/ecal_clang.cpp new file mode 100644 index 0000000..1c6e7cc --- /dev/null +++ b/src/core/src/ecal_clang.cpp @@ -0,0 +1,808 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2016 - 2019 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + +/** + * @brief eCAL C language interface +**/ + +#include +#include + +#include +#include +#include +#include + +static char* str_malloc(const std::string& buf_s_) +{ + void* cbuf = malloc(buf_s_.size()); + if(cbuf != nullptr) + { + memcpy(cbuf, buf_s_.data(), buf_s_.size()); + } + return(static_cast(cbuf)); +} + +/****************************************/ +/* ecal_getversion */ +/****************************************/ +ECAL_API const char* ecal_getversion() +{ + return(ECAL_VERSION); +} + +/****************************************/ +/* ecal_getversion_components */ +/****************************************/ +ECAL_API int ecal_getversion_components(int* major_, int* minor_, int* patch_) +{ + return eCAL::GetVersion(major_, minor_, patch_); +} + +/****************************************/ +/* ecal_getdate */ +/****************************************/ +ECAL_API const char* ecal_getdate() +{ + return(ECAL_DATE); +} + +/****************************************/ +/* ecal_initialize */ +/****************************************/ +ECAL_API int ecal_initialize(int argc_, char **argv_, const char* unit_name_) +{ + return(eCAL::Initialize(argc_, argv_, unit_name_)); +} + +/****************************************/ +/* ecal_finalize */ +/****************************************/ +ECAL_API int ecal_finalize() +{ + //* @return Zero if succeeded, 1 if still initialized, -1 if failed. + return(eCAL::Finalize()); +} + +/****************************************/ +/* ecal_is_initialized */ +/****************************************/ +ECAL_API int ecal_is_initialized() +{ + //* @return 1 if eCAL is initialized. + return(eCAL::IsInitialized()); +} + +/****************************************/ +/* ecal_set_unit_name */ +/****************************************/ +ECAL_API int ecal_set_unit_name(const char* unit_name_) +{ + return(eCAL::SetUnitName(unit_name_)); +} + +/****************************************/ +/* ecal_set_process_state */ +/****************************************/ +ECAL_API void ecal_set_process_state(const int severity_, const int level_, const char* info_) +{ + return(eCAL::Process::SetState(eCAL_Process_eSeverity(severity_), eCAL_Process_eSeverity_Level(level_), info_)); +} + +/****************************************/ +/* ecal_ok */ +/****************************************/ +ECAL_API bool ecal_ok() +{ + return(eCAL::Ok()); +} + +/****************************************/ +/* ecal_free_mem */ +/****************************************/ +ECAL_API void ecal_free_mem(void* mem_) +{ + free(mem_); +} + +/****************************************/ +/* ecal_sleep_ms */ +/****************************************/ +ECAL_API void ecal_sleep_ms(const long time_ms_) +{ + eCAL::Process::SleepMS(time_ms_); +} + +#if ECAL_CORE_MONITORING +/****************************************/ +/* ecal_shutdown_process_uname */ +/****************************************/ +ECAL_API void ecal_shutdown_process_uname(const char* unit_name_) +{ + eCAL::Util::ShutdownProcess(unit_name_); +} + +/****************************************/ +/* ecal_shutdown_process_id */ +/****************************************/ +ECAL_API void ecal_shutdown_process_id(const int process_id_) +{ + eCAL::Util::ShutdownProcess(process_id_); +} + +/****************************************/ +/* ecal_shutdown_processes */ +/****************************************/ +ECAL_API void ecal_shutdown_processes() +{ + eCAL::Util::ShutdownProcesses(); +} + +/****************************************/ +/* ecal_shutdown_core */ +/****************************************/ +ECAL_API void ecal_shutdown_core() +{ + eCAL::Util::ShutdownCore(); +} +#endif // ECAL_CORE_MONITORING + +/****************************************/ +/* ecal_enable_loopback */ +/****************************************/ +ECAL_API void ecal_enable_loopback(const int state_) +{ + eCAL::Util::EnableLoopback(state_ != 0); +} + +/****************************************/ +/* get_type_name */ +/****************************************/ +ECAL_API bool ecal_get_type_name(const char* topic_name_, const char** topic_type_, int* topic_type_len_) +{ + eCAL::SDataTypeInformation topic_info; + bool ret = eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info); + if(ret) + { + std::string topic_type_s = topic_info.name; + // this has to be freed by caller (ecal_free_mem) + char* cbuf = str_malloc(topic_type_s); + if(cbuf == nullptr) return(false); + + if (topic_type_ != nullptr) { + *topic_type_ = cbuf; + if(topic_type_len_ != nullptr) *topic_type_len_ = static_cast(topic_type_s.size()); + } + else { + // free allocated memory: + ecal_free_mem(cbuf); + if (topic_type_len_ != nullptr) *topic_type_len_ = 0; + ret = false; + } + } + return(ret); +} + +/****************************************/ +/* get_type_encoding */ +/****************************************/ +ECAL_API bool ecal_get_type_encoding(const char* topic_name_, const char** topic_encoding_, int* topic_encoding_len_) +{ + eCAL::SDataTypeInformation topic_info; + bool ret = eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info); + if (ret) + { + std::string topic_encoding_s = topic_info.encoding; + // this has to be freed by caller (ecal_free_mem) + char* cbuf = str_malloc(topic_encoding_s); + if (cbuf == nullptr) return(false); + + if (topic_encoding_ != nullptr) { + *topic_encoding_ = cbuf; + if (topic_encoding_len_ != nullptr) *topic_encoding_len_ = static_cast(topic_encoding_s.size()); + } + else { + // free allocated memory: + ecal_free_mem(cbuf); + if (topic_encoding_len_ != nullptr) *topic_encoding_len_ = 0; + ret = false; + } + } + return(ret); +} + +/****************************************/ +/* get_description */ +/****************************************/ +ECAL_API bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int* topic_desc_len_) +{ + eCAL::SDataTypeInformation topic_info; + bool ret = eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info); + if(ret) + { + std::string topic_desc_s = topic_info.descriptor; + // this has to be freed by caller (ecal_free_mem) + char* cbuf = str_malloc(topic_desc_s); + if(cbuf == nullptr) return(false); + + if (topic_desc_ != nullptr) { + *topic_desc_ = cbuf; + if (topic_desc_len_ != nullptr) *topic_desc_len_ = static_cast(topic_desc_s.size()); + } + else { + // free allocated memory: + ecal_free_mem(cbuf); + if (topic_desc_len_ != nullptr) *topic_desc_len_ = 0; + ret = false; + } + } + return(ret); +} + +/****************************************/ +/* log_setlevel */ +/****************************************/ +ECAL_API void log_setlevel(const int level_) +{ + eCAL::Logging::SetLogLevel(eCAL_Logging_eLogLevel(level_)); +} + +/****************************************/ +/* log_message */ +/****************************************/ +ECAL_API void log_message(const char* message_) +{ + eCAL::Logging::Log(message_); +} + + +/****************************************/ +/* pub_create */ +/****************************************/ +ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_) +{ + eCAL::SDataTypeInformation topic_info; + topic_info.name = topic_type_; + auto* pub = new eCAL::CPublisher; + if (!pub->Create(topic_name_, topic_info)) + { + delete pub; + return(nullptr); + } + return(pub); +} + +/****************************************/ +/* pub_destroy */ +/****************************************/ +ECAL_API bool pub_destroy(ECAL_HANDLE handle_) +{ + auto* pub = static_cast(handle_); + if(pub != nullptr) + { + delete pub; + return(true); + } + else + { + return(false); + } +} + +/****************************************/ +/* pub_send */ +/****************************************/ +ECAL_API int pub_send(ECAL_HANDLE handle_, const char* payload_, const int length_, const long long time_) +{ + auto* pub = static_cast(handle_); + if(pub != nullptr) + { + const size_t ret = pub->Send(payload_, static_cast(length_), time_); + if(static_cast(ret) == length_) + { + return(length_); + } + } + return(0); +} + +/****************************************/ +/* pub_add_event_callback */ +/****************************************/ +static std::mutex g_pub_event_callback_mtx; +static void g_pub_event_callback(const char* topic_name_, const struct eCAL::SPubEventCallbackData* data_, const PubEventCallbackCT callback_, void* par_) +{ + const std::lock_guard lock(g_pub_event_callback_mtx); + SPubEventCallbackDataC data{}; + data.type = data_->type; + data.time = data_->time; + data.clock = data_->clock; + data.tid = data_->tid.c_str(); + data.tname = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdatatype.descriptor.c_str(); + callback_(topic_name_, &data, par_); +} + +ECAL_API bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_, const PubEventCallbackCT callback_, void* par_) +{ + auto* pub = static_cast(handle_); + + auto callback = std::bind(g_pub_event_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); + return(pub->AddEventCallback(type_, callback)); +} + +/****************************************/ +/* pub_rem_event_callback */ +/****************************************/ +ECAL_API bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_) +{ + auto* pub = static_cast(handle_); + + return(pub->RemEventCallback(type_)); +} + + +/****************************************/ +/* sub_create */ +/****************************************/ +ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_) +{ + eCAL::SDataTypeInformation topic_info; + topic_info.name = topic_type_; + auto* sub = new eCAL::CSubscriber; + if (!sub->Create(topic_name_, topic_info)) + { + delete sub; + return(nullptr); + } + return(sub); +} + +/****************************************/ +/* sub_destroy */ +/****************************************/ +ECAL_API bool sub_destroy(ECAL_HANDLE handle_) +{ + auto* sub = static_cast(handle_); + if(sub != nullptr) + { + delete sub; + return(true); + } + return(false); +} + +/****************************************/ +/* sub_receive */ +/****************************************/ +ECAL_API int sub_receive(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, const int timeout_) +{ + auto* sub = static_cast(handle_); + if(sub != nullptr) + { + std::string rcv_buf; + long long rcv_time = 0; + sub->ReceiveBuffer(rcv_buf, &rcv_time, timeout_); + + if(!rcv_buf.empty()) + { + // this has to be freed by caller (ecal_free_mem) + char* cbuf = str_malloc(rcv_buf); + if(cbuf == nullptr) return(0); + + if (rcv_buf_ != nullptr) { + *rcv_buf_ = cbuf; + if (rcv_buf_len_ != nullptr) *rcv_buf_len_ = static_cast(rcv_buf.size()); + } + else { + // free allocated memory: + ecal_free_mem(cbuf); + if (rcv_buf_len_ != nullptr) *rcv_buf_len_ = 0; + // operation could't be completed successfully + return(0); + } + + if(rcv_time_ != nullptr) *rcv_time_ = rcv_time; + + return(static_cast(rcv_buf.size())); + } + } + return(0); +} + +/****************************************/ +/* sub_receive_buffer */ +/****************************************/ +ECAL_API bool sub_receive_buffer(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, const int timeout_) +{ + auto* sub = static_cast(handle_); + if (sub != nullptr) + { + std::string rcv_buf; + long long rcv_time = 0; + + if (sub->ReceiveBuffer(rcv_buf, &rcv_time, timeout_)) + { + // this has to be freed by caller (ecal_free_mem) + char* cbuf = str_malloc(rcv_buf); + if (cbuf == nullptr) return(false); + + if (rcv_buf_ != nullptr) { + *rcv_buf_ = cbuf; + if (rcv_buf_len_ != nullptr) *rcv_buf_len_ = static_cast(rcv_buf.size()); + } + else { + // free allocated memory: + ecal_free_mem(cbuf); + if (rcv_buf_len_ != nullptr) *rcv_buf_len_ = 0; + // operation couldn't be completed successfullly. + return(false); + } + if (rcv_time_ != nullptr) *rcv_time_ = rcv_time; + + return(true); + } + } + return(false); +} + +/****************************************/ +/* sub_add_receive_callback */ +/****************************************/ +static std::mutex g_sub_receive_callback_mtx; +static void g_sub_receive_callback(const char* topic_name_, const struct eCAL::SReceiveCallbackData* data_, const ReceiveCallbackCT callback_, void* par_) +{ + const std::lock_guard lock(g_sub_receive_callback_mtx); + SReceiveCallbackDataC data{}; + data.buf = data_->buf; + data.size = data_->size; + data.id = data_->id; + data.time = data_->time; + data.clock = data_->clock; + callback_(topic_name_, &data, par_); +} + +ECAL_API bool sub_add_receive_callback(ECAL_HANDLE handle_, const ReceiveCallbackCT callback_, void* par_) +{ + auto* sub = static_cast(handle_); + + auto callback = std::bind(g_sub_receive_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); + return(sub->AddReceiveCallback(callback)); +} + +/****************************************/ +/* sub_rem_receive_callback */ +/****************************************/ +ECAL_API bool sub_rem_receive_callback(ECAL_HANDLE handle_) +{ + auto* sub = static_cast(handle_); + + return(sub->RemReceiveCallback()); +} + +/****************************************/ +/* sub_add_event_callback */ +/****************************************/ +static std::mutex g_sub_event_callback_mtx; +static void g_sub_event_callback(const char* topic_name_, const struct eCAL::SSubEventCallbackData* data_, const SubEventCallbackCT callback_, void* par_) +{ + const std::lock_guard lock(g_sub_event_callback_mtx); + SSubEventCallbackDataC data{}; + data.type = data_->type; + data.time = data_->time; + data.clock = data_->clock; + data.tid = data_->tid.c_str(); + data.tname = data_->tdatatype.name.c_str(); + data.tencoding = data_->tdatatype.encoding.c_str(); + data.tdesc = data_->tdatatype.descriptor.c_str(); + callback_(topic_name_, &data, par_); +} + +ECAL_API bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, const SubEventCallbackCT callback_, void* par_) +{ + auto* sub = static_cast(handle_); + + auto callback = std::bind(g_sub_event_callback, std::placeholders::_1, std::placeholders::_2, callback_, par_); + return(sub->AddEventCallback(type_, callback)); +} + +/****************************************/ +/* sub_rem_event_callback */ +/****************************************/ +ECAL_API bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_) +{ + auto* sub = static_cast(handle_); + + return(sub->RemEventCallback(type_)); +} + + +/****************************************/ +/* server_create */ +/****************************************/ +ECAL_API ECAL_HANDLE server_create(const char* service_name_) +{ + auto* server = new eCAL::CServiceServer; + if (!server->Create(service_name_)) + { + delete server; + return(nullptr); + } + return(server); +} + +/****************************************/ +/* server_destroy */ +/****************************************/ +ECAL_API bool server_destroy(ECAL_HANDLE handle_) +{ + auto* server = static_cast(handle_); + if (server != nullptr) + { + delete server; + return(true); + } + else + { + return(false); + } +} + +/****************************************/ +/* server_add_method_callback */ +/****************************************/ +static std::mutex g_server_add_method_callback_mtx; +static int g_server_method_callback(const std::string& method_, const std::string& req_type_, const std::string& resp_type_, const std::string& request_, std::string& response_, const MethodCallbackCT callback_, void* par_) +{ + const std::lock_guard lock(g_server_add_method_callback_mtx); + void* response(nullptr); + int response_len(0); + const int ret = callback_(method_.data(), req_type_.data(), resp_type_.data(), request_.data(), static_cast(request_.size()), &response, &response_len, par_); + response_ = std::string(static_cast(response), static_cast(response_len)); + return ret; +} + +ECAL_API bool server_add_method_callback(ECAL_HANDLE handle_, const char* method_name_, const char* req_type_, const char* resp_type_, const MethodCallbackCT callback_, void* par_) +{ + auto* server = static_cast(handle_); + if (server != nullptr) + { + auto callback = std::bind(g_server_method_callback, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, callback_, par_); + return(server->AddMethodCallback(method_name_, req_type_, resp_type_, callback)); + } + else + { + return(false); + } +} + +/****************************************/ +/* server_rem_method_callback */ +/****************************************/ +ECAL_API bool server_rem_method_callback(ECAL_HANDLE handle_, const char* method_name_) +{ + auto* server = static_cast(handle_); + if (server != nullptr) + { + return(server->RemMethodCallback(method_name_)); + } + else + { + return(false); + } +} + + +/****************************************/ +/* client_create */ +/****************************************/ +ECAL_API ECAL_HANDLE client_create(const char* service_name_) +{ + auto* client = new eCAL::CServiceClient; + if (!client->Create(service_name_)) + { + delete client; + return(nullptr); + } + return(client); +} + +/****************************************/ +/* client_destroy */ +/****************************************/ +ECAL_API bool client_destroy(ECAL_HANDLE handle_) +{ + auto* client = static_cast(handle_); + if (client != nullptr) + { + delete client; + return(true); + } + else + { + return(false); + } +} + +/****************************************/ +/* client_set_hostname */ +/****************************************/ +ECAL_API bool client_set_hostname(ECAL_HANDLE handle_, const char* host_name_) +{ + auto* client = static_cast(handle_); + if (client != nullptr) + { + return(client->SetHostName(host_name_)); + } + else + { + return(false); + } +} + +/****************************************/ +/* client_call_method */ +/****************************************/ +ECAL_API bool client_call_method(ECAL_HANDLE handle_, const char* method_name_, const char* request_, const int request_len_, const int timeout_) +{ + auto* client = static_cast(handle_); + if (client != nullptr) + { + std::string request(request_, request_len_); + return(client->Call(method_name_, request, timeout_)); + } + else + { + return(false); + } +} + +/****************************************/ +/* client_call_method_async */ +/****************************************/ +ECAL_API bool client_call_method_async(ECAL_HANDLE handle_, const char* method_name_, const char* request_, const int request_len_, const int timeout_) +{ + auto* client = static_cast(handle_); + if (client != nullptr) + { + std::string request(request_, request_len_); + return(client->CallAsync(method_name_, request, timeout_)); + } + else + { + return(false); + } +} + +/****************************************/ +/* client_add_response_callback */ +/****************************************/ + +/****************************************/ +/* client_rem_response_callback */ +/****************************************/ + + +#if ECAL_CORE_MONITORING +/****************************************/ +/* mon_initialize */ +/****************************************/ +ECAL_API int mon_initialize() +{ + return(eCAL::Initialize(0, nullptr, "", eCAL::Init::Monitoring)); +} + +/****************************************/ +/* mon_finalize */ +/****************************************/ +ECAL_API int mon_finalize() +{ + return(ecal_finalize()); +} + +/****************************************/ +/* mon_set_excl_filter */ +/****************************************/ +ECAL_API int mon_set_excl_filter(const char* filter_) +{ + return(eCAL::Monitoring::SetExclFilter(filter_)); +} + +/****************************************/ +/* mon_set_incl_filter */ +/****************************************/ +ECAL_API int mon_set_incl_filter(const char* filter_) +{ + return(eCAL::Monitoring::SetInclFilter(filter_)); +} + +/****************************************/ +/* mon_set_filter_state */ +/****************************************/ +ECAL_API int mon_set_filter_state(const bool state_) +{ + return(eCAL::Monitoring::SetFilterState(state_)); +} + +/****************************************/ +/* mon_get_monitoring */ +/****************************************/ +ECAL_API int mon_get_monitoring(const char** mon_buf_, int* mon_buf_len_) +{ + std::string mon_s; + const int size = eCAL::Monitoring::GetMonitoring(mon_s); + if(size > 0) + { + // this has to be freed by caller (ecal_free_mem) + char* cbuf = str_malloc(mon_s); + if(cbuf == nullptr) return(0); + + if (mon_buf_ != nullptr) { + *mon_buf_ = cbuf; + if (mon_buf_len_ != nullptr) *mon_buf_len_ = static_cast(mon_s.size()); + } + else + { + // free allocated memory: + ecal_free_mem(cbuf); + if (mon_buf_len_ != nullptr) *mon_buf_len_ = 0; + // operation could't be completed successfully + return(0); + } + return(static_cast(mon_s.size())); + } + else + { + return(0); + } +} + +/****************************************/ +/* mon_get_logging */ +/****************************************/ +ECAL_API int mon_get_logging(const char** log_buf_, int* log_buf_len_) +{ + std::string log_s; + const int size = eCAL::Logging::GetLogging(log_s); + if(size > 0) + { + // this has to be freed by caller (ecal_free_mem) + char* cbuf = str_malloc(log_s); + if(cbuf == nullptr) return(0); + + if (log_buf_ != nullptr) { + *log_buf_ = cbuf; + if (log_buf_len_ != nullptr) *log_buf_len_ = static_cast(log_s.size()); + } + else { + // free allocated memory: + ecal_free_mem(cbuf); + if (log_buf_len_ != nullptr) *log_buf_len_ = 0; + // operation couldn't be completed successfullly. + return(0); + } + return(static_cast(log_s.size())); + } + else + { + return(0); + } +} +#endif // ECAL_CORE_MONITORING diff --git a/src/service/ecal_service/CMakeLists.txt b/src/service/ecal_service/CMakeLists.txt index 61fefff..63b86e3 100644 --- a/src/service/ecal_service/CMakeLists.txt +++ b/src/service/ecal_service/CMakeLists.txt @@ -93,7 +93,7 @@ target_include_directories(${PROJECT_NAME} set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} - FOLDER core/service + FOLDER lib/service ) ################################## diff --git a/src/service/sample/CMakeLists.txt b/src/service/sample/CMakeLists.txt index 0296bbc..531e349 100644 --- a/src/service/sample/CMakeLists.txt +++ b/src/service/sample/CMakeLists.txt @@ -32,7 +32,7 @@ target_link_libraries(${PROJECT_NAME} target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) -set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER core/service) +set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER lib/service) source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${sources} diff --git a/src/service/test/CMakeLists.txt b/src/service/test/CMakeLists.txt index 69d534b..9d19e1f 100644 --- a/src/service/test/CMakeLists.txt +++ b/src/service/test/CMakeLists.txt @@ -36,7 +36,7 @@ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_gtest(${PROJECT_NAME}) -set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER tests/service) +set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER lib/service) source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${sources} diff --git a/src/time/linuxptp/CMakeLists.txt b/src/time/linuxptp/CMakeLists.txt index 84aebd3..a764239 100644 --- a/src/time/linuxptp/CMakeLists.txt +++ b/src/time/linuxptp/CMakeLists.txt @@ -53,5 +53,5 @@ set(ECALTIME_CONFIG_FILES PARENT_SCOPE) set_target_properties(${PROJECT_NAME} PROPERTIES - FOLDER core/time + FOLDER time RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/${ECAL_TIME_PLUGIN_DIR}) diff --git a/src/time/localtime/CMakeLists.txt b/src/time/localtime/CMakeLists.txt index 1416d90..40fd8b8 100644 --- a/src/time/localtime/CMakeLists.txt +++ b/src/time/localtime/CMakeLists.txt @@ -52,5 +52,5 @@ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_time_plugin(${PROJECT_NAME}) set_target_properties(${PROJECT_NAME} PROPERTIES - FOLDER core/time + FOLDER lib/time RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/${ECAL_TIME_PLUGIN_DIR}) diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index d1f6e19..5d3b827 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -58,4 +58,4 @@ source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" ecal_install_library(${PROJECT_NAME}) -set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER core/utils) +set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER lib/utils) From f19af8b65ca715b0cecaa1b6a0b12991a2f7615a Mon Sep 17 00:00:00 2001 From: rex-schilasky <49162693+rex-schilasky@users.noreply.github.com> Date: Fri, 9 Feb 2024 15:51:03 +0100 Subject: [PATCH 2/2] ecal_clang configuration switches added --- src/core/src/ecal_clang.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/src/ecal_clang.cpp b/src/core/src/ecal_clang.cpp index 1c6e7cc..49cb860 100644 --- a/src/core/src/ecal_clang.cpp +++ b/src/core/src/ecal_clang.cpp @@ -272,6 +272,7 @@ ECAL_API void log_message(const char* message_) } +#if ECAL_CORE_PUBLISHER /****************************************/ /* pub_create */ /****************************************/ @@ -357,8 +358,10 @@ ECAL_API bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Ev return(pub->RemEventCallback(type_)); } +#endif // ECAL_CORE_PUBLISHER +#if ECAL_CORE_SUBSCRIBER /****************************************/ /* sub_create */ /****************************************/ @@ -532,8 +535,10 @@ ECAL_API bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_E return(sub->RemEventCallback(type_)); } +#endif // ECAL_CORE_SUBSCRIBER +#if ECAL_CORE_SERVICE /****************************************/ /* server_create */ /****************************************/ @@ -698,6 +703,7 @@ ECAL_API bool client_call_method_async(ECAL_HANDLE handle_, const char* method_n /****************************************/ /* client_rem_response_callback */ /****************************************/ +#endif // ECAL_CORE_SERVICE #if ECAL_CORE_MONITORING