Handling the # TODO: Handle failure in the _IRQ_ENCRYPTION_UPDATE event
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- networking
調査の方向性
まず _security_irq と DeviceConnection._connected を追跡し、報告されたステータス値を bluetooth.h および既存の接続イベントとペアリングイベントの処理と比較します。暗号化エラー、切断、接続の欠落、ペアリングイベントについて期待される動作を特定します。各ケースについてアプリケーションが一貫性のある文書化された結果を受け取れば完了です。
索引モデルが issue の本文から書いたものです。
説明
I am using the btstack for the PICO_W. We have needed to do significant work to add pairing/encryption support from the BtStack but for the most part I think we have got the basics working. What I need to know is what to do with the aioble objects when errors occur. I have modified the code a little (slowly adding typing as I learn what things are) to look as follows:
pair_status: int = -1
def _security_irq(event: int, data: tuple[int, bool, bool, bool, int, int]):
global _modified
global pair_status
if event == _IRQ_ENCRYPTION_UPDATE:
pair_status = -1
# Connection has updated (usually due to pairing).
conn_handle, encrypted, authenticated, bonded, key_size, status = data
pair_status = status
logger.info("LNI: AIOBLE: encryption update") # type: ignore
if connection := DeviceConnection._connected.get(conn_handle, None):
logger.info(f'LNI: AIOBLE: Event triggered. Pairing status: {pair_status}') # type: ignore
connection.encrypted = encrypted
connection.authenticated = authenticated
connection.bonded = bonded
connection.key_size = key_size
if pair_status == 19: #ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION (in Bt Stack code - not so in MP code)
del DeviceConnection._connected[conn_handle] # Signal as disconnected
# TODO: Handle failure.
#if encrypted and connection._pair_event:
connection._pair_event.set()
I am assuming the status values are those defined in the btstack file bluetooth.h such that status value 0x13 is, for example, ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION
What I dont know is exactly what to do in each case. Is the del DeviceConnection._connected[conn_handle] sufficient for the ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION case? Should I always set the event if the connection is not None?
What should be done if if connection := DeviceConnection._connected.get(conn_handle, None) gives None?
Are there certain exceptions I should raise to inform the application or do I need to create one?
- 主要言語
- Python
- スター
- 2.9k
- フォーク
- 1.1k
- 平均マージ
- 7日 4時間
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
micropython/micropython-lib のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
micropython/micropython-lib#1074 ·
-
needs-info
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
micropython/micropython-lib#943 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
micropython/micropython-lib#931 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
micropython/micropython-lib#795 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
micropython/micropython-lib#762 ·
micropython/micropython-lib の issue をすべて見る
似ている issue
-
area: harness bug status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Human-Agent-Society/reef#625 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
learningequality/kolibri#15351 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Name consistency オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eellak/triplestore#65 · コメント 1 件 ·