mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-26 22:33:24 +00:00
Merge pull request #2192 from meshtastic/xmodem-fix
tryfix: also clear the second buffer.
This commit is contained in:
commit
76022b65c6
@ -378,8 +378,10 @@ bool PhoneAPI::available()
|
||||
|
||||
if (xmodemPacketForPhone.control == meshtastic_XModem_Control_NUL)
|
||||
xmodemPacketForPhone = xModem.getForPhone();
|
||||
if (xmodemPacketForPhone.control != meshtastic_XModem_Control_NUL)
|
||||
if (xmodemPacketForPhone.control != meshtastic_XModem_Control_NUL) {
|
||||
xModem.resetForPhone();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!packetForPhone)
|
||||
packetForPhone = service.getForPhone();
|
||||
|
@ -74,6 +74,11 @@ meshtastic_XModem XModemAdapter::getForPhone()
|
||||
return xmodemStore;
|
||||
}
|
||||
|
||||
void XModemAdapter::resetForPhone()
|
||||
{
|
||||
xmodemStore = meshtastic_XModem_init_zero;
|
||||
}
|
||||
|
||||
void XModemAdapter::handlePacket(meshtastic_XModem xmodemPacket)
|
||||
{
|
||||
switch (xmodemPacket.control) {
|
||||
|
@ -48,6 +48,7 @@ class XModemAdapter
|
||||
|
||||
void handlePacket(meshtastic_XModem xmodemPacket);
|
||||
meshtastic_XModem getForPhone();
|
||||
void resetForPhone();
|
||||
|
||||
private:
|
||||
bool isReceiving = false;
|
||||
|
Loading…
Reference in New Issue
Block a user