Skip to content
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

[Request] make read_register() protected for possible derivatives #782

Closed
2bndy5 opened this issue Aug 10, 2021 · 1 comment · Fixed by #772
Closed

[Request] make read_register() protected for possible derivatives #782

2bndy5 opened this issue Aug 10, 2021 · 1 comment · Fixed by #772

Comments

@2bndy5
Copy link
Member

2bndy5 commented Aug 10, 2021

I've been revisiting the pyRF24 repo to re-write the python wrappers with pybind11 (nRF24/pyRF24#3)

I'm using inheritance to enhance the python wrappers' API in a more pythonic way. By inheriting from RF24, I expect to use read_register() to provide new functionality that would be otherwise unnecessary for low-memory platforms (ie getters for the driver's attributes like is_powered or is_dyn_pl_enabled). However, currently, read_register() is a private function. I remember seeing a similar discussion in an old issue about mz-fuzzy's RF24Remote project (#63).

Pybind11 boasts automatic downcasting, so passing a derived object of RF24 to classes like RF24Network and RF24Mesh should be no problem. However, if this presents a problem I could have the python wrappers' source manually downcast derived objects of RF24.

ps - all functionality in the current python wrappers will be still present, but the casing for member names will use PEP8 standards (CRCLength will be crc_length)

@TMRh20
Copy link
Member

TMRh20 commented Aug 10, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants