-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Comments
This would be fine by me
… On Aug 10, 2021, at 1:56 AM, Brendan ***@***.***> wrote:
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)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 likeis_powered
oris_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 becrc_length
)The text was updated successfully, but these errors were encountered: