diff --git a/ESP32_AP-Flasher/src/serialap.cpp b/ESP32_AP-Flasher/src/serialap.cpp index 1ad2b71b..f435a716 100644 --- a/ESP32_AP-Flasher/src/serialap.cpp +++ b/ESP32_AP-Flasher/src/serialap.cpp @@ -180,7 +180,8 @@ void APTagReset() { // Send data to the AP uint16_t sendBlock(const void* data, const uint16_t len) { time_t timeCanary = millis(); - if (!apInfo.isOnline) return false; + if(apInfo.state == AP_STATE_NORADIO)return true; + if (!apInfo.isOnline) return false; if (!txStart()) return 0; // don't retry now, as it collides with communication from the tag for (uint8_t attempt = 0; attempt < 1; attempt++) { @@ -248,6 +249,7 @@ blksend: } bool sendDataAvail(struct pendingData* pending) { + if(apInfo.state == AP_STATE_NORADIO)return true; if (!apInfo.isOnline) return false; if (!txStart()) return false; addCRC(pending, sizeof(struct pendingData)); @@ -269,6 +271,7 @@ bool sendDataAvail(struct pendingData* pending) { return false; } bool sendCancelPending(struct pendingData* pending) { + if(apInfo.state == AP_STATE_NORADIO)return true; if (!apInfo.isOnline) return false; if (!txStart()) return false; addCRC(pending, sizeof(struct pendingData)); @@ -289,6 +292,7 @@ bool sendCancelPending(struct pendingData* pending) { return false; } bool sendChannelPower(struct espSetChannelPower* scp) { + if(apInfo.state == AP_STATE_NORADIO)return true; if ((apInfo.state != AP_STATE_ONLINE) && (apInfo.state != AP_STATE_COMING_ONLINE)) return false; if (!txStart()) return false; addCRC(scp, sizeof(struct espSetChannelPower)); @@ -311,6 +315,7 @@ bool sendChannelPower(struct espSetChannelPower* scp) { return false; } bool sendPing() { + if(apInfo.state == AP_STATE_NORADIO)return true; if (apInfo.state == AP_STATE_FLASHING) return false; Serial.print("ping"); int t = millis(); @@ -329,6 +334,7 @@ bool sendPing() { return false; } bool sendGetInfo() { + if(apInfo.state == AP_STATE_NORADIO)return true; if (!txStart()) return false; for (uint8_t attempt = 0; attempt < 5; attempt++) { cmdReplyValue = CMD_REPLY_WAIT; @@ -342,6 +348,7 @@ bool sendGetInfo() { return false; } bool sendHighspeed() { + if(apInfo.state == AP_STATE_NORADIO)return true; if (!txStart()) return false; for (uint8_t attempt = 0; attempt < 5; attempt++) { cmdReplyValue = CMD_REPLY_WAIT; @@ -738,6 +745,7 @@ void segmentedShowIp() { } bool bringAPOnline() { + if(apInfo.state == AP_STATE_NORADIO)return true; if (apInfo.state == AP_STATE_FLASHING) return false; setAPstate(false, AP_STATE_OFFLINE); // try without rebooting