Skip to content

BMCLI Simulation examples

Reference version: BMCLI 1.6.3. Command names, parameters and machine-readable fields retain their source spelling.

Start on an isolated CAN bench; do not inject faults directly into running vehicles or equipment. For the full command and parameter contract, see the simulation section of doc/bmcli_reference.md in the installation package. For the complete workflow from DBC and a normal 50 ms node to dropped/repeated/bypassed/checksum-corrupted frames, coexistence, and cleanup, see Node Simulation Practice. Each of the four sample faults fires once at the second opportunity. Enable only one per run, enable before start, and check fired against actual received frames.

vehicle.json uses generic counter-sum and does not represent an AUTOSAR or vendor specification. Open and claim a CAN channel, load the file, then start. All faults are disabled by default. Applications can atomically override signals and remove their waveforms with signal set, and attach waveforms again with source set.

demo_oem.c is an editable C ABI example with no intentional hang or crash code. The installed package places bm_e2e_plugin_api.h in the same directory; add -I../../../../include when building from the source tree. Compiler bitness must match BMCLI (the official Windows build is x86).

Windows MinGW (source tree; run in this directory):

gcc -m32 -shared -I../../../../include demo_oem.c -o demo-oem.dll

Linux (build natively for the target architecture):

cc -shared -fPIC -I../../../../include demo_oem.c -o demo-oem.so

Copy oem.json.template to oem.json; on Linux, change path to demo-oem.so. Replace sha256 with the actual library SHA-256 (PowerShell Get-FileHash / Linux sha256sum), then load oem.json and start oem-demo. Do not remove hash checking or load libraries of unknown origin. When building inside the installation package, no -I option is needed because the ABI header is in the same directory.

provider_id is the FNV-1a 32-bit value of the UTF-8 byte string “provider:demo-oem”. Changing the provider name requires updating both the manifest and plugin. profile=1, variant=0; context is one byte, the counter preserves the high four bits of byte 6, and the checksum is the sum of bytes 0..6 modulo 256. The normal path commits context only after BMAPI acceptance. Explicit frame-drop discards after protection but commits once; frame-repeat/e2e-bypass do not advance context. Plugins cannot independently advance external state or transmit.


Source of truth: BMCLI 1.6.3 repository documentation. Run bmcli help <category> <action> --format=json for the exact contract of the installed version.