note 74497 rejected from function.fgetc by bjori
| From: | bjori@php.net | Date: | Sat, 14 Apr 2007 09:53:02 +0000 |
| Subject: | note 74497 rejected from function.fgetc by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125391@lists.php.net to get a copy of this message | ||
Note Submitter: stephend at sdcomp dot com
----
Trying to read from a serial port but it just stops when i do a fgetc().
Any ideas?
$relay = fopen("/dev/ttyUSB0", "r+");
fwrite($relay, chr(254) . chr(8) . chr(2) . chr(1));
print "Reading Data\n";
$contents = fgetc($relay);
print "Received: $contents\n";
Code excution stops at $contents = fgetc($relay)
And never continues!