Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

dio tcsetattr function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php dio tcsetattr () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 4 >= 4.3.0, PHP 5)

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

Syntax

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

  • '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.

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

?>

Note: This function is not implemented on Windows platforms.

Php dio tcsetattr Function syntax tag

dio tcsetattr php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php dio tcsetattr syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online