mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 09:59:01 +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)
|
if (xmodemPacketForPhone.control == meshtastic_XModem_Control_NUL)
|
||||||
xmodemPacketForPhone = xModem.getForPhone();
|
xmodemPacketForPhone = xModem.getForPhone();
|
||||||
if (xmodemPacketForPhone.control != meshtastic_XModem_Control_NUL)
|
if (xmodemPacketForPhone.control != meshtastic_XModem_Control_NUL) {
|
||||||
|
xModem.resetForPhone();
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!packetForPhone)
|
if (!packetForPhone)
|
||||||
packetForPhone = service.getForPhone();
|
packetForPhone = service.getForPhone();
|
||||||
|
@ -74,6 +74,11 @@ meshtastic_XModem XModemAdapter::getForPhone()
|
|||||||
return xmodemStore;
|
return xmodemStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XModemAdapter::resetForPhone()
|
||||||
|
{
|
||||||
|
xmodemStore = meshtastic_XModem_init_zero;
|
||||||
|
}
|
||||||
|
|
||||||
void XModemAdapter::handlePacket(meshtastic_XModem xmodemPacket)
|
void XModemAdapter::handlePacket(meshtastic_XModem xmodemPacket)
|
||||||
{
|
{
|
||||||
switch (xmodemPacket.control) {
|
switch (xmodemPacket.control) {
|
||||||
|
@ -48,6 +48,7 @@ class XModemAdapter
|
|||||||
|
|
||||||
void handlePacket(meshtastic_XModem xmodemPacket);
|
void handlePacket(meshtastic_XModem xmodemPacket);
|
||||||
meshtastic_XModem getForPhone();
|
meshtastic_XModem getForPhone();
|
||||||
|
void resetForPhone();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isReceiving = false;
|
bool isReceiving = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user