From 5f740ab2fe6aad3dce4efee1358d0746dd7a3a4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 13:11:18 -0700 Subject: [PATCH] Bump the rf24-submodules group across 1 directory with 3 updates (#75) * Bump the rf24-submodules group across 1 directory with 3 updates Bumps the rf24-submodules group with 3 updates in the / directory: [RF24](https://github.com/nRF24/RF24), [RF24Network](https://github.com/nRF24/RF24Network) and [RF24Mesh](https://github.com/nRF24/RF24Mesh). Updates `RF24` from `0aac3d5` to `bbffb50` - [Release notes](https://github.com/nRF24/RF24/releases) - [Commits](https://github.com/nRF24/RF24/compare/0aac3d58e54c10d4adef351366217577456b6f50...bbffb50aec19fcccca0e0373398eb9ad34c1be85) Updates `RF24Network` from `219d055` to `bdd05ae` - [Release notes](https://github.com/nRF24/RF24Network/releases) - [Commits](https://github.com/nRF24/RF24Network/compare/219d055dfc50c48b88a973e040594ddc6cd040c2...bdd05ae6b8180ebcb8d34dd932a68b60688105a2) Updates `RF24Mesh` from `8f030b4` to `2f5aea2` - [Release notes](https://github.com/nRF24/RF24Mesh/releases) - [Commits](https://github.com/nRF24/RF24Mesh/compare/8f030b4e57248a9636d87135db02989823193ee5...2f5aea2f334dc6894ea3ad1c45de45dfc9dffdc2) --- updated-dependencies: - dependency-name: RF24 dependency-type: direct:production dependency-group: rf24-submodules - dependency-name: RF24Network dependency-type: direct:production dependency-group: rf24-submodules - dependency-name: RF24Mesh dependency-type: direct:production dependency-group: rf24-submodules ... Signed-off-by: dependabot[bot] * expose binding for new releaseAddress() overload For master nodes only * [CMake] add support for new flags - support RF24MESH_CONN_CHECK_TYPE flag - support MESH_CONNECTION_CHECK_ATTEMPTS flag also reviewed using_flags.cmake script --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brendan <2bndy5@gmail.com> --- RF24 | 2 +- RF24Mesh | 2 +- RF24Network | 2 +- cmake/using_flags.cmake | 58 +++++++++++++++++++++++++++-------------- src/pyRF24Mesh.cpp | 41 ++++++++++++++++++++++++----- src/pyrf24/pyrf24.pyi | 6 +++++ 6 files changed, 83 insertions(+), 28 deletions(-) diff --git a/RF24 b/RF24 index 0aac3d5..bbffb50 160000 --- a/RF24 +++ b/RF24 @@ -1 +1 @@ -Subproject commit 0aac3d58e54c10d4adef351366217577456b6f50 +Subproject commit bbffb50aec19fcccca0e0373398eb9ad34c1be85 diff --git a/RF24Mesh b/RF24Mesh index 8f030b4..2f5aea2 160000 --- a/RF24Mesh +++ b/RF24Mesh @@ -1 +1 @@ -Subproject commit 8f030b4e57248a9636d87135db02989823193ee5 +Subproject commit 2f5aea2f334dc6894ea3ad1c45de45dfc9dffdc2 diff --git a/RF24Network b/RF24Network index 219d055..bdd05ae 160000 --- a/RF24Network +++ b/RF24Network @@ -1 +1 @@ -Subproject commit 219d055dfc50c48b88a973e040594ddc6cd040c2 +Subproject commit bdd05ae6b8180ebcb8d34dd932a68b60688105a2 diff --git a/cmake/using_flags.cmake b/cmake/using_flags.cmake index 3d31207..cd7dc83 100644 --- a/cmake/using_flags.cmake +++ b/cmake/using_flags.cmake @@ -38,6 +38,16 @@ option(RF24MESH_DEBUG_MINIMAL "enable/disable minimal debugging output for RF24M # ### options with default values: +# RF24MESH_CONN_CHECK_TYPE +# This can be used to control how RF24Mesh.check_connection() behaves. +# By default, check_connection() will simply ping the parent node (if any). +# Setting this to RF24MESH_CONN_CHECK_MASTER will resort to the old behavior +# which verified the assigned address with the master node. +# It is recommended that this be left as default for large mesh networks. + +# MESH_CONNECTION_CHECK_ATTEMPTS +# the number of attempts to check_connection() with the mesh. Defaults to 3 + # MESH_MAX_CHILDREN # This can be used to prevent mesh child nodes from occupying all available pipes on network layers. # Only recommended if combining RF24Network nodes w/ RF24Mesh nodes on the same network. @@ -65,8 +75,8 @@ option(RF24MESH_DEBUG_MINIMAL "enable/disable minimal debugging output for RF24M function(apply_flags target) # apply RF24 flags to cpp_rf24 target if(RF24_DEBUG) - message(STATUS "RF24_DEBUG asserted for ${target}") - target_compile_definitions(${target} PUBLIC SERIAL_DEBUG) + message(STATUS "RF24_DEBUG asserted") + target_compile_definitions(${target} PUBLIC RF24_DEBUG) endif() # pass driver used to expose as a constant in rf24 module. @@ -74,90 +84,100 @@ function(apply_flags target) # apply RF24Network flags to cpp_rf24_network target if(RF24NETWORK_DEBUG) - message(STATUS "RF24NETWORK_DEBUG asserted for ${target}") + message(STATUS "RF24NETWORK_DEBUG asserted") target_compile_definitions(${target} PUBLIC RF24NETWORK_DEBUG) endif() if(RF24NETWORK_DEBUG_MINIMAL) - message(STATUS "RF24NETWORK_DEBUG_MINIMAL asserted for ${target}") + message(STATUS "RF24NETWORK_DEBUG_MINIMAL asserted") target_compile_definitions(${target} PUBLIC RF24NETWORK_DEBUG_MINIMAL) endif() if(RF24NETWORK_DEBUG_ROUTING) - message(STATUS "RF24NETWORK_DEBUG_ROUTING asserted for ${target}") + message(STATUS "RF24NETWORK_DEBUG_ROUTING asserted") target_compile_definitions(${target} PUBLIC RF24NETWORK_DEBUG_ROUTING) endif() if(RF24NETWORK_DEBUG_FRAGMENTATION) - message(STATUS "RF24NETWORK_DEBUG_FRAGMENTATION asserted for ${target}") + message(STATUS "RF24NETWORK_DEBUG_FRAGMENTATION asserted") target_compile_definitions(${target} PUBLIC RF24NETWORK_DEBUG_FRAGMENTATION) endif() if(RF24NETWORK_DEBUG_FRAGMENTATION_L2) - message(STATUS "RF24NETWORK_DEBUG_FRAGMENTATION_L2 asserted for ${target}") + message(STATUS "RF24NETWORK_DEBUG_FRAGMENTATION_L2 asserted") target_compile_definitions(${target} PUBLIC RF24NETWORK_DEBUG_FRAGMENTATION_L2) endif() if(DISABLE_FRAGMENTATION) - message(STATUS "DISABLE_FRAGMENTATION asserted for ${target}") + message(STATUS "DISABLE_FRAGMENTATION asserted") target_compile_definitions(${target} PUBLIC DISABLE_FRAGMENTATION) endif() # for MAX_PAYLOAD_SIZE, we let the default be configured in source code if(DEFINED MAX_PAYLOAD_SIZE) # don't use CMake's `option()` for this one - message(STATUS "MAX_PAYLOAD_SIZE set to ${MAX_PAYLOAD_SIZE} for ${target}") + message(STATUS "MAX_PAYLOAD_SIZE set to ${MAX_PAYLOAD_SIZE}") target_compile_definitions(${target} PUBLIC MAX_PAYLOAD_SIZE=${MAX_PAYLOAD_SIZE}) endif() if(DEFINED SLOW_ADDR_POLL_RESPONSE) - message(STATUS "SLOW_ADDR_POLL_RESPONSE set to ${SLOW_ADDR_POLL_RESPONSE} for ${target}") + message(STATUS "SLOW_ADDR_POLL_RESPONSE set to ${SLOW_ADDR_POLL_RESPONSE}") target_compile_definitions(${target} PUBLIC SLOW_ADDR_POLL_RESPONSE=${SLOW_ADDR_POLL_RESPONSE}) endif() # apply RF24Mesh flags to cpp_rf24_mesh target if(MESH_NOMASTER) - message(STATUS "MESH_NOMASTER asserted for ${target}") + message(STATUS "MESH_NOMASTER asserted") target_compile_definitions(${target} PUBLIC MESH_NOMASTER) endif() if(RF24MESH_DEBUG) - message(STATUS "RF24MESH_DEBUG asserted for ${target}") + message(STATUS "RF24MESH_DEBUG asserted") target_compile_definitions(${target} PUBLIC RF24MESH_DEBUG) endif() if(RF24MESH_DEBUG_MINIMAL) - message(STATUS "RF24MESH_DEBUG_MINIMAL asserted for ${target}") + message(STATUS "RF24MESH_DEBUG_MINIMAL asserted") target_compile_definitions(${target} PUBLIC RF24MESH_DEBUG_MINIMAL) endif() # for the following, we let the default be configured in source code if(DEFINED MESH_MAX_CHILDREN) - message(STATUS "MESH_MAX_CHILDREN set to ${MESH_MAX_CHILDREN} for ${target}") + message(STATUS "MESH_MAX_CHILDREN set to ${MESH_MAX_CHILDREN}") target_compile_definitions(${target} PUBLIC MESH_MAX_CHILDREN=${MESH_MAX_CHILDREN}) endif() if(DEFINED MESH_DEFAULT_CHANNEL) - message(STATUS "MESH_DEFAULT_CHANNEL set to ${MESH_DEFAULT_CHANNEL} for ${target}") + message(STATUS "MESH_DEFAULT_CHANNEL set to ${MESH_DEFAULT_CHANNEL}") target_compile_definitions(${target} PUBLIC MESH_DEFAULT_CHANNEL=${MESH_DEFAULT_CHANNEL}) endif() if(DEFINED MESH_RENEWAL_TIMEOUT) - message(STATUS "MESH_RENEWAL_TIMEOUT set to ${MESH_RENEWAL_TIMEOUT} for ${target}") + message(STATUS "MESH_RENEWAL_TIMEOUT set to ${MESH_RENEWAL_TIMEOUT}") target_compile_definitions(${target} PUBLIC MESH_RENEWAL_TIMEOUT=${MESH_RENEWAL_TIMEOUT}) endif() if(DEFINED MESH_MEM_ALLOC_SIZE) - message(STATUS "MESH_MEM_ALLOC_SIZE set to ${MESH_MEM_ALLOC_SIZE} for ${target}") + message(STATUS "MESH_MEM_ALLOC_SIZE set to ${MESH_MEM_ALLOC_SIZE}") target_compile_definitions(${target} PUBLIC MESH_MEM_ALLOC_SIZE=${MESH_MEM_ALLOC_SIZE}) endif() if(DEFINED MESH_LOOKUP_TIMEOUT) - message(STATUS "MESH_LOOKUP_TIMEOUT set to ${MESH_LOOKUP_TIMEOUT} for ${target}") + message(STATUS "MESH_LOOKUP_TIMEOUT set to ${MESH_LOOKUP_TIMEOUT}") target_compile_definitions(${target} PUBLIC MESH_LOOKUP_TIMEOUT=${MESH_LOOKUP_TIMEOUT}) endif() if(DEFINED MESH_WRITE_TIMEOUT) - message(STATUS "MESH_WRITE_TIMEOUT set to ${MESH_WRITE_TIMEOUT} for ${target}") + message(STATUS "MESH_WRITE_TIMEOUT set to ${MESH_WRITE_TIMEOUT}") target_compile_definitions(${target} PUBLIC MESH_WRITE_TIMEOUT=${MESH_WRITE_TIMEOUT}) endif() + + if(DEFINED RF24MESH_CONN_CHECK_TYPE) + message(STATUS "RF24MESH_CONN_CHECK_TYPE set to &{RF24MESH_CONN_CHECK_TYPE}") + target_compile_definitions(${target} PUBLIC RF24MESH_CONN_CHECK_TYPE=${RF24MESH_CONN_CHECK_TYPE}) + endif() + + if(DEFINED MESH_CONNECTION_CHECK_ATTEMPTS) + message(STATUS "MESH_CONNECTION_CHECK_ATTEMPTS set to &{MESH_CONNECTION_CHECK_ATTEMPTS}") + target_compile_definitions(${target} PUBLIC MESH_CONNECTION_CHECK_ATTEMPTS=${MESH_CONNECTION_CHECK_ATTEMPTS}) + endif() endfunction() diff --git a/src/pyRF24Mesh.cpp b/src/pyRF24Mesh.cpp index 3979b10..47370f4 100644 --- a/src/pyRF24Mesh.cpp +++ b/src/pyRF24Mesh.cpp @@ -281,22 +281,51 @@ void init_rf24mesh(py::module& m) // ***************************************************************************** - .def("release_address", &RF24MeshWrapper::releaseAddress, R"docstr( - release_address() -> bool + .def("release_address", static_cast(&RF24MeshWrapper::releaseAddress), R"docstr( + release_address() -> bool \ + release_address(address: int) -> bool - Use this function to manually expire a leased `Logical Address ` from the mesh network's master node. + Use this function from a child node (without a parameter) to manually expire a leased `Logical Address ` + from the mesh network's master node. .. tip:: This function allows re-use of the assigned address for other mesh network nodes. Call this function from mesh network nodes that are going offline (or to sleep). - :Returns: `True` if the mesh network's master node received the request to de-allocate - the assigned address. `False` means the wireless transaction did not complete. + :Returns: + - `True` if the mesh network's master node received the request to de-allocate + the assigned address. + - `False` means the wireless transaction did not complete. )docstr") - .def("releaseAddress", &RF24MeshWrapper::releaseAddress, R"docstr( + .def("releaseAddress", static_cast(&RF24MeshWrapper::releaseAddress), R"docstr( releaseAddress() -> bool )docstr") + // ***************************************************************************** +#ifndef MESH_NOMASTER + + .def("release_address", static_cast(&RF24MeshWrapper::releaseAddress), R"docstr( + When called from the master node, this function takes a parameter and returns + without using wireless transactions. + + .. hint:: + This overloaded function signature is specific to master nodes, + so network administrators can manage assigned `Logical Addresses ` + without notifying the nodes that might be appropriating them. + + :param address: The `Logical Address ` to release from any mesh node. + :Returns: + - `True` if successfully released the specified ``address``. + - `False` if the specified ``address`` was not assigned to any child node. + )docstr", + py::arg("address")) + + .def("releaseAddress", static_cast(&RF24MeshWrapper::releaseAddress), R"docstr( + releaseAddress(address: int) -> bool + )docstr", + py::arg("address")) + +#endif // ***************************************************************************** .def("get_address", &RF24MeshWrapper::getAddress, R"docstr( diff --git a/src/pyrf24/pyrf24.pyi b/src/pyrf24/pyrf24.pyi index 5f8428c..17789e3 100644 --- a/src/pyrf24/pyrf24.pyi +++ b/src/pyrf24/pyrf24.pyi @@ -424,8 +424,14 @@ class RF24Mesh: def setNodeID(self) -> None: ... def get_node_id(self, address: int) -> int: ... def getNodeID(self, address: int) -> int: ... + @overload def release_address(self) -> bool: ... + @overload + def release_address(self, address: int) -> bool: ... + @overload def releaseAddress(self) -> bool: ... + @overload + def releaseAddress(self, address: int) -> bool: ... def renew_address(self, timeout: int = 7500) -> int: ... def renewAddress(self, timeout: int = 7500) -> int: ... def set_channel(self, channel: int) -> None: ...