arduino / arduino/ArduinoCore-API
[Feature Request] Make Wire library methods virtual
- Lingua principale
- C++
- Stelle
- 306
- Fork
- 150
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia individuando la dichiarazione della classe TwoWire in ArduinoCore-API e analizzandone i metodi pubblici e gli utilizzi esistenti tramite i riferimenti. Valuta le implicazioni per l’API e la compatibilità del rendere virtuali questi metodi, quindi verifica che una sottoclasse che implementa gli stessi metodi possa essere passata dove è prevista un’istanza di TwoWire e riceva le chiamate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- embedded-iot
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100