-
Notifications
You must be signed in to change notification settings - Fork 153
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
expose releaseAddress() for master node #244
Conversation
59bf9f7
to
5691179
Compare
.def("releaseAddress", &RF24Mesh::releaseAddress) | ||
.def("releaseAddress", (bool(RF24Mesh::*)()) & RF24Mesh::releaseAddress) | ||
#ifndef MESH_NO_MASTER | ||
//bool releaseAddress(uint16_t address); | ||
.def("releaseAddress", (bool(RF24Mesh::*)(uint16_t)) & RF24Mesh::releaseAddress, (bp::args("address"))) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to test this in the python wrapper (on a master and a child) to ensure I did this correctly. I know it compiles, but that doesn't indicate expected runtime behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work as expected on master nodes and child nodes. However, I'm noticing problems with the overloads for getNodeId()
and renewAddress()
in the python wrapper.
These py bindings also don't expose the RF24Mesh::addrList
& friends. So py users have no way of checking the assigned addresses on master nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bindings for getNodeID()
and renewAddress()
are fixed now.
I gave up on exposing RF24Mesh::addrList
because boost.python needs to understand how to convert the returned addrListStruct*
array into a python list (or tuple) of wrapped addrListStruct
objects.
FYI, all of this is already done in pyrf24 package, and the get/setAddress()
with the new overloaded releaseAddress(uint16_t address)
can be used as a limited alternative. So, I'm not too concerned about perusing this further.
@@ -288,6 +284,22 @@ bool ESBMesh<network_t, radio_t>::releaseAddress() | |||
|
|||
/*****************************************************/ | |||
|
|||
#ifndef MESH_NO_MASTER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized this should be spelled MESH_NOMASTER
. I'll submit a commit to master to fix this.
This backports #244 to v1.x. I could not cherry pick the changes because there was a conflict of function declarations (about the use of templates in v2.x).
resolves #219