From 333d5f7afb7f424b8dee798c674ccdff90f66c01 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Fri, 10 May 2019 12:28:20 +0800 Subject: [PATCH] [spi-hdlc-adapter] reset NCP/RCP on exit (#3801) This commit triggers resetting NCP/RCP on exit, which ensures NCP/RCP get back to uninitialized state so that they will not respond to 15.4 messages. Note, host should disable soft reset by passing `--no-reset` for RCP. Thus OpenThread POSIX app doesn't need to reset RCP when it exits. --- tools/spi-hdlc-adapter/spi-hdlc-adapter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/spi-hdlc-adapter/spi-hdlc-adapter.c b/tools/spi-hdlc-adapter/spi-hdlc-adapter.c index 31a509dfc..79716c9af 100644 --- a/tools/spi-hdlc-adapter/spi-hdlc-adapter.c +++ b/tools/spi-hdlc-adapter/spi-hdlc-adapter.c @@ -1983,6 +1983,9 @@ int main(int argc, char *argv[]) bail: syslog(LOG_NOTICE, "Shutdown. (sRet = %d)", sRet); + syslog(LOG_NOTICE, "Reset NCP/RCP"); + trigger_reset(); + if (sRet == EXIT_QUIT) { sRet = EXIT_SUCCESS;