mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 14:28:56 +00:00

still using this, after discussion on the phpdoc list. From now on, manual.ced will need to be found at ~/.phpdoc/manual.ced. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288721 c90b9560-bf6c-de11-be94-00142212c4b1
135 lines
3.1 KiB
XML
135 lines
3.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.dio-tcsetattr" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>dio_tcsetattr</refname>
|
|
<refpurpose>
|
|
Sets terminal attributes and baud rate for a serial port
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>dio_tcsetattr</methodname>
|
|
<methodparam><type>resource</type><parameter>fd</parameter></methodparam>
|
|
<methodparam><type>array</type><parameter>options</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>dio_tcsetattr</function> sets the terminal attributes and baud
|
|
rate of the open <parameter>fd</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>fd</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The file descriptor returned by <function>dio_open</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>options</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The currently available options are:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<para>
|
|
'baud' - baud rate of the port - can be 38400,19200,9600,4800,2400,1800,
|
|
1200,600,300,200,150,134,110,75 or 50, default value is 9600.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
'bits' - data bits - can be 8,7,6 or 5. Default value is 8.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
'stop' - stop bits - can be 1 or 2. Default value is 1.
|
|
</para>
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
'parity' - can be 0,1 or 2. Default value is 0.
|
|
</para>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.void;
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Setting the baud rate on a serial port</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$fd = dio_open('/dev/ttyS0', O_RDWR | O_NOCTTY | O_NONBLOCK);
|
|
|
|
dio_fcntl($fd, F_SETFL, O_SYNC);
|
|
|
|
dio_tcsetattr($fd, array(
|
|
'baud' => 9600,
|
|
'bits' => 8,
|
|
'stop' => 1,
|
|
'parity' => 0
|
|
));
|
|
|
|
while (1) {
|
|
|
|
$data = dio_read($fd, 256);
|
|
|
|
if ($data) {
|
|
echo $data;
|
|
}
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.no-windows;
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|