[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs: send break on serial port
From: |
Cédric Chépied |
Subject: |
Re: emacs: send break on serial port |
Date: |
Tue, 10 Jun 2014 13:13:43 +0200 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/24.3 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
At Tue, 10 Jun 2014 11:05:02 +0200,
Andreas Schwab wrote:
> process-send-break would be a better name.
bf9d1518e58f8ffb2f009ad958a6e30f2037cd3f HEAD master
Author: Cédric Chépied <address@hidden>
Date: Tue Jun 10 09:17:31 2014 +0200
Add a function to send a break via serial process
This is useful to use sysrq keys
1 file changed, 19 insertions(+)
src/process.c | 19 +++++++++++++++++++
Modified src/process.c
diff --git a/src/process.c b/src/process.c
index b8b8eaa..e1eea88 100644
--- a/src/process.c
+++ b/src/process.c
@@ -844,6 +844,24 @@ record_deleted_pid (pid_t pid, Lisp_Object filename)
}
+DEFUN ("process-send-break", Fprocess_send_break, Sprocess_send_break, 1, 1, 0,
+ doc: /* Send a break to the serial process PROCESS.
+PROCESS may be a process, a buffer, the name of a process or buffer, or
+nil, indicating the current buffer's process. */)
+ (register Lisp_Object process)
+{
+ register struct Lisp_Process *p;
+
+ process = get_process (process);
+ p = XPROCESS (process);
+
+ if (SERIALCONN1_P (p) && p->outfd >= 0)
+ ioctl(p->outfd, TCSBRK, 0);
+
+ return Qnil;
+}
+
+
DEFUN ("delete-process", Fdelete_process, Sdelete_process, 1, 1, 0,
doc: /* Delete PROCESS: kill it and forget about it immediately.
PROCESS may be a process, a buffer, the name of a process or buffer, or
@@ -7320,6 +7338,7 @@ The variable takes effect when `start-process' is called.
*/);
defsubr (&Sprocessp);
defsubr (&Sget_process);
+ defsubr (&Sprocess_send_break);
defsubr (&Sdelete_process);
defsubr (&Sprocess_status);
defsubr (&Sprocess_exit_status);
Regards,
--
Cédric Chépied
<address@hidden>