25#define MESH_ADDR_LOOKUP 196
26#define MESH_ADDR_RELEASE 197
27#define MESH_ID_LOOKUP 198
29#define MESH_BLANK_ID 65535
31#if defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny84__)
37#if defined(__linux) && !defined(__ARDUINO_X86__) && !defined(USE_RF24_LIB_SRC)
38 #include <RF24/RF24.h>
39 #include <RF24Network/RF24Network.h>
43 #include <RF24Network.h>
44 #if defined(ARDUINO_ARCH_NRF52) || defined(ARDUINO_ARCH_NRF52840)
45 #include <nrf_to_nrf.h>
53#if defined(ARDUINO_ARCH_NRF52) || defined(ARDUINO_ARCH_NRF52840) || defined(ARDUINO_ARCH_NRF52833)
57template<
class radio_t>
70template<
class network_t = ESBNetwork<RF24>,
class radio_t = RF24>
100 ESBMesh(radio_t& _radio, network_t& _network);
135 bool write(
const void* data, uint8_t msg_type,
size_t size, uint8_t nodeID = 0);
162#if !defined(MESH_NOMASTER)
231 bool write(uint16_t to_node,
const void* data, uint8_t msg_type,
size_t size);
260#define MESH_CALLBACK \
261 if (meshCallback) meshCallback();
283 void setAddress(uint8_t nodeID, uint16_t address,
bool searchBy =
false);
285#if !defined(MESH_NOMASTER)
323#if !defined(MESH_NOMASTER)
373 void (*meshCallback)(void);
376 bool requestAddress(uint8_t level);
378#if !defined(MESH_NOMASTER)
382 bool addrMemAllocated;
390 uint8_t getLevel(uint16_t address);
406#if defined(ARDUINO_ARCH_NRF52) || defined(ARDUINO_ARCH_NRF52840) || defined(ARDUINO_ARCH_NRF52833)
ESBMesh< ESBNetwork< RF24 >, RF24 > RF24Mesh
#define MESH_DEFAULT_CHANNEL
Radio channel to operate on 1-127.
#define MESH_RENEWAL_TIMEOUT
How long to attempt address renewal in milliseconds.
int16_t getNodeID(uint16_t address=MESH_BLANK_ID)
void setStaticAddress(uint8_t nodeID, uint16_t address)
uint16_t renewAddress(uint32_t timeout=MESH_RENEWAL_TIMEOUT)
Reconnect to the mesh and renew the current RF24Network address.
void setChild(bool allow)
bool begin(uint8_t channel=MESH_DEFAULT_CHANNEL, rf24_datarate_e data_rate=RF24_1MBPS, uint32_t timeout=MESH_RENEWAL_TIMEOUT)
void setCallback(void(*meshCallback)(void))
uint8_t addrListTop
The number of entries in the addrListStruct of assigned addresses.
ESBMesh(radio_t &_radio, network_t &_network)
addrListStruct * addrList
A array of addrListStruct elements for assigned addresses.
void setNodeID(uint8_t nodeID)
bool write(const void *data, uint8_t msg_type, size_t size, uint8_t nodeID=0)
void setChannel(uint8_t _channel)
void setAddress(uint8_t nodeID, uint16_t address, bool searchBy=false)
int16_t getAddress(uint8_t nodeID)
Convert a nodeID into an RF24Network address.
A struct for storing a nodeID and an address in a single element of the ESBMesh::addrList array.
uint8_t nodeID
The nodeID of an network node (child)
uint16_t address
The logical address of an network node (child)