Skip to content

Commit

Permalink
Remove separator
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Thuon committed Nov 3, 2016
1 parent 1e4649e commit ed1bec8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lepiaf/SerialPort/SerialPort.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @author Thierry Thuon <[email protected]>
* @copyright MIT
*/
class SerialPort
class SerialPort
{
/**
* File descriptor
Expand Down Expand Up @@ -85,7 +85,7 @@ public function open($device, $mode = "w+b")
*
* @throws WriteNotAllowed|DeviceNotOpened
*/
public function write($data)
public function write($data)
{
$this->ensureDeviceOpen();

Expand All @@ -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);
}

Expand Down

0 comments on commit ed1bec8

Please sign in to comment.