diff --git a/firmware/WIZ_Ethernet_Library-master/Arduino IDE 1.5.x/Ethernet/src/utility/w5500.cpp b/firmware/WIZ_Ethernet_Library-master/Arduino IDE 1.5.x/Ethernet/src/utility/w5500.cpp index b4d9c51..5e9ed78 100644 --- a/firmware/WIZ_Ethernet_Library-master/Arduino IDE 1.5.x/Ethernet/src/utility/w5500.cpp +++ b/firmware/WIZ_Ethernet_Library-master/Arduino IDE 1.5.x/Ethernet/src/utility/w5500.cpp @@ -39,6 +39,7 @@ write( 0x1E, cntl_byte, 2); //0x1E - Sn_RXBUF_SIZE write( 0x1F, cntl_byte, 2); //0x1F - Sn_TXBUF_SIZE } + setRetransmissionCount(4); } uint16_t W5500Class::getTXFreeSize(SOCKET s) diff --git a/firmware/core/core.ino b/firmware/core/core.ino index 4e85132..9a69903 100644 --- a/firmware/core/core.ino +++ b/firmware/core/core.ino @@ -124,6 +124,8 @@ void sendEventPacket(uint8_t eventType) { struct packet p; + if(!client.connected()) + return; p.characteristicAndVersion = PacketIdentifier; p.type = PacketTypeEvent; p.payloadSize = sizeof(eventPayload); @@ -133,6 +135,8 @@ void sendAuthPacket(uint8_t uidLen, uint8_t* uid) { + if(!client.connected()) + return; struct packet *p = (packet*)new char[sizeof(packet) + uidLen]; p->characteristicAndVersion = PacketIdentifier; p->type = PacketTypeRequest;