Skip to content

BALTECH BEC2 file format

License

Notifications You must be signed in to change notification settings

baltech-ag/bec2format

Repository files navigation

BALTECH AG - BEC2 file format

Add the dependency to your project

CPython

pip install git+https://github.com/baltech-ag/bec2format.git#v1.00.01
# or
poetry add git+https://github.com/baltech-ag/bec2format.git#v1.00.01

Micropython

import mip
mip.install("github:baltech-ag/bec2format/package.json", version="v1.00.01")

How to use

from bec2format.bf3file import Bf3Component, Bf3File

Bf3File(
    {"FirmwareId": "1100", "FirmwareVersion": "2.05.01"},
    [
        Bf3Component(
            {
                0xC1: bytes([0x11, 0x22, 0x33]), 
                0xC3: bytes([0x12, 0x33]),
            },
            bytes(list(range(0x100))),
        ),
    ],
)

Run appnotes

CPython

git clone https://github.com/baltech-ag/bec2format.git
cd bec2format
cd appnotes
py create_bec2file_with_ec_key.py

Micropython

git clone https://github.com/baltech-ag/bec2format.git
cd bec2format
cd appnotes
micropython install_depepencies.py
micropython create_bec2file_with_ec_key.py