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

expose releaseAddress() for master node #244

Merged
merged 8 commits into from
Jun 20, 2024
Merged

Conversation

2bndy5
Copy link
Member

@2bndy5 2bndy5 commented Jun 18, 2024

resolves #219

github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions bot dismissed their stale review June 18, 2024 10:16

outdated suggestion

github-actions[bot]

This comment was marked as resolved.

@github-actions github-actions bot dismissed their stale review June 18, 2024 13:13

outdated suggestion

github-actions[bot]

This comment was marked as resolved.

@github-actions github-actions bot dismissed their stale review June 18, 2024 13:16

outdated suggestion

RF24Mesh.h Outdated Show resolved Hide resolved
Comment on lines -90 to +94
.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
Copy link
Member Author

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.

Copy link
Member Author

@2bndy5 2bndy5 Jun 20, 2024

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.

Copy link
Member Author

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.

@2bndy5 2bndy5 merged commit dc29068 into master Jun 20, 2024
21 checks passed
@2bndy5 2bndy5 deleted the master-release-address branch June 20, 2024 11:53
@@ -288,6 +284,22 @@ bool ESBMesh<network_t, radio_t>::releaseAddress()

/*****************************************************/

#ifndef MESH_NO_MASTER
Copy link
Member Author

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.

2bndy5 added a commit that referenced this pull request Jun 20, 2024
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).
2bndy5 added a commit that referenced this pull request Jun 20, 2024
2bndy5 added a commit to nRF24/CircuitPython_nRF24L01 that referenced this pull request Jun 20, 2024
2bndy5 added a commit that referenced this pull request Jun 21, 2024
2bndy5 added a commit to nRF24/CircuitPython_nRF24L01 that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add releaseAddress() overload for use on master nodes
2 participants