arduino / arduino/ArduinoCore-API

[Feature Request] Make Wire library methods virtual

オープン
#31 コメント 6 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
306
フォーク
150
PR マージ指標
30日以内にマージされた PR はありません

説明

I suggest making the public methods of the TwoWire class virtual in order to allow polymorphism when subclassing it.

**Use case**: Have another library that utilizes the Wire library and takes a refrence to a TwoWire instance in constructor. Want to use it on pins without hardware I2C (or other reason for not wanting to use the standard Wire implementation). So I want to pass another class instance that inherits from TwoWire and implements the same methods (but uses software I2C). This does not work with current implementation because of early binding (the base class functions will be called instead of the ones in subclass).

Moved from: https://github.com/arduino/Arduino/issues/8734

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず ArduinoCore-API 内の TwoWire クラス宣言を見つけ、その公開メソッドと、参照を通じた既存の使用箇所を確認します。これらのメソッドを virtual にすることによる API および互換性への影響を評価し、その後、同じメソッドを実装するサブクラスを TwoWire インスタンスが想定される箇所に渡すことができ、呼び出しを受け取ることを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
embedded-iot
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。