[riot-notifications] [RIOT-OS/RIOT] sys/suit: initial support for SUIT firmware updates (#11818)

Francisco notifications at github.com
Mon Sep 30 15:11:06 CEST 2019


fjmolinas commented on this pull request.



> +    ssize_t res;
+    size_t pdu_len = (pkt->payload - (uint8_t *)pkt->hdr) + pkt->payload_len;
+    uint8_t *buf = (uint8_t*)pkt->hdr;
+
+    /* TODO: timeout random between between ACK_TIMEOUT and (ACK_TIMEOUT *
+     * ACK_RANDOM_FACTOR) */
+    uint32_t timeout = COAP_ACK_TIMEOUT * US_PER_SEC;
+    unsigned tries_left = COAP_MAX_RETRANSMIT + 1;  /* add 1 for initial transmit */
+    while (tries_left) {
+
+        res = sock_udp_send(sock, buf, pdu_len, NULL);
+        if (res <= 0) {
+            DEBUG("nanocoap: error sending coap request, %d\n", (int)res);
+            break;
+        }
+

I edited the code suggestion, I had removed the send part :) (still I haven't actually tested the code, consider it pseudocode)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11818#discussion_r329567177
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190930/340558bb/attachment.htm>


More information about the notifications mailing list