Skip to content

Commit 4684fef

Browse files
committed
cmcumgr retry
1 parent 8d2f5e4 commit 4684fef

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--- a/src/cli/cli_opts.c
2+
+++ b/src/cli/cli_opts.c
3+
@@ -543,7 +543,7 @@ int parse_cli_options(int argc, char *co
4+
copts->argv = argv;
5+
opterr = 0;
6+
copts->prgname = argv[0];
7+
- copts->timeout = 3;
8+
+ copts->timeout = 1;
9+
10+
return parse_mcumgr_options(copts);
11+
}
12+
--- a/src/mcumgr-client/commands/cmd_common.c
13+
+++ b/src/mcumgr-client/commands/cmd_common.c
14+
@@ -19,6 +19,9 @@ int cmd_run(struct smp_transport *transp
15+
rc = transport->ops->write(transport, buf, reqsz);
16+
17+
/* TODO: try reconnecting ?*/
18+
+ if (rc == -ETIMEDOUT) {
19+
+ continue;
20+
+ }
21+
if (rc < 0) {
22+
return rc;
23+
}
24+
--- a/src/mcumgr-client/transport/serial/smp_serial.c
25+
+++ b/src/mcumgr-client/transport/serial/smp_serial.c
26+
@@ -362,7 +362,7 @@ static int serial_transport_read(struct
27+
DBG("Read: maxlen: %zu\n", maxlen);
28+
29+
now = time_get();
30+
- end_time = now + tmo + 2;
31+
+ end_time = now + tmo;
32+
33+
while (1) {
34+
/* read no more than buffers allow, and never more than one frame data

0 commit comments

Comments
 (0)