Skip to content

Commit

Permalink
expose addrList in python
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jun 20, 2024
1 parent d0d8251 commit ab487cc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pyRF24Mesh/pyRF24Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(renewAddress_overload, RF24Mesh::renewAdd
// ******************** RF24Mesh exposed **************************
BOOST_PYTHON_MODULE(RF24Mesh)
{
{ //::RF24Mesh
{

// ::RF24Mesh::addrListStruct
bp::class_<RF24Mesh::addrListStruct>("addrListStruct", bp::init<>())
.def_readonly("nodeID", &RF24Mesh::addrListStruct::nodeID)
.def_readwrite("address", &RF24Mesh::addrListStruct::address);

//::RF24Mesh
bp::class_<RF24Mesh>("RF24Mesh", bp::init<RF24&, RF24Network&>((bp::arg("_radio"), bp::arg("_network"))))
//bool begin(uint8_t channel = MESH_DEFAULT_CHANNEL, rf24_datarate_e data_rate = RF24_1MBPS, uint32_t timeout=MESH_RENEWAL_TIMEOUT );
.def("begin", &RF24Mesh::begin, begin_overload(bp::args("channel", "data_rate", "timeout")))
Expand Down Expand Up @@ -106,6 +113,8 @@ BOOST_PYTHON_MODULE(RF24Mesh)
.def("loadDHCP", &RF24Mesh::loadDHCP)
// mesh_address
.def_readwrite("mesh_address", &RF24Mesh::mesh_address)
.def_readonly("addrListTop", &RF24Mesh::addrListTop)
.def_readonly("addrList", &RF24Mesh::addrList)
//void setStaticAddress(uint8_t nodeID, uint16_t address);
.def("setStaticAddress", &RF24Mesh::setStaticAddress, (bp::arg("nodeID"), bp::arg("address")));
}
Expand Down

0 comments on commit ab487cc

Please sign in to comment.