bluetooth.connect with autoDiscoverAll hangs on iOS for BT Assigned Numbers
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- mobile-dev
調査の方向性
src/bluetooth.ios.ts の discoverCharacteristics から始め、prepareArgs デコレーターが args.serviceUUID をどのように変更するかを追跡します。autoDiscoverAll を有効にした Assigned Numbers のケースを再現し、UUID の比較によって discovery が完了して onConnected が呼び出され、promise が未解決のままにならないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
I'm investigating an issue where bluetooth.connect() fails to resolve the promise when a serviceUUID falls under the Bluetooth Assigned Numbers list:
- BT specification: https://www.bluetooth.com/specifications/assigned-numbers/
my project versions:
{
"@nativescript/core": "^8.4.1",
"@nativescript-community/ble": "^3.1.11",
}
the call to bluetooth.connect():
await this.bluetooth.connect({
UUID: deviceUuid,
// autoDiscoverAll causes the hang... but only for those Assigned Number serviceUUIDs (link above)
autoDiscoverAll: true,
onConnected: (peripheral) => {
// the onConnected() callback is never called...
},
onDisconnected: function (peripheral) {
// onDisconnected IS called, on disconnect
}
});
I have tracked the problem down to:
https://github.com/nativescript-community/ble/blob/master/src/bluetooth.ios.ts#L1643-L1644
@bluetoothEnabled
@prepareArgs
public discoverCharacteristics(args: DiscoverCharacteristicsOptions) {
// ...
const sUUID = CBUUIDToString(service.UUID);
if (UUID === pUUID && sUUID === args.serviceUUID) {
// ...
}
// ...
}
the issue is the following comparison fails:
# "0000181a-0000-1000-8000-00805f9b34fb" == "181a"
sUUID === args.serviceUUID
args.serviceUUID is being be modified by the decorator prepareArgs() to a "Short UUID", if the service's UUID matches a Bluetooth Assigned Number of the form
const pattern = /0000(.{4})-0000-1000-8000-00805f9b34fb/;
however, sUUID returned by CBUUIDToString(service.UUID) is a "Long UUID"
Long vs Short UUIDs:
I'll work on a fix and submit a PR today hopefully...
- 主要言語
- TypeScript
- スター
- 202
- フォーク
- 79
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nativescript-community/ble のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
nativescript-community/ble#282 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
nativescript-community/ble#280 · コメント 8 件 ·
-
Passkey supportオープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
nativescript-community/ble#279 · コメント 4 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
nativescript-community/ble#276 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
nativescript-community/ble#275 · コメント 6 件 ·
nativescript-community/ble の issue をすべて見る
似ている issue
-
calcite-ui-icons enhancement impact - p3 - not time sensitive needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
Esri/calcite-design-system#15467 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
diegosouzapw/OmniRoute#18390 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
guilhermerodz/input-otp#157 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
davidjerleke/embla-carousel#1414 ·
メンテナーはふだん 4 日以内に返信