From f0ad73ff8fe391d2aac4bc437128618647d46b4f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 25 Jun 2019 12:02:33 +0200 Subject: Nrf24: dynamic payload size and dynamic acks --- include/driver/nrf24l01.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/driver/nrf24l01.h b/include/driver/nrf24l01.h index 44f8205..82297bd 100644 --- a/include/driver/nrf24l01.h +++ b/include/driver/nrf24l01.h @@ -265,6 +265,30 @@ public: * are enabled. See the datasheet for details. */ void toggleFeatures(void); + + /** + * Enable dynamically-sized payloads + * + * This way you don't always have to send large packets just to send them + * once in a while. This enables dynamic payloads on ALL pipes. + * + */ + void enableDynamicPayloads(void); + + /** + * Enable dynamic ACKs (single write multicast or unicast) for chosen messages + * + * @note To enable full multicast or per-pipe multicast, use setAutoAck() + * + * @warning This MUST be called prior to attempting single write NOACK calls + * @code + * radio.enableDynamicAck(); + * radio.write(&data,32,1); // Sends a payload with no acknowledgement requested + * radio.write(&data,32,0); // Sends a payload using auto-retry/autoACK + * @endcode + */ + void enableDynamicAck(); + /** * Be sure to call openWritingPipe() first to set the destination * of where to write to. @@ -288,7 +312,7 @@ public: * @endcode * @return True if the payload was delivered successfully false if not */ - uint8_t write(const void *buf, uint8_t len, bool blocking); + uint8_t write(const void *buf, uint8_t len, bool await_ack, bool blocking); /** * Start listening on the pipes opened for reading. -- cgit v1.2.3