Skip to content

Commit 96a9dc0

Browse files
One sec UDP echotests pause in case of no memory or device busy status.
This gives possibility of freeing memory and mesh device recover from busy state.
1 parent 91464b2 commit 96a9dc0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

TESTS/netsocket/udp/udpsocket_echotest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ void UDPSOCKET_ECHOTEST_impl(bool use_sendto)
9494
} else {
9595
sent = sock.send(tx_buffer, pkt_s);
9696
}
97+
if (sent == NSAPI_ERROR_NO_MEMORY) {
98+
ThisThread::sleep_for(1000);
99+
}
97100
if (check_oversized_packets(sent, pkt_s)) {
98101
TEST_IGNORE_MESSAGE("This device does not handle oversized packets");
99102
} else if (sent == pkt_s) {

TESTS/netsocket/udp/udpsocket_sendto_repeat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void UDPSOCKET_SENDTO_REPEAT()
4141
bool oom_earlier = false; // 2 times in a row -> time to give up
4242
for (i = 0; i < 100; i++) {
4343
sent = sock.sendto(udp_addr, tx_buffer, sizeof(tx_buffer));
44-
if (sent == NSAPI_ERROR_NO_MEMORY) {
44+
if (sent == NSAPI_ERROR_NO_MEMORY || sent == NSAPI_ERROR_BUSY) {
4545
if (oom_earlier) {
4646
break;
4747
}

0 commit comments

Comments
 (0)