=================================================================================================================== HandleSerialHandshake() - handles the handshake with the serial port ===================================================================================================================
| 320 | // HandleSerialHandshake() - handles the handshake with the serial port |
| 321 | //=================================================================================================================== |
| 322 | uint8_t HandleSerialHandshake(RFM69& radio, uint16_t targetID, uint8_t isEOF, uint16_t TIMEOUT, uint16_t ACKTIMEOUT, uint8_t DEBUG) |
| 323 | { |
| 324 | long now = millis(); |
| 325 | |
| 326 | while (millis()-now<TIMEOUT) |
| 327 | { |
| 328 | if (radio.sendWithRetry(targetID, isEOF ? "FLX?EOF" : "FLX?", isEOF?7:4, 2,ACKTIMEOUT)) |
| 329 | if (radio.DATALEN >= 6 && radio.DATA[0]=='F' && radio.DATA[1]=='L' && radio.DATA[2]=='X' && radio.DATA[3]=='?') |
| 330 | return true; |
| 331 | } |
| 332 | |
| 333 | if (DEBUG) Serial.println(F("Handshake fail")); |
| 334 | return false; |
| 335 | } |
| 336 | |
| 337 | |
| 338 | //=================================================================================================================== |
no test coverage detected