Skip to content

Commit

Permalink
fix(qrcode): fix bematech qrcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Francimar Alves committed Aug 21, 2023
1 parent b1ad506 commit 78874e0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Thermal/Profile/Bematech.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function qrcode($data, $size)
$len = strlen($data) + 3;
$pL = $len & 0xFF;
$pH = ($len >> 8) & 0xFF;

$error = 2; // N1 Error correction level 0 - L, 1 - M, 2 - Q, 3 - H
$size = min(11, max(1, $size ?: 4)) * 2; // N2 - MSB; 0 = default = 4
$version = 0; // N3 - Version QRCode
Expand All @@ -77,8 +77,6 @@ public function qrcode($data, $size)
$this->getConnection()->write(chr($error) . chr($size) . chr($version) . chr($encoding));
$this->getConnection()->write(chr($pL) . chr($pH)); // N5 e N6 - Length
$this->getConnection()->write($data); // Data
$this->getConnection()->write("\x00");
$this->feed(1);
}

protected function fontChanged($new_font, $old_font)
Expand Down
Binary file modified tests/resources/qrcode_MP-4200_TH.bin
Binary file not shown.
Binary file modified tests/resources/qrcode_bematech.bin
Binary file not shown.

0 comments on commit 78874e0

Please sign in to comment.