diff --git a/reference/dio/functions/dio-tcsetattr.xml b/reference/dio/functions/dio-tcsetattr.xml new file mode 100644 index 0000000000..e09a0e4c13 --- /dev/null +++ b/reference/dio/functions/dio-tcsetattr.xml @@ -0,0 +1,104 @@ + + + + + + dio_tcsetattr + + Sets terminal attributes and baud rate for a serial port + + + + Description + + dio_tcsetattr + resourcefd + arrayoptions + + + The function dio_tcsetattr sets + the terminal attributes and baud rate of the open + resource. The currently available options are + + + + '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 + + + + + 'bits' - data bits - can be 8,7,6 or 5 + default value is 8 + + + + + 'stop' - stop bits - can be 1 or 2 + default value is 1 + + + + + 'parity' - can be 0,1 or 2 + default value is 0 + + + + + + Setting the baud rate on a serial port + + + 9600, + 'bits' => 8, + 'stop' =>1, + 'parity' => 0 +)); + +while (1) { + + $data = dio_read($fd,256); + + if ($data) { + echo $data; + } +} + +?> +]]> + + + + + + + +