-
Notifications
You must be signed in to change notification settings - Fork 12
feat(dart_azarashi): UBXプロトコルデコーダーを追加 #1027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- UbloxDecoderクラスを実装 - UBX-RXM-SFRBXメッセージから$QZQSMセンテンスへの変換をサポート - libserialport_plus依存関係を追加
- QzssSerialPortService: シリアルポート接続とデータ受信を管理 - Riverpodプロバイダー: 接続状態と災危通報の状態管理 - QzssSerialPortSettingsPage: シリアルポート設定画面 - QzssDcrReportWidget: 災危通報表示ウィジェット - libserialport_plusとdart_azarashiの依存関係を追加
- QzssDcrPage: 災危通報の表示と設定へのナビゲーション - 接続状態表示カード
- 機能概要と使い方 - 技術仕様とアーキテクチャ - 参考資料
- DebugProfile.entitlementsとRelease.entitlementsに com.apple.security.device.serial権限を追加 - QZSS災危通報機能でシリアルポート接続を可能に
- Widgetを返す関数をprivate classに変更(_InfoRow, _JmaInfoCard) - 1箇所でしか使用しない関数を変数として定義 - disasterCategoryText - reportClassificationText - informationTypeText - コードフォーマット修正
Signed-off-by: YumNumm <admin@yumnumm.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 20
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| hexData.write(data[i].toRadixString(16).padLeft(2, '0')); | ||
| } | ||
| // 最後のバイトの上位2ビットを追加 | ||
| hexData.write(((data[31] & 0xC0) >> 4).toRadixString(16)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect bit extraction in UBX decoder
The bit mask 0xC0 extracts only the upper 2 bits instead of the required upper 4 bits for 252-bit data encoding. The expression ((data[31] & 0xC0) >> 4) produces values 0, 4, 8, or 12 only, missing values 1-3, 5-7, 9-11, and 13-15. The mask should be 0xF0 to extract the full upper nibble, matching the pattern used in qzss_dcr_decoder.dart lines 57 and 62.
| if (stream != null) { | ||
| stream.listen((report) { | ||
| state = report; | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Stream subscription memory leak in build method
The build method creates a stream listener without storing or canceling the subscription. Each time build executes (on provider rebuild), a new listener is created while old ones remain active, causing memory leaks. The subscription should be stored and properly disposed, or the stream should be converted to an AsyncValue using ref.listen or similar patterns.
| baudRate: baudRate, | ||
| error: e.toString(), | ||
| ); | ||
| rethrow; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Resource leak when connection fails
When _service.connect() throws an exception, the catch block updates state but doesn't clean up the partially-initialized _service object. This leaves _service pointing to an object with potentially unclosed serial port resources (if the connection failed after opening the port). The service should be disposed and set to null in the error path to prevent resource leaks.
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Unbounded buffer growth with invalid data
When incoming bytes don't match UBX or NMEA start sequences and no message reading is in progress, bytes accumulate in _buffer indefinitely without being cleared. This causes unbounded memory growth when receiving invalid or unexpected data. The buffer needs a size limit or garbage bytes should be discarded when not in an active reading state.
Note
Add QZSS DCR reception over serial (u‑blox UBX → $QZQSM) with providers, UI, and macOS serial entitlement, integrating a new UbloxDecoder.
QzssSerialPortServicereads serial (libserialport_plus), enablesUBX-RXM-SFRBX, parses UBX/NMEA, converts viaUbloxDecoder→NmeaDecoder, and streamsQzssDcReport.QzssSerialPortState(freezed) and Riverpod providers (availableSerialPorts,QzssSerialPortConnection,LatestQzssDcReport).QzssDcrReportWidgetto display decoded report details and raw$QZQSM.feature/qzss_dcr/README.md(usage, architecture, specs).UbloxDecoderto validateUBX-RXM-SFRBX, extract QZSS payload, and emit$QZQSMsentences.libserialport_plusinpackages/dart_azarashi/pubspec.yaml.com.apple.security.device.serialinDebugProfile.entitlementsandRelease.entitlements.dart_azarashiandlibserialport_plustoapp/pubspec.yaml.app/ExportOptions.plistkeys/values.Written by Cursor Bugbot for commit 548e335. This will update automatically on new commits. Configure here.