10#include <RHGenericDriver.h>
14#define RH_NRF51_MAX_PAYLOAD_LEN 254
26#define RH_NRF51_HEADER_LEN 7
30#define RH_NRF51_MAX_MESSAGE_LEN (RH_NRF51_MAX_PAYLOAD_LEN-RH_NRF51_HEADER_LEN)
34#define RH_NRF51_HAVE_ENCRYPTION 1
37#define RH_NRF51_MAX_ENCRYPTED_MESSAGE_LEN (27-4)
40#define RH_NRF51_ENCRYPTION_KEY_LENGTH 16
44#define RH_NRF51_AES_CCM_CNF_SIZE 33
211 bool send(
const uint8_t* data, uint8_t len);
246 bool recv(uint8_t* buf, uint8_t* len);
278 uint8_t _buf[RH_NRF51_MAX_PAYLOAD_LEN+1];
283#if RH_NRF51_HAVE_ENCRYPTION
289 uint8_t _scratch[RH_NRF51_MAX_PAYLOAD_LEN+1+16];
292 uint8_t _encryption_cnf[RH_NRF51_AES_CCM_CNF_SIZE];
Abstract base class for a RadioHead driver.
Definition RHGenericDriver.h:42
Send and receive unaddressed, unreliable datagrams by nRF51 and nRF52 compatible transceivers.
Definition RH_NRF51.h:127
uint8_t maxMessageLength()
bool setChannel(uint8_t channel)
void setModeTx()
Sets the radio in TX mode.
TransmitPower
Convenient values for setting transmitter power in setRF()
Definition RH_NRF51.h:140
@ TransmitPowerm8dBm
-8 dBm
Definition RH_NRF51.h:145
@ TransmitPowerm4dBm
-4 dBm
Definition RH_NRF51.h:144
@ TransmitPowerm12dBm
-12 dBm
Definition RH_NRF51.h:146
@ TransmitPower4dBm
4 dBm
Definition RH_NRF51.h:142
@ TransmitPowerm30dBm
-30 dBm
Definition RH_NRF51.h:149
@ TransmitPowerm20dBm
-20 dBm
Definition RH_NRF51.h:148
@ TransmitPower0dBm
0 dBm
Definition RH_NRF51.h:143
@ TransmitPowerm16dBm
-16 dBm
Definition RH_NRF51.h:147
DataRate
Defines convenient values for setting data rates in setRF()
Definition RH_NRF51.h:132
@ DataRate250kbps
250 kbps
Definition RH_NRF51.h:135
@ DataRate1Mbps
1 Mbps
Definition RH_NRF51.h:133
@ DataRate2Mbps
2 Mbps
Definition RH_NRF51.h:134
void validateRxBuf()
Examine the receive buffer to determine whether the message is for this node.
void setEncryptionKey(uint8_t *key=NULL)
bool setRF(DataRate data_rate, TransmitPower power)
void setModeRx()
Sets the radio in RX mode.
virtual bool waitPacketSent()
void clearRxBuf()
Clear our local receive buffer.
bool recv(uint8_t *buf, uint8_t *len)
bool setNetworkAddress(uint8_t *address, uint8_t len)
bool send(const uint8_t *data, uint8_t len)