Skip to content

Automotive Bus Schema for data exchange between simulation models.

License

Notifications You must be signed in to change notification settings

boschglobal/automotive-bus-schema

Repository files navigation

Automotive Bus Schema

CI GitHub

Introduction

This is a collection of schemas in the Google FlatBuffers IDL for describing automotive network communications within a virtualized simulation environment.

Currently buffer representations of CAN, FlexRay, Ethernet and Encoded Signals at the level of a Communication Matrix definition are provided.

Project structure

L- docs        Documentation
L- schemas     Schemas of the Standard
L- docker      Supporting build environments

Build Run and Use

Compile

The schemas can be compiled using a containerized build toolchain as follows:

$ git clone https://github.com/boschglobal/automotive-bus-schema.git
$ cd automotive-bus-schema

# Build the toolchains (optional, builder containers are published on ghcr.io).
$ make builders
...
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
python-builder      latest              a5ef73ea66dc        16 minutes ago      858MB
flatc-builder       latest              f4bb83e2c0c9        18 minutes ago      324MB

# Build and package the schemas.
$ make
...
$ make dist

Distribution package files:
--------------------------
204K /vagrant/git/oss/automotive-bus-schema/dist/automotive-bus-schema.tar.gz
36K /vagrant/git/oss/automotive-bus-schema/dist/python/dist/automotive_bus_schema-devel-py3-none-any.whl
12K /vagrant/git/oss/automotive-bus-schema/dist/python/dist/automotive-bus-schema-devel.tar.gz

Alternatively, a build toolchain can be developed based on the Dockerfiles (Flatc/Flatcc, Python) used to generate the above containerized toolchain. For more information regarding compiling a FlatBuffers schema for your language, please refer first to the official page for supported languages. and compiler options listed here.

Note that for C language the flatcc compiler is recommended.

Usage

After compiling the output can be integrated in the simulation model code. Please refer to the FlatBuffers Tutorial for example usage of compiled code, e.g. how to read or write data structures defined in a schema.

Examples

This repository includes the following examples:

  • cmake - An example of a CMake based project with the Signal Schema and MsgPack.
  • streams - How to use the Stream Interface Frame Schema with FlatBuffers.

Dependencies

Schemas in this repository require:

Later versions may require testing.

Contribute

Please refer to the CONTRIBUTING.md for a quick read-up about what to consider if you want to contribute.

License

Automotive Bus FlatBuffers Schema is open-sourced under the Apache-2.0 license. See the LICENSE and NOTICE for details.