Skip to main content

BC Insole SDK

Rust, Python, iOS, and Android SDK foundation for BrainCo smart pressure insoles.

The device protocol uses a short binary transport frame carrying Protobuf payloads:

[BRNC][Ver][PayVer][Len LE][Protobuf Payload][CRC16 LE]

Core protocol support lives in sdk/src/protocol and implements:

  • CRC16-Modbus validation over header + payload
  • frame encoding
  • stream parsing with magic-byte resynchronization
  • Protobuf request/response payload encoding and decoding

Build

cargo test

Python

cd sdk
maturin develop --features python

The Python package exposes protocol constants, BLE advertisement parsing, request builders, and an incremental stream parser. Existing parser behavior remains compatible by default. New code can preserve calibrated and raw pressure fields separately and reject CRC-invalid frames:

import bc_insole_sdk

parser = bc_insole_sdk.StreamParser(
    strict_crc=True,
    legacy_pressure_fallback=False,
)

request = bc_insole_sdk.build_sensor_stream_config_request(
    msg_id=1,
    dest_id=bc_insole_sdk.DEVICE_LEFT,
    pressure_mode="raw",
    shear_mode="calibrated",
    imu_mode="calibrated",
)

Use parser.stats() for CRC, framing, Protobuf, sequence discontinuity, and packet-loss counters.

Pressure resistance calibration and pressure-derived shear use the same Rust implementation on all platforms. Inputs are resistance values in ohms from raw_pressure; outputs are calibrated normal load and derived force vectors in newtons. Python clients call calibrate_pressure() and derive_shear(); iOS and Android wrappers bind to bcis_calibrate_pressure() and bcis_derive_shear(). Protocol-native shear_data remains reserved for future firmware use, is disabled by default, and is not used by the derived-shear calculation.

IMU protocol fields keep calibrated LSB values (acc_x/gyro_x) and raw pre-calibration LSB values (raw_acc_x/raw_gyro_x) separately. The SDK exposes physical accelerometer values in milli-g and gyroscope values in degrees per second by applying acc_scale and gyro_scale. Sensor stream configuration defaults to calibrated IMU data because the physical-value conversion uses those calibrated LSB fields.

Mobile

The Rust crate exports a C ABI with staticlib/cdylib outputs. iOS and Android wrappers should bind to the C surface in sdk/src/c.

iOS SensorStreamConfig and Android SensorStreamConfig use the same defaults as Python: raw pressure, calibrated IMU, and protocol-native shear disabled. Pressure callbacks expose both a compatibility pressure array and an explicit rawPressure array. When firmware sends raw pressure only, both arrays contain resistance in ohms; when calibrated pressure is also present, pressure contains calibrated protocol values while rawPressure remains resistance in ohms.

Metadata

Release files for bc_insole_sdk 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for bc_insole_sdk 0.2.0
File Interpreter ABI Platform
bc_insole_sdk-0.2.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
bc_insole_sdk-0.2.0-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details
bc_insole_sdk-0.2.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 890.1 kB

Release files / bc_insole_sdk-0.2.0-cp310-abi3-win_amd64.whl

Download URL bc_insole_sdk-0.2.0-cp310-abi3-win_amd64.whl
Size 241.6 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
08be09837f4c90a7b1bf411ccf46aacdb169053408bb7346f7fdfef017679410
BLAKE2b-256 checksum
How to use checksums
bd04aa3d86be8e2893035fd4351c289851b536726fff01252c54f80760724f6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Release files / bc_insole_sdk-0.2.0-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL bc_insole_sdk-0.2.0-cp310-abi3-manylinux_2_34_x86_64.whl
Size 339.1 kB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
6ab71f3d5feb185f5c104b2ee8bbe302287e752a15c6021acbb2634cab6e1bde
BLAKE2b-256 checksum
How to use checksums
86e0fd8e5165fd9e83b952d134394a622c2c901302c67998fcf6dba31b2f342b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.

Transparency log

Release files / bc_insole_sdk-0.2.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL bc_insole_sdk-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Size 309.4 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5cbe6ad62d3a03c7e6d93e76b9a77fa3c425c7a5ed840fa6c048523e2215f2af
BLAKE2b-256 checksum
How to use checksums
ee646364680abda4190da238b7fa30c756e933a1930bd5078682b3b5de15c022
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.4.2

1 release file

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

3 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page