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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
44 - 36 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC