| 327 | } |
| 328 | |
| 329 | void RFM69::send(uint16_t toAddress, const void* buffer, uint8_t bufferSize, bool requestACK) { |
| 330 | writeReg(REG_PACKETCONFIG2, (readReg(REG_PACKETCONFIG2) & 0xFB) | RF_PACKET2_RXRESTART); // avoid RX deadlocks |
| 331 | uint32_t now = millis(); |
| 332 | while (!canSend() && millis() - now < RF69_CSMA_LIMIT_MS){ |
| 333 | receiveDone(); |
| 334 | #ifdef ESP8266 |
| 335 | delay(1); // Give esp8266-based boards to handle background tasks. Seems to work better than yield(); |
| 336 | #endif |
| 337 | } |
| 338 | sendFrame(toAddress, buffer, bufferSize, requestACK, false); |
| 339 | } |
| 340 | |
| 341 | // to increase the chance of getting a packet across, call this function instead of send |
| 342 | // and it handles all the ACK requesting/retrying for you :) |
no outgoing calls
no test coverage detected