COines BRidge Access — Bosch AppBoard protocol for Python
Project description
cobra-bridge
COines BRidge Access — Bosch AppBoard protocol for Python
Transport-agnostic library for the Bosch Sensortec Application Board 3.1+. Supports USB-Serial (pyserial) and BLE (Bleak) backends with identical protocol logic.
Install
pip install cobra-bridge
For BLE support:
pip install cobra-bridge[ble]
Quick Start
from cobra_bridge.transport import SerialTransport
from cobra_bridge.sync import CobraBridge
from cobra_bridge.drivers.bmm350 import BMM350
# USB-Serial
transport = SerialTransport(port='/dev/ttyACM0')
bridge = CobraBridge(transport=transport)
bridge.connect()
sensor = BMM350(bridge)
sensor.init()
data = sensor.read_mag_data(compensated=True)
print(f"X={data['x']:.2f} Y={data['y']:.2f} Z={data['z']:.2f} uT")
bridge.disconnect()
Platform-Specific Setup
Linux
# Install
pip install cobra-bridge
# Serial port — typically /dev/ttyACM0 or /dev/ttyUSB0
# Add yourself to the dialout group to avoid sudo:
sudo usermod -aG dialout $USER
# Log out and back in for group changes to take effect
# Find your board:
ls /dev/ttyACM* /dev/ttyUSB*
# Usage
from cobra_bridge.transport import SerialTransport
transport = SerialTransport(port='/dev/ttyACM0')
macOS
# Install
pip install cobra-bridge
# Serial port — typically /dev/cu.usbmodemXXXX
# List available ports:
ls /dev/cu.usbmodem*
# Usage
from cobra_bridge.transport import SerialTransport
transport = SerialTransport(port='/dev/cu.usbmodem1401')
Windows
# Install
pip install cobra-bridge
# Serial port — typically COM3, COM4, etc.
# Check Device Manager → Ports (COM & LPT) to find your board
# Usage
from cobra_bridge.transport import SerialTransport
transport = SerialTransport(port='COM3')
BLE (All Platforms)
from cobra_bridge.transport import BleTransport
# Scan for devices
devices = await BleTransport.scan(timeout=5.0)
# Connect by address
transport = BleTransport(address='AA:BB:CC:DD:EE:FF')
bridge = CobraBridge(transport=transport)
bridge.connect()
Note: BLE requires the
[ble]extra:pip install cobra-bridge[ble]
Architecture
┌──────────────┐ ┌─────────────┐
│ CobraBridge │────▶│ Transport │ ← abstract base
│ (Packetizer)│ │ (I/O) │
└──────────────┘ └─────────────┘
│
┌───────────┴───────────┐
│ │
Serial Transport BLE Transport
(pyserial/WebSerial) (Bleak/WebBluetooth)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 cobra_bridge-0.1.1.tar.gz.
File metadata
- Download URL: cobra_bridge-0.1.1.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.7 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
160abc666867974ddbd79d57bff81361b45f1413aeac45dc0e73126859c371cd
|
|
| MD5 |
2b214fc9a5a0c7d97b58156a933f8889
|
|
| BLAKE2b-256 |
9f15a037bbd9911c0b4a994ccdd17573810153bb62d4a09ad467034a3af0d604
|
File details
Details for the file cobra_bridge-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cobra_bridge-0.1.1-py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.7 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1486a0fc02064104a1932244ba2799cc5c631cc19d6d65a240561038dc3ed86e
|
|
| MD5 |
096792ad364f7ca73c3f4ed0c8d9a711
|
|
| BLAKE2b-256 |
f8edf6585068d5836ebc3c79283ec4dc1befe7ba33c92d7086e5480b36e30447
|