リポジトリ
bleRPCは、メインのモノレポと、対応する各言語向けのプロトコルライブラリパッケージで構成されています。
メインリポジトリ
tdaira/blerpc
ファームウェア、セントラルクライアント、コードジェネレーター、テストを含むメインのモノレポ
| ディレクトリ | 説明 |
|---|---|
peripheral_fw/ | Zephyrペリフェラルファームウェア (C) — nRF54L15 & EFR32xG22E |
peripheral_py/ | ロールリバーサルテスト用Pythonペリフェラル (bless) |
central_py/ | Pythonセントラルクライアント (bleak) + 統合テスト |
central_fw/ | デバイス間通信用Zephyrセントラルファームウェア (C) |
central_android/ | Androidセントラルアプリ (Kotlin)、テストランナー付き |
central_ios/ | iOSセントラルアプリ (Swift)、テストランナー付き |
central_flutter/ | Flutterセントラルアプリ (Dart)、テストランナー付き |
central_rn/ | React Nativeセントラルアプリ (TypeScript)、テストランナー付き |
proto/ | Protocol Buffers定義(blerpc.proto) |
tools/generate-handlers/ | コードジェネレーター (Go) — 全言語のハンドラーとクライアントを生成 |
boards/ | カスタムボード定義 (EFR32xG22E) |
docs/ | 追加ドキュメント(ファームウェアガイド) |
プロトコルライブラリ
各言語向けに個別パッケージとして公開されている、プラットフォーム非依存のプロトコルエンコーディング/デコーディングライブラリです。
blerpc-protocol
Python C
コンテナの分割/再組み立て、コマンドのエンコーディング/デコーディング、E2E暗号化(鍵交換 + AES-128-GCM)。Pythonパッケージはpipでインストール可能です。C実装(c/src/ + c/include/)は組み込み用
pip install git+https://github.com/tdaira/blerpc-protocol.git
blerpc-protocol-swift
Swift
iOSおよびmacOS向けSwift Package。Foundation と CryptoKit(Appleプラットフォームフレームワーク)を使用。iOS 16以上、macOS 13以上をサポート
// Swift Package Manager
.package(url: "https://github.com/tdaira/blerpc-protocol-swift", from: "0.5.0")
blerpc-protocol-kt
Kotlin
Android向けKotlinライブラリ。GitHub Packages (Maven)で公開
implementation("com.blerpc:blerpc-protocol-kt:0.5.0")
blerpc-protocol-dart
Dart
Flutter向けPure Dartライブラリ。pub.devで公開。暗号化にはcryptographyパッケージを使用
blerpc_protocol: ^0.6.0
blerpc-protocol-rn
TypeScript
React Native向けTypeScriptライブラリ。暗号化には@noble/ciphers、@noble/curves、@noble/hashesを使用(純粋なJS、ネイティブ依存なし)
"@blerpc/protocol-rn": "file:../blerpc-protocol-rn"
アーキテクチャ概要
リポジトリ間の関係:
bleRPC (monorepo)
+-----------------------------------------+
| |
| proto/blerpc.proto |
| | |
| v |
| tools/generate-handlers (Go) |
| | |
| +---> peripheral_fw/src/ |
| | generated_handlers.{c,h} |
| | |
| +---> central_py/blerpc/generated/ |
| | generated_client.py |
| | |
| +---> central_android/.../ |
| | GeneratedClient.kt |
| | |
| +---> central_ios/.../ |
| | GeneratedClient.swift |
| | |
| +---> central_flutter/.../ |
| | generated_client.dart |
| | |
| +---> central_rn/.../ |
| | GeneratedClient.ts |
| | |
| +---> central_fw/src/ |
| generated_client.{c,h} |
| |
+-----------------------------------------+
| | | | |
v v v v v
blerpc-protocol blerpc- blerpc- blerpc- blerpc-
(Python + C) protocol-kt proto- proto- proto-
swift dart rn
CI / CD
各リポジトリにはGitHub Actions CIがあり、プッシュおよびプルリクエストのたびに実行されます:
| リポジトリ | CIチェック |
|---|---|
| blerpc | Pythonテスト + ruff lint、C lint (clang-format)、Go lint + build、iOSビルド、Androidビルド、Flutterビルド |
| blerpc-protocol | Pythonテスト + lint、C lint + テスト |
| blerpc-protocol-swift | swift build、swift test、SwiftLint |
| blerpc-protocol-kt | Gradle test、ktlint |
| blerpc-protocol-dart | dart analyze、dart test、pub.devへの自動公開 |
ライセンス
すべてのbleRPCリポジトリはGNU Lesser General Public License v3.0 (LGPL-3.0)の静的リンク例外付きでライセンスされています。bleRPCライブラリに対して静的リンクする場合、再リンク可能なオブジェクトファイルの提供は不要です。詳細は各リポジトリのLICENSING_EXCEPTIONファイルを参照してください。