make-serial-process
make-serial-process is a built-in function in `C source code
'.
(make-serial-process &rest ARGS)
Create and return a serial port process.
In Emacs, serial port connections are represented by process objects,
so input and output work as for subprocesses, and `delete-process'
closes a serial port connection. However, a serial process has no
process id, it cannot be signaled, and the status codes are different
from normal processes.
`make-serial-process' creates a process and a buffer, on which you
probably want to use `process-send-string'. Try M-x serial-term for
an interactive terminal. See below for examples.
Arguments are specified as keyword/argument pairs. The following
arguments are defined:
:port PORT -- (mandatory) PORT is the path or name of the serial port.
For example, this could be "/dev/ttyS0" on Unix. On Windows, this
could be "COM1", or "\\.\COM10" for ports higher than COM9 (double
the backslashes in strings).
:speed SPEED -- (mandatory) is handled by `serial-process-configure',
which this function calls.
:name NAME -- NAME is the name of the process. If NAME is not given,
the value of PORT is used.
:buffer BUFFER -- BUFFER is the buffer (or buffer-name) to associate
with the process. Process output goes at the end of that buffer,
unless you specify an output stream or filter function to handle the
output. If BUFFER is not given, the value of NAME is used.
:coding CODING -- If CODING is a symbol, it specifies the coding
system used for both reading and writing for this process. If CODING
is a cons (DECODING . ENCODING), DECODING is used for reading, and
ENCODING is used for writing.
:noquery BOOL -- When exiting Emacs, query the user if BOOL is nil and
the process is running. If BOOL is not given, query before exiting.
:stop BOOL -- Start process in the `stopped' state if BOOL is non-nil.
In the stopped state, a serial process does not accept incoming data,
but you can send outgoing data. The stopped state is cleared by
`continue-process' and set by `stop-process'.
:filter FILTER -- Install FILTER as the process filter.
:sentinel SENTINEL -- Install SENTINEL as the process sentinel.
:plist PLIST -- Install PLIST as the initial plist of the process.
:bytesize
:parity
:stopbits
:flowcontrol
-- This function calls `serial-process-configure' to handle these
arguments.
The original argument list, possibly modified by later configuration,
is available via the function `process-contact'.
Examples:
(make-serial-process :port "/dev/ttyS0" :speed 9600
)
(make-serial-process :port "COM1" :speed 115200 :stopbits 2)
(make-serial-process :port "\\.\COM13" :speed 1200 :bytesize 7 :parity 'odd)
(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" :speed nil)