verion which did not include the handling in RTService wth creating the

Json file
This commit is contained in:
2024-06-25 20:50:29 +02:00
parent 2650679989
commit 5285f8b26e
215 changed files with 26816 additions and 219 deletions

View File

@@ -0,0 +1,77 @@
# ========================= 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 =================================
project(core_pb)
find_package(Protobuf REQUIRED)
set(ProtoFiles
${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/ecal.proto
${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/host.proto
${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/layer.proto
${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/monitoring.proto
${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/process.proto
${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/service.proto
${CMAKE_CURRENT_SOURCE_DIR}/src/ecal/core/pb/topic.proto
)
# Compile statically on Windows and shared for all other systems.
#
# We compile shared on Linux etc., as we must only load the proto descriptors
# once; otherwise, protobuf would throw an exception on runtime. A shared object
# achieves that, as it is only loaded into memory once, even when being linked
# against from different libraries.
# We don't have to do that on Windows, as we compile against protobuf statically
# and therefore each .dll has it's own descriptor pool. Having a static lib here
# also has the advantage that we need to export the symbols, which is default
# disabled on Windows.
#
# TODO: Having code like that probably isn't the best solution ever. We should
# maybe always link against protobuf statically. Currently the reason why we
# don't do that is, that the default Ubuntu libprotobuf.a doesn't contain
# position independent code and can therefore not be statically compiled into a
# shared object library.
if (WIN32)
ecal_add_static_library(${PROJECT_NAME} src/core_pb.cpp)
else()
ecal_add_shared_library(${PROJECT_NAME} src/core_pb.cpp)
endif()
add_library(eCAL::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
protobuf_target_cpp(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/src INSTALL_FOLDER include ${ProtoFiles})
target_compile_options(${PROJECT_NAME}
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/wd4505 /wd4592 /wd4189>
$<$<CXX_COMPILER_ID:GNU>:-Wno-unused-parameter>)
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)
ecal_install_library(${PROJECT_NAME})
if(BUILD_PY_BINDING)
protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
endif()
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER ecal/core_pb)

View File

@@ -0,0 +1 @@
// dummy file to force VS to create a library

View File

@@ -0,0 +1,71 @@
/* ========================= 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 =================================
*/
syntax = "proto3";
import "ecal/core/pb/host.proto";
import "ecal/core/pb/process.proto";
import "ecal/core/pb/service.proto";
import "ecal/core/pb/topic.proto";
package eCAL.pb;
message Content // topic content
{
int64 id = 1; // sample id
int64 clock = 2; // internal used clock
int64 time = 3; // time the content was updated
bytes payload = 4; // octet stream
int32 size = 6; // size (redundant for compatibility)
int64 hash = 7; // unique hash for that sample
}
enum eCmdType // command type
{
bct_none = 0; // undefined command
bct_set_sample = 1; // set sample content
bct_reg_publisher = 2; // register publisher
bct_reg_subscriber = 3; // register subscriber
bct_reg_process = 4; // register process
bct_reg_service = 5; // register service
bct_reg_client = 6; // register client
bct_unreg_publisher = 12; // unregister publisher
bct_unreg_subscriber = 13; // unregister subscriber
bct_unreg_process = 14; // unregister process
bct_unreg_service = 15; // unregister service
bct_unreg_client = 16; // unregister client
}
message Sample // a sample is a topic, it's descriptions and it's content
{
eCmdType cmd_type = 1; // sample command type
Host host = 2; // host information
Process process = 3; // process information
Service service = 4; // service information
Client client = 7; // client information
Topic topic = 5; // topic information
Content content = 6; // topic content
bytes padding = 8; // padding to artificially increase the size of the message. This is a workaround for TCP topics, to get the actual user-payload 8-byte-aligned. REMOVE ME IN ECAL6
}
message SampleList
{
repeated Sample samples = 1;
}

View File

@@ -0,0 +1,33 @@
/* ========================= 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 =================================
*/
syntax = "proto3";
package eCAL.pb;
message OSInfo // operating system details
{
string osname = 1; // name
}
message Host // eCAL host
{
string hname = 1; // host name
OSInfo os = 2; // operating system details
}

View File

@@ -0,0 +1,77 @@
/* ========================= 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 =================================
*/
syntax = "proto3";
package eCAL.pb;
message LayerParUdpMC
{
}
message LayerParShm
{
repeated string memory_file_list = 1; // list of memory file names
}
message LayerParInproc
{
}
message LayerParTcp
{
int32 port = 1; // tcp writers port number
}
message ConnnectionPar // connection parameter for reader / writer
{
LayerParUdpMC layer_par_udpmc = 1; // parameter for ecal udp multicast
LayerParShm layer_par_shm = 2; // parameter for ecal shared memory
LayerParInproc layer_par_inproc = 3; // parameter for ecal inner process
LayerParTcp layer_par_tcp = 4; // parameter for ecal tcp
}
enum eTLayerType // transport layer
{
tl_none = 0; // undefined
tl_ecal_udp_mc = 1; // ecal udp multicast
// 2 = ecal udp unicast (not supported anymore)
// 3 = ecal udp metal (not supported anymore)
tl_ecal_shm = 4; // ecal shared memory
tl_ecal_tcp = 5; // ecal tcp
tl_inproc = 42; // inproc (inner process)
tl_all = 255; // all layer
}
message TLayer
{
eTLayerType type = 1; // transport layer type
int32 version = 2; // transport layer version
bool confirmed = 3; // transport layer used ?
// ----------------------------------------------------------------------
// REMOVE ME IN ECAL6
// ----------------------------------------------------------------------
bytes par_shm = 4; // transport layer parameter (shm only, deprecated)
// ----------------------------------------------------------------------
// REMOVE ME IN ECAL6
// ----------------------------------------------------------------------
ConnnectionPar par_layer = 5; // transport layer parameter
}

View File

@@ -0,0 +1,52 @@
/* ========================= 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 =================================
*/
syntax = "proto3";
import "ecal/core/pb/host.proto";
import "ecal/core/pb/process.proto";
import "ecal/core/pb/service.proto";
import "ecal/core/pb/topic.proto";
package eCAL.pb;
message LogMessage // eCAL monitoring log message
{
int64 time = 1; // time
string hname = 2; // host name
int32 pid = 3; // process id
string pname = 4; // process name
string uname = 5; // unit name
int32 level = 6; // message level
string content = 7; // message content
}
message Monitoring // eCAL monitoring information
{
repeated Host hosts = 1; // hosts
repeated Process processes = 2; // processes
repeated Service services = 3; // services
repeated Client clients = 5; // clients
repeated Topic topics = 4; // topics
}
message Logging // eCAL logging information
{
repeated LogMessage logs = 1; // log messages
}

View File

@@ -0,0 +1,77 @@
/* ========================= 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 =================================
*/
syntax = "proto3";
package eCAL.pb;
enum eProcessSeverity // process severity
{
proc_sev_unknown = 0; // condition unknown
proc_sev_healthy = 1; // process healthy
proc_sev_warning = 2; // process warning level
proc_sev_critical = 3; // process critical
proc_sev_failed = 4; // process failed
}
enum eProcessSeverityLevel // process severity level
{
proc_sev_level_unknown = 0; // condition unknown
proc_sev_level1 = 1; // default severity level 1
proc_sev_level2 = 2; // severity level 2
proc_sev_level3 = 3; // severity level 3
proc_sev_level4 = 4; // severity level 4
proc_sev_level5 = 5; // severity level 5
}
message ProcessState // process state
{
eProcessSeverity severity = 1; // severity
eProcessSeverityLevel severity_level = 3; // severity level
string info = 2; // info string
}
enum eTSyncState // time synchronisation
{
tsync_none = 0; // not synchronized
tsync_realtime = 1; // real time sync mode
tsync_replay = 2; // replay time sync mode
}
message Process // process
{
int32 rclock = 1; // registration clock
string hname = 2; // host name
string hgname = 18; // host group name
int32 pid = 3; // process id
string pname = 4; // process name
string uname = 5; // unit name
string pparam = 6; // process parameter
int64 pmemory = 7; // process memory
float pcpu = 8; // process cpu usage
float usrptime = 9; // process user time
int64 datawrite = 10; // data write bytes per sec
int64 dataread = 11; // data read bytes per sec
ProcessState state = 12; // process state info
eTSyncState tsync_state = 13; // time synchronization state
string tsync_mod_name = 14; // time synchronization module name
int32 component_init_state = 15; // eCAL component initialization state (eCAL::Initialize(..))
string component_init_info = 16; // like comp_init_state as human readable string (pub|sub|srv|mon|log|time|proc)
string ecal_runtime_version = 17; // loaded / runtime eCAL version of a component
}

View File

@@ -0,0 +1,94 @@
/* ========================= 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 =================================
*/
syntax = "proto3";
package eCAL.pb;
message ServiceHeader
{
enum eCallState
{
none = 0;
executed = 1;
failed = 2;
}
string hname = 1; // host name
string sname = 2; // service name
string sid = 7; // service id
string mname = 3; // method name
string error = 4; // error message
int32 id = 5; // session id
eCallState state = 6; // method call state
}
message Request // client request
{
ServiceHeader header = 1; // common service header
bytes request = 2; // request payload
}
message Response // server response
{
ServiceHeader header = 1; // common service header
bytes response = 2; // response payload
int64 ret_state = 3; // callback return state
}
message Method // method
{
string mname = 1; // method name
string req_type = 2; // request type
bytes req_desc = 5; // request descriptor
string resp_type = 3; // response type
bytes resp_desc = 6; // response descriptor
int64 call_count = 4; // call counter
}
message Service // service
{
int32 rclock = 1; // registration clock
string hname = 2; // host name
string pname = 3; // process name
string uname = 4; // unit name
int32 pid = 5; // process id
string sname = 6; // service name
string sid = 9; // service id
repeated Method methods = 8; // list of methods
// transport specific parameter (for internal use)
uint32 version = 10; // service protocol version
uint32 tcp_port_v0 = 7; // the tcp port used for that service
uint32 tcp_port_v1 = 11; // the tcp port used for that service
}
message Client // client
{
int32 rclock = 1; // registration clock
string hname = 2; // host name
string pname = 3; // process name
string uname = 4; // unit name
int32 pid = 5; // process id
string sname = 6; // service name
string sid = 7; // service id
// transport specific parameter (for internal use)
uint32 version = 8; // client protocol version
}

View File

@@ -0,0 +1,82 @@
/* ========================= 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 =================================
*/
syntax = "proto3";
import "ecal/core/pb/layer.proto";
package eCAL.pb;
message QOS // quality of service
{
enum eQOSPolicy_Reliability
{
best_effort_reliability_qos = 0; // best effort reliability (default for Subscribers)
reliable_reliability_qos = 1; // reliable reliability (default for Publishers)
}
enum eQOSPolicy_HistoryKind
{
keep_last_history_qos = 0; // keep only a number of samples, default value
keep_all_history_qos = 1; // keep all samples until the ResourceLimitsQosPolicy are exhausted
}
eQOSPolicy_Reliability reliability = 1; // qos reliability (reliable / best effort)
eQOSPolicy_HistoryKind history = 2; // qos history kind (keep last / all)
int32 history_depth = 3; // number of samples for history kind "keep last"
}
message DataTypeInformation
{
string name = 1; // name of the datatype
string encoding = 2; // encoding of the datatype (e.g. protobuf, flatbuffers, capnproto)
bytes desc = 3; // descriptor information of the datatype (necessary for reflection)
}
message Topic // eCAL topic
{
int32 rclock = 1; // registration clock (heart beat)
int32 hid = 26; // host id
string hname = 2; // host name
string hgname = 28; // host group name
int32 pid = 3; // process id
string pname = 4; // process name
string uname = 5; // unit name
string tid = 6; // topic id
string tname = 7; // topic name
string direction = 8; // direction (publisher, subscriber)
string ttype = 9; // topic type + topic encoding (deprecated)
bytes tdesc = 10; // topic description (protocol descriptor) (deprecated)
DataTypeInformation tdatatype = 30; // topic datatype information (encoding & type & description)
QOS tqos = 11; // topic quality of service
repeated TLayer tlayer = 12; // active topic transport layers and it's specific parameter
int32 tsize = 13; // topic size
int32 connections_loc = 16; // number of local connected entities
int32 connections_ext = 17; // number of external connected entities
int32 message_drops = 18; // dropped messages
int64 did = 19; // data send id (publisher setid)
int64 dclock = 20; // data clock (send / receive action)
int32 dfreq = 21; // data frequency (send / receive samples per second) [mHz]
map<string, string> attr = 27; // generic topic description
}