No project description provided
Project description
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.
For iOS automated packaging and OSS release scripts, see ios/README.md.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bc_insole_sdk-0.3.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: bc_insole_sdk-0.3.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 242.4 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa9c394bffedadf4060abcd7c721d95b1572387b18675625110a48ce0d0e6de2
|
|
| MD5 |
812e66874c9eeeb257397fbb580710e7
|
|
| BLAKE2b-256 |
0d2779f18c66c435bc11cd16c16875c6865f89c9ca1c25b838ea97d795582740
|
Provenance
The following attestation bundles were made for bc_insole_sdk-0.3.0-cp310-abi3-win_amd64.whl:
Publisher:
build-python.yml on Yongle-Fu/bc-insole-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bc_insole_sdk-0.3.0-cp310-abi3-win_amd64.whl -
Subject digest:
fa9c394bffedadf4060abcd7c721d95b1572387b18675625110a48ce0d0e6de2 - Sigstore transparency entry: 2270529278
- Sigstore integration time:
-
Permalink:
Yongle-Fu/bc-insole-sdk@9c5f7fe8d4828b1ccc2f4accb322251d2fc4e008 -
Branch / Tag:
refs/heads/python_release - Owner: https://github.com/Yongle-Fu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-python.yml@9c5f7fe8d4828b1ccc2f4accb322251d2fc4e008 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bc_insole_sdk-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: bc_insole_sdk-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 339.6 kB
- Tags: CPython 3.10+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ad698d78732d79d9dd9bcbc319e84bd8d8449f9b36fffad28fa81fe98462914
|
|
| MD5 |
17f1af3a10b3a5de0d97710b8a6951a4
|
|
| BLAKE2b-256 |
df0acbcf160c7b47bff3a5a2208b56656a65c836a2b177eb834836920955e2d7
|
Provenance
The following attestation bundles were made for bc_insole_sdk-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl:
Publisher:
build-python.yml on Yongle-Fu/bc-insole-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bc_insole_sdk-0.3.0-cp310-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
3ad698d78732d79d9dd9bcbc319e84bd8d8449f9b36fffad28fa81fe98462914 - Sigstore transparency entry: 2270529031
- Sigstore integration time:
-
Permalink:
Yongle-Fu/bc-insole-sdk@9c5f7fe8d4828b1ccc2f4accb322251d2fc4e008 -
Branch / Tag:
refs/heads/python_release - Owner: https://github.com/Yongle-Fu
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-python.yml@9c5f7fe8d4828b1ccc2f4accb322251d2fc4e008 -
Trigger Event:
push
-
Statement type: