From b05db0bcf54094a29569286005d6d61488980c26 Mon Sep 17 00:00:00 2001 From: Steinarr134 Date: Sat, 23 Sep 2017 13:35:57 +0000 Subject: [PATCH] uint8_t retryWaitTime changed to uint16_t I have a node that is busy with i2c communication so it won't respond to radio communication right away. The application isn't time sensitive so I don't mind waiting a second for it to respond but wasn't able to increase the wait time above 255 --- RFM69.cpp | 2 +- RFM69.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RFM69.cpp b/RFM69.cpp index 5097069..6824fd1 100644 --- a/RFM69.cpp +++ b/RFM69.cpp @@ -226,7 +226,7 @@ void RFM69::send(uint8_t toAddress, const void* buffer, uint8_t bufferSize, bool // The reason for the semi-automaton is that the lib is interrupt driven and // requires user action to read the received data and decide what to do with it // replies usually take only 5..8ms at 50kbps@915MHz -bool RFM69::sendWithRetry(uint8_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries, uint8_t retryWaitTime) { +bool RFM69::sendWithRetry(uint8_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries, uint16_t retryWaitTime) { uint32_t sentTime; for (uint8_t i = 0; i <= retries; i++) { diff --git a/RFM69.h b/RFM69.h index d60d1df..7663fe2 100644 --- a/RFM69.h +++ b/RFM69.h @@ -100,7 +100,7 @@ class RFM69 { void setNetwork(uint8_t networkID); bool canSend(); virtual void send(uint8_t toAddress, const void* buffer, uint8_t bufferSize, bool requestACK=false); - virtual bool sendWithRetry(uint8_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries=2, uint8_t retryWaitTime=40); // 40ms roundtrip req for 61byte packets + virtual bool sendWithRetry(uint8_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries=2, uint16_t retryWaitTime=40); // 40ms roundtrip req for 61byte packets virtual bool receiveDone(); bool ACKReceived(uint8_t fromNodeID); bool ACKRequested();