How entertech/enter-biomodule-ble-pc-sdk works
Project Type and Purpose
• This is a Python SDK library (packaged as enterble) allowing client applications to discover, connect, and exchange data with Bluetooth devices on macOS, Linux, and Windows.
• It also provides a specialized “adapter” layer for EnterTech’s Flowtime series chips.
File Structure
• Top-level package: enterble/
• ble/: Core BLE abstractions (scanning, device management)
• adapter/flowtime/: Flowtime-specific data exchange logic
• collector/: High-level data collection routines
• Support files:
• examples/: sample client scripts showing typical usage
• requirements.txt, setup.py: packaging & dependency info
README for Technical Insights
• Uses Python’s asyncio event loop to perform scanning and data exchange.
• Abstracts over platform differences (UUID vs. MAC address).
• Guides users through discovery → connection → data collection.
Core Components
a. SDK Client Application
• The user’s Python script (e.g., examples/simple.py)
b. enterble SDK Layers
1. BLE Scanner (enterble.ble.scanner)
2. BLE Device Abstraction (enterble.ble.device)
3. Data Collector (enterble.collector.collector)
4. Flowtime Adapter (enterble.adapter.flowtime.collector)
c. External Systems & Dependencies
• Underlying OS Bluetooth Stack (macOS/Linux/Win)
• Bluetooth Hardware / EnterTech Chipset
• Python Runtime & asyncio
Relationships & Interactions
• The Client Application invokes the SDK API.
• The BLE Scanner discovers devices via the OS Bluetooth stack.
• Upon discovery, the BLE Device module manages connection setup.
• Once connected, the Data Collector orchestrates read/write operations.
• If the target device is a Flowtime chip, the Flowtime Adapter layer transforms raw data.
• Collected data is returned to the client for processing or display.
Architectural Patterns & Principles
• Modular packaging: clear separation into ble, collector, and adapter.
• Pluggable adapter pattern: new chip series can be supported by adding modules under enterble.adapter.
• Async non-blocking I/O with asyncio to handle BLE operations concurrently.