Open GoogleCodeExporter opened 8 years ago
# I reworked the code above as indicated by the changes below. I did this
# after seeing an updated example in the change log.
# With the changes below (which only change the code above beginning with do{
# and ending with $hex = (string)...)
# -- I am still not capturing all the data from the serial port.
function microtime_float(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
do{
$read = '';
$theResult = '';
$start = microtime_float();
while ( ($read == '') && (microtime_float() <= $start + 0.5) ) {
$read = $serial->readPort();
if ($read != '') {
$theResult .= $read;
$read = '';
}
}
# $line = $serial->readPort();
$hex = (string)"";
if($theResult){
//unpack() gives me an array. Then because it's hex, I need to typecast
//it to string, otherwise I'll have a very big number!
$hex .= (string)join("", unpack("H*", $theResult));
#Continue with no more changes.
Original comment by sec...@gmail.com
on 14 Jun 2010 at 5:58
Have you had any luck with this? I am very interested because the plmtools that
I used to use to connect with the PLM no longer seem to work since I upgraded
to Fedora 13.
Original comment by ccata...@cox.net
on 11 Oct 2010 at 5:18
I had issue with my serial port configuration, specifically that special
characters were allowed and ending the communication. Try "-isig -icanon" stty
flags.
Original comment by cnm3...@gmail.com
on 19 Apr 2011 at 9:53
With regard to my previous comment, this was only needed for linux, haven't
checked OSX, and they werent required for windows.
Original comment by cnm3...@gmail.com
on 20 Apr 2011 at 9:09
Original issue reported on code.google.com by
sec...@gmail.com
on 14 Jun 2010 at 5:38