Skip to content

Commit

Permalink
Moved Util headers to fmi-ls-bus repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Menne authored and Benedikt Menne committed Dec 6, 2023
1 parent 530776c commit cfa5377
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 740 deletions.
18 changes: 11 additions & 7 deletions ls-bus-guide/4____network_abstraction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ This chapter contains details on CAN, CAN FD, CAN XL specific topics.
This section shows the exemplary implementation in conjunction with the provided header files of the fmi-ls-bus layered standard.

===== Provided Header Files [[low-cut-can-getting-started-provided-header-files]]
The layered standard fmi-ls-bus not only contains a textual specification for bus support, but also provides header and utility functions as C code to make creation and use within FMUs as easy as possible.
The following header files are provided by the standard for this purpose, although their use is not mandatory but optional:
Besides the textual specification for FMUs with bus support, the fmi-ls-bus layered standard also provides a C API to make the creation of FMUs with bus support as easy and generalized as possible.
The standard differentiates between two groups of files within the C API: Mandatory and optional files.

* https://github.com/modelica/fmi-ls-bus/blob/main/headers/fmi3LsBus.h[fmi3LsBus.h] provides general functions and structures.
These header file applies to all supported bus types of the layered standard.
* https://github.com/modelica/fmi-ls-bus/blob/main/headers/fmi3LsBusCan.h[fmi3LsBusCan.h] provides functions and structures explicit for CAN, CAN FD and CAN XL.
* https://github.com/modelica/fmi-ls-bus/blob/main/headers/fmi3LsBus.h[fmi3LsBus.h] provides general macros, types and structures of common Bus Operations.
These header file applies to all supported bus types of the layered standard.
The usage of this file is mandatory.
* https://github.com/modelica/fmi-ls-bus/blob/main/headers/fmi3LsBusCan.h[fmi3LsBusCan.h] provides macros, types and structures of Bus Operations explicit for CAN, CAN FD and CAN XL.
Primarily, structures are included here that allow the Bus Operations specified by the layered standard to be easily created and used.
* https://github.com/modelica/fmi-guides/blob/main/ls-bus-guide/headers/fmi3LsBusUtil.h[fmi3LsBusUtil.h] provides common utility functions and structures for all supported bus types.
* https://github.com/modelica/fmi-guides/blob/main/ls-bus-guide/headers/fmi3LsBusUtilCan.h[fmi3LsBusUtilCan.h] provides CAN, CAN FD and CAN XL explicit utility functions.
The usage of this file is mandatory.
* https://github.com/modelica/fmi-ls-bus/blob/main/headers/fmi3LsBusUtil.h[fmi3LsBusUtil.h] provides common utility macros and structures for all supported bus types.
The usage of this file is optional.
* https://github.com/modelica/fmi-ls-bus/blob/main/headers/fmi3LsBusUtilCan.h[fmi3LsBusUtilCan.h] provides CAN, CAN FD and CAN XL explicit utility macros.
The usage of this file is optional

===== General Aspects
Bus Operations represent protocol units to be transmitted in the environment of the layered standard based on the https://modelica.github.io/fmi-ls-bus/main/#low-cut-layered-standard-bus-protocol[Layered Standard Bus Protocol].
Expand Down
8 changes: 2 additions & 6 deletions ls-bus-guide/demos/can-bus-simulation/PackFmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

# Repository to fetch the LS-BUS headers from
LS_BUS_REPO = 'modelica/fmi-ls-bus'
LS_BUS_REV = '473bd5b80730c47373bf41f1c31d44f50de82dd0'
LS_BUS_HEADERS = [ 'fmi3LsBus.h', 'fmi3LsBusCan.h' ]
LS_BUS_REV = '4680d63c0705fbf9076f97128e913f464b442f53'
LS_BUS_HEADERS = [ 'fmi3LsBus.h', 'fmi3LsBusCan.h', 'fmi3LsBusUtil.h', 'fmi3LsBusUtilCan.h' ]


def main():
Expand All @@ -23,10 +23,6 @@ def main():
with urllib.request.urlopen(f'https://raw.githubusercontent.com/{LS_BUS_REPO}/{LS_BUS_REV}/headers/{ls_bus_header}') as f:
fmu.writestr(f'sources/{ls_bus_header}', f.read())

# Add LS-BUS utility headers
for file in (demo_dir.parent.parent / 'headers').iterdir():
fmu.write(file, f'sources/{file.name}')

# Add source files
for file in (demo_dir / 'src').iterdir():
fmu.write(file, f'sources/{file.name}')
Expand Down
8 changes: 2 additions & 6 deletions ls-bus-guide/demos/can-node-triggered-output/PackFmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

# Repository to fetch the LS-BUS headers from
LS_BUS_REPO = 'modelica/fmi-ls-bus'
LS_BUS_REV = '473bd5b80730c47373bf41f1c31d44f50de82dd0'
LS_BUS_HEADERS = [ 'fmi3LsBus.h', 'fmi3LsBusCan.h' ]
LS_BUS_REV = '4680d63c0705fbf9076f97128e913f464b442f53'
LS_BUS_HEADERS = [ 'fmi3LsBus.h', 'fmi3LsBusCan.h', 'fmi3LsBusUtil.h', 'fmi3LsBusUtilCan.h' ]


def main():
Expand All @@ -23,10 +23,6 @@ def main():
with urllib.request.urlopen(f'https://raw.githubusercontent.com/{LS_BUS_REPO}/{LS_BUS_REV}/headers/{ls_bus_header}') as f:
fmu.writestr(f'sources/{ls_bus_header}', f.read())

# Add LS-BUS utility headers
for file in (demo_dir.parent.parent / 'headers').iterdir():
fmu.write(file, f'sources/{file.name}')

# Add source files
for file in (demo_dir / 'src').iterdir():
fmu.write(file, f'sources/{file.name}')
Expand Down
223 changes: 0 additions & 223 deletions ls-bus-guide/headers/fmi3LsBusUtil.h

This file was deleted.

Loading

0 comments on commit cfa5377

Please sign in to comment.