-
Notifications
You must be signed in to change notification settings - Fork 163
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 multicast_level and node_address members protected #187
Comments
Yeah I think I’m good with this
… On Aug 10, 2021, at 9:40 PM, Brendan ***@***.***> wrote:
This feature request is similar to nRF24/RF24#782 in that I'll be using inheritence to provide additional functionality in the newer python wrappers that isn't available in the the C++ libs (for low-memory reasons).
With this feature added, I do plan on letting users set the multicast_level and node_address members via existing functionality (RF24Network::multicast_level() and RF24Network::begin() respectively). The following psuedo-code might help to better describe my intentions here
import pyRF24.rf24 as rf24
import pyRF24.rf24_network as rf24_network
THIS_NODE = 0o1
radio = rf24.RF24(22, 0)
if not radio.begin:
print("radio hardware not responding")
exit()
network = rf24_network.RF24Network(radio)
# new python wrapper's setter for the node's logical address
# keep in mind that channel should be set with radio.set_channel(new_chnl) or radio.channel = new_chnl
network.node_address = THIS_NODE # underlying functionality calls RF24Network::begin(THIS_NODE)
# new python wrapper's getter for the node's logical address
addr = network.node_address # simply returns the private/protected member RF24Network::node_address
# set the multicast level
network.multicast_level = 1 # underlying functionality calls RF24Network::multicast_level()
# get the current multicast level
lvl = network.multicast_level # simply returns the private/protected member RF24Network::multicast_level
—
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.
|
I'll also prefix the private/protected |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This feature request is similar to nRF24/RF24#782 in that I'll be using inheritence to provide additional functionality in the newer python wrappers that isn't available in the the C++ libs (for low-memory reasons).
With this feature added, I do plan on letting users set the
multicast_level
andnode_address
members via existing functionality (RF24Network::multicast_level()
andRF24Network::begin()
respectively). The following psuedo-code might help to better describe my intentions hereThe text was updated successfully, but these errors were encountered: