1 | <?php |
||
19 | class Serial implements ConnectorInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var PhpSerial |
||
23 | */ |
||
24 | protected $resource; |
||
25 | /** |
||
26 | * @var bool |
||
27 | */ |
||
28 | protected $deviceStatus = false; |
||
29 | |||
30 | /** |
||
31 | * Construct |
||
32 | * Set and open serial device |
||
33 | * @param string $device |
||
34 | * @param int $baudRate |
||
35 | * @param int $byteSize |
||
36 | * @param string $parity |
||
37 | * @param int $stopbits |
||
38 | * @param string $flowctrl |
||
39 | */ |
||
40 | public function __construct( |
||
58 | |||
59 | /** |
||
60 | * End class |
||
61 | */ |
||
62 | public function __destruct() |
||
66 | |||
67 | |||
68 | /** |
||
69 | * Finalize printer connection |
||
70 | */ |
||
71 | public function close() |
||
75 | |||
76 | /** |
||
77 | * send data to printer |
||
78 | * @param string $data |
||
79 | */ |
||
80 | public function write($data) |
||
85 | |||
86 | /** |
||
87 | * Read serial port |
||
88 | * @param int $len |
||
89 | * @return string |
||
90 | */ |
||
91 | public function read($len = 0) |
||
95 | } |
||
96 |