php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58488 argument 2 of dio_tcsetattr doesn't accept a variable
Submitted: 2009-01-04 07:33 UTC Modified: 2009-01-18 12:57 UTC
From: romain dot dessort at gmail dot com Assigned:
Status: Not a bug Package: dio (PECL)
PHP Version: 5.2.5 OS: Debian 4.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: romain dot dessort at gmail dot com
New email:
PHP Version: OS:

 

 [2009-01-04 07:33 UTC] romain dot dessort at gmail dot com
Description:
------------
When I run the example of PHP documentation
(http://fr2.php.net/manual/en/function.dio-tcsetattr.php), all is OK.
But when replace the baud rate value (9600) by a variable containing the
same value, I have a php warning :

Warning: dio_tcsetattr() [function.dio-tcsetattr]: invalid baud rate 0 in
/var/www/lampes.php on line 34

I verified by an "echo $var;", this variable isn't equal to 0 !

This is the same problem with the other attributes (bit, stop and parity).

Reproduce code:
---------------
...
$SPEED=9600;
echo $SPEED;

$fd = dio_open("/dev/ttyS0" , O_WRONLY | O_NOCTTY | O_NONBLOCK);
dio_tcsetattr($fd , array('baud' => $SPEED, 'bit' => 8 , 'stop' => 1 , 'parity' => 0));
...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-18 12:57 UTC] romain dot dessort at gmail dot com
So I have rewrite this code in an empty file, and it works ! I think there were some hidden characters in the hold file.

Sorry for this bogus bug.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 03 21:01:24 2020 UTC