projects
/
elmcan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c53e125
)
Improve error handling in case of stray characters
author
norly
<ny-git@enpas.org>
Thu, 10 Feb 2022 20:39:25 +0000
(21:39 +0100)
committer
norly
<ny-git@enpas.org>
Thu, 10 Feb 2022 22:03:43 +0000
(23:03 +0100)
module/elmcan.c
patch
|
blob
|
history
diff --git
a/module/elmcan.c
b/module/elmcan.c
index c1e665e722c62ff378c017c0ff7f1f61a4daf519..49df7c1600ca993703e97811f3f5227d8822095f 100644
(file)
--- a/
module/elmcan.c
+++ b/
module/elmcan.c
@@
-396,8
+396,11
@@
static void elm327_parse_error(struct elmcan *elm, int len)
}
break;
default:
- /* Don't emit an error frame if we're unsure */
- return;
+ /* Something else has happened.
+ * Maybe garbage on the UART line.
+ * Emit a generic error frame.
+ */
+ break;
}
elm327_feed_frame_to_netdev(elm, &frame);
@@
-451,7
+454,6
@@
static int elm327_parse_frame(struct elmcan *elm, int len)
/* The line is likely garbled anyway, so bail.
* The main code will restart listening.
*/
- elm327_kick_into_cmd_mode(elm);
return -ENODATA;
}