============================================================================= sendWithRetry() - overrides the base to allow increasing power when repeated ACK requests fail =============================================================================
| 143 | // sendWithRetry() - overrides the base to allow increasing power when repeated ACK requests fail |
| 144 | //============================================================================= |
| 145 | bool RFM69_ATC::sendWithRetry(uint16_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries, uint8_t retryWaitTime) { |
| 146 | uint32_t sentTime; |
| 147 | for (uint8_t i = 0; i <= retries; i++) { |
| 148 | send(toAddress, buffer, bufferSize, true); |
| 149 | sentTime = millis(); |
| 150 | uint8_t maxLevel = _isRFM69HW ? 23 : 31; |
| 151 | while (millis() - sentTime < retryWaitTime) |
| 152 | if (ACKReceived(toAddress)) return true; |
| 153 | if (_powerLevel < maxLevel) { |
| 154 | setPowerLevel(_powerLevel + _transmitLevelStep); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | return false; |
| 159 | } |
| 160 | |
| 161 | //============================================================================= |
| 162 | // receiveBegin() - need to clear out our flag before calling base class. |
nothing calls this directly
no outgoing calls
no test coverage detected