Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MECSEM Protobuf

Our standard message types are stored here. A Github action compiles the protobuf files in the src folder and pushes the changes to the build branch. This can then be installed/included directly into dependent code.

Contributors: Cristian & Adam

Usage:

C++

Add this repo as a submodule and checkout the build branch. Then use as:

set(MECSEM_PROTOBUF_BUILD_CXX ON)
set(MECSEM_PROTOBUF_BUILD_C OFF)
add_subdirectory(mecsem_protobuf)
target_link_libraries(my_app PRIVATE mecsem_protobuf_cpp)

C++ (Embedded)

protobuf requires thread for some thread-safety stuff which cannot be disabled, so we have to use nanopb (C) instead. The firmware is still written in C++ though.

set(MECSEM_PROTOBUF_BUILD_CXX OFF)
set(MECSEM_PROTOBUF_BUILD_C ON)
add_subdirectory(mecsem_protobuf)
target_link_libraries(my_app PRIVATE mecsem_protobuf_c)

Python

pip install git+ssh://git@github.com/MECSEM/mecsem_protobuf@build

Then use as: from mecsem_protobuf import parcel_pb2

The message IDs can also be accessed as:

from mecsem_protobuf import MessageID
print(MessageID.LogMessage.value) # 1

Operation

All transmitted messages on the network are of the type Parcel. The parcel contains the message type ID and the corresponding message. The message types are defined in the src folder and tabulated below for reference.

Note that the ID of the message type is important and should not be changed once assigned. Otherwise, this will break existing code.

Defined Types

A table is autogenerated during the build phase.

About

System-wide protobuf message declarations

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages