void RFM70::setMode(uint8_t mode) { if (mode) { setModeRX(); } else { setModeTX(); } }
// if length is greater than 32 bytes, then buff will be splitted into 32-bytes long packets TransmitResult send(const uint8_t *buff, const size_t &length, bool requestAck) { if (getMode() != MODE_PTX) { setModeTX(); } return internalSend(buff, length, requestAck); }
// if length is greater than 32 bytes, then buff will be splitted into 32-bytes long packets TransmitResult send(const uint32_t &targetAddress, const uint8_t *buff, const size_t &length, bool requestAck) { if (getMode() != MODE_PTX) { setModeTX(); } uint8_t adr[5]; memcpy(adr, &targetAddress, 4); adr[4] = 0; configTxPipe(adr, TX_DPL); return internalSend(buff, length, requestAck); }