dio_tcsetattr

(PHP 4 >= 4.3.0, PECL)

dio_tcsetattr --  Sets terminal attributes and baud rate for a serial port

Description

void dio_tcsetattr ( resource fd, array options )

The function dio_tcsetattr() sets the terminal attributes and baud rate of the open resource. The currently available options are

Przykład 1. Setting the baud rate on a serial port

<?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;
  }
}

?>

Notatka: Ta funkcja nie jest dostępna na platformie Windows.

Hosting by: Hurra Communications Sp. z o.o.
Generated: 2007-01-26 18:02:25