Skip to content

Commit 7639ae5

Browse files
SyverHaraldsenrlubos
authored andcommitted
net: downloader: coap: Fix retransmission logic
retransmission logic in the CoAP downloader was not correctly implemented, causing it to not retransmit requests as expected. Signed-off-by: Syver Haraldsen <[email protected]>
1 parent 7f89e06 commit 7639ae5

File tree

1 file changed

+9
-0
lines changed
  • subsys/net/lib/downloader/src/transports

1 file changed

+9
-0
lines changed

subsys/net/lib/downloader/src/transports/coap.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ struct transport_params_coap {
7272

7373
BUILD_ASSERT(CONFIG_DOWNLOADER_TRANSPORT_PARAMS_SIZE >= sizeof(struct transport_params_coap));
7474

75+
static int coap_request_send(struct downloader *dl);
76+
7577
static int coap_get_current_from_response_pkt(const struct coap_packet *cpkt)
7678
{
7779
int block = 0;
@@ -136,6 +138,7 @@ static int coap_get_recv_timeout(struct downloader *dl, uint32_t *timeout)
136138
int coap_initiate_retransmission(struct downloader *dl)
137139
{
138140
struct transport_params_coap *coap;
141+
int ret;
139142

140143
coap = (struct transport_params_coap *)dl->transport_internal;
141144

@@ -148,6 +151,12 @@ int coap_initiate_retransmission(struct downloader *dl)
148151
return -1;
149152
}
150153

154+
ret = coap_request_send(dl);
155+
if (ret) {
156+
LOG_DBG("coap_request_send failed, err %d", ret);
157+
return -ECONNRESET;
158+
}
159+
151160
return 0;
152161
}
153162

0 commit comments

Comments
 (0)