MCPcopy Create free account
hub / github.com/LowPowerLab/RFM69 / sendWithRetry

Method sendWithRetry

RFM69_ATC.cpp:145–159  ·  view source on GitHub ↗

============================================================================= sendWithRetry() - overrides the base to allow increasing power when repeated ACK requests fail =============================================================================

Source from the content-addressed store, hash-verified

143// sendWithRetry() - overrides the base to allow increasing power when repeated ACK requests fail
144//=============================================================================
145bool 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected