Fix printer state error (#12681)

This commit is contained in:
Tony Murray
2021-03-30 15:26:01 -05:00
committed by GitHub
parent f84591a1c7
commit 2b6b8df4b5

View File

@@ -1624,6 +1624,12 @@ function q_bridge_bits2indices($hex_data)
* ie. '9a00' -> '100110100000' -> array(1, 4, 5, 7)
*/
$hex_data = str_replace(' ', '', $hex_data);
// we need an even number of digits for hex2bin
if (strlen($hex_data) % 2 === 1) {
$hex_data = '0' . $hex_data;
}
$value = hex2bin($hex_data);
$length = strlen($value);
$indices = [];