diff --git a/RF24Mesh.cpp b/RF24Mesh.cpp index 6bae0bf..1312b1f 100644 --- a/RF24Mesh.cpp +++ b/RF24Mesh.cpp @@ -33,6 +33,7 @@ bool ESBMesh::begin(uint8_t channel, rf24_datarate_e data_ra if (!radio.begin()) return 0; radio.setChannel(channel); + meshChannel = channel; radio.setDataRate(data_rate); network.returnSysMsgs = true; @@ -258,6 +259,7 @@ template void ESBMesh::beginDefault() { radio.stopListening(); + radio.setChannel(meshChannel); network.begin(MESH_DEFAULT_ADDRESS); mesh_address = MESH_DEFAULT_ADDRESS; } @@ -398,6 +400,7 @@ bool ESBMesh::requestAddress(uint8_t level) mesh_address = newAddress; radio.stopListening(); + radio.setChannel(meshChannel); network.begin(mesh_address); // getNodeID() doesn't use auto-ack; do a double-check to manually retry 1 more time diff --git a/RF24Mesh.h b/RF24Mesh.h index 1df1305..0d1f3b2 100644 --- a/RF24Mesh.h +++ b/RF24Mesh.h @@ -367,6 +367,7 @@ class ESBMesh bool meshStarted; /** Returns the number of octal digits in the specified address. */ uint8_t getLevel(uint16_t address); + uint8_t meshChannel; }; /**