Connect any device from anywhere to everywhere!
Fleet Protocol is a modular communication technology developed by BringAuto to allow for simple and reliable communication between devices deployed in an internet-connection-unstable environment and cloud infrastructure.
Protocol consists of three parts:
- Internal Client (Remote) - part of a device which communicates with a Module Gateway
- Module Gateway (Remote):
- internal server - communicates with internal clients
- aggregator - aggregates status messages, gathers and aggragates messages in case of connection outage, ...
- external client - communicates with an External Server
- External Server (Cloud) - deployed as part of the cloud infrastructure. It provides status messages and can be used to control devices by command messages.
ProtoBuf (see Protobuf version) is used to serialize and deserialize messages. The message format specification can be found in the protobuf folder.
Each message must be prefixed with a four bytes long (uint32_t data type) header, which holds information about the size of the Protobuf message.
Check the Fleet Protocol v2 documentation to learn more about the system architecture:
- Summary - overall high-level summary
- Fleet Protocol Requirements
- Internal Client
- Module Gateway
- External Server
- Modules - list of implemented modules
- Message Structure
- Internal Client design
- Module Gateway design
- External Server design
Implementation of each respective component:
- Module Gateway impl
- External Server impl
- Internal Client
- Internal Client C++ impl - C++ implementation, only on Posix, no libraries used
- Internal Client Python3 impl
- Internal Client Arduino impl - basic implementation for Arduino 32bit boards
- Modules
- Mission Module - Autonomy Control module
- IO Module - Input/Output devices
- Example Module
All supported modules can be listed by fleet-protocol-module topic.
The Fleet Protocol HTTP API represents the protocol in the form of an HTTP API.
A Fleet Protocol Module can use the HTTP API to provide its statuses and retrieve commands through a simple and understandable REST API for easy integration with other services.
Fleet Protocol HTTP API is a standalone project and is not part of the Fleet Protocol v2 core specification.
Messages are described by ProtoBuf v3.
If a message field is not mandatory, then it's marked as OPTIONAL by "OPTIONAL" as the last comment in documentation for the given field. Optional fields have defaults as described in the ProtoBuf v3 doc.
This repository contains a basic C API and CMake project to easily implement Fleet Protocol Modules.
Samples of fleet-protocol features usage.
Use CMake option BRINGAUTO_SAMPLES=ON
to configure them.
Header files of interfaces
Compiled and non-compiled protobuf files
To install the library, first configure the project with the CMake option BRINGAUTO_INSTALL=ON and BRINGAUTO_PACKAGE=ON, and then install it.
mkdir _build && cd _build
cmake -DBRINGAUTO_INSTALL=ON -DBRINGAUTO_PACKAGE=ON ..
make install
To create a package, configure the project with CMake option BRINGAUTO_PACKAGE=ON and then create it using cpack
.
mkdir _build && cd _build
cmake -DBRINGAUTO_INSTALL=ON -DBRINGAUTO_PACKAGE=ON ..
cpack
Once the library is installed, it can be used in other projects by adding the following lines to the CMakeLists.txt
file:
FIND_PACKAGE(fleet-protocol-interface REQUIRED)
TARGET_LINK_LIBRARIES(<target> PUBLIC fleet-protocol-interface::fleet-protocol-interface)
This will link all interfaces. If you want to only link a specific interface, chose from the interfaces listed below:
- fleet-protocol-interface::common-headers-interface
- fleet-protocol-interface::internal-client-interface
- fleet-protocol-interface::module-gateway-interface
- fleet-protocol-interface::module-maintainer-external-server-interface
- fleet-protocol-interface::module-maintainer-module-gateway-interface
- fleet-protocol-interface::protobuf-cpp-interface
Note that
protobuf-cpp-interface
also needsprotobuf::libprotobuf
to be linked to the target