============================================================================= sendAck() - updated to call new sendFrame with additional parameters ============================================================================= should be called immediately after reception in case sender wants ACK
| 49 | //============================================================================= |
| 50 | // should be called immediately after reception in case sender wants ACK |
| 51 | void RFM69_ATC::sendACK(const void* buffer, uint8_t bufferSize) { |
| 52 | ACK_REQUESTED = 0; // TomWS1 added to make sure we don't end up in a timing race and infinite loop sending Acks |
| 53 | uint16_t sender = SENDERID; |
| 54 | int16_t _RSSI = RSSI; // save payload received RSSI value |
| 55 | bool sendRSSI = ACK_RSSI_REQUESTED; |
| 56 | writeReg(REG_PACKETCONFIG2, (readReg(REG_PACKETCONFIG2) & 0xFB) | RF_PACKET2_RXRESTART); // avoid RX deadlocks |
| 57 | uint32_t now = millis(); |
| 58 | while (!canSend() && millis() - now < RF69_CSMA_LIMIT_MS) receiveDone(); |
| 59 | SENDERID = sender; // TomWS1: Restore SenderID after it gets wiped out by receiveDone() |
| 60 | sendFrame(sender, buffer, bufferSize, false, true, sendRSSI, _RSSI); // TomWS1: Special override on sendFrame with extra params |
| 61 | RSSI = _RSSI; // restore payload RSSI |
| 62 | } |
| 63 | |
| 64 | //============================================================================= |
| 65 | // sendFrame() - the basic version is used to match the RFM69 prototype so we can extend it |
nothing calls this directly
no outgoing calls
no test coverage detected