mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 07:07:47 +00:00
[cli] emit SIGINT on ctrl-c (#4502)
This commit emits SIGINT on ctrl-c so that gdb can work as expected.
This commit is contained in:
@@ -36,6 +36,10 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if OPENTHREAD_POSIX
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <openthread/cli.h>
|
||||
#include <openthread/platform/logging.h>
|
||||
@@ -156,6 +160,10 @@ void Uart::ReceiveTask(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
#if !OPENTHREAD_CONFIG_UART_CLI_RAW
|
||||
#if OPENTHREAD_POSIX
|
||||
|
||||
case 0x03: // ASCII for Ctrl-C
|
||||
kill(0, SIGINT);
|
||||
break;
|
||||
|
||||
case 0x04: // ASCII for Ctrl-D
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user