-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thierry Thuon
committed
Nov 3, 2016
1 parent
1e4649e
commit ed1bec8
Showing
1 changed file
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
* @author Thierry Thuon <[email protected]> | ||
* @copyright MIT | ||
*/ | ||
class SerialPort | ||
class SerialPort | ||
{ | ||
/** | ||
* File descriptor | ||
|
@@ -85,7 +85,7 @@ public function open($device, $mode = "w+b") | |
* | ||
* @throws WriteNotAllowed|DeviceNotOpened | ||
*/ | ||
public function write($data) | ||
public function write($data) | ||
{ | ||
$this->ensureDeviceOpen(); | ||
|
||
|
@@ -112,6 +112,8 @@ public function read() | |
$chars[] = $char; | ||
} while ($char != $this->getParser()->getSeparator()); | ||
|
||
array_pop($chars); //ignore last char, it's the separator | ||
|
||
return $this->getParser()->parse($chars); | ||
} | ||
|
||
|