Created
April 30, 2020 20:07
-
-
Save Vzor-/4453cdd57f3b7978e88cc69a4383eab4 to your computer and use it in GitHub Desktop.
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
async function sendHidData() { | |
printData = '\x0d\x0a\x50\x52\x49\x4e\x54\x45\x44\x20\x57\x49\x54\x48\x20\x51\x5a\x20\x54\x52\x41\x59\x0d\x0a\x0d\x0a\x55\x53\x49\x4e\x47\x20\x68\x65\x78\x20\x43\x4f\x4d\x4d\x41\x4e\x44\x53\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0a'; | |
await qz.hid.sendData({ | |
vendorId: $("#hidVendor").val(), | |
productId: $("#hidProduct").val(), | |
usagePage: $("#hidUsagePage").val(), | |
serial: $("#hidSerial").val(), | |
data: printData.substring(0, 32), | |
endpoint: $("#hidReport").val() | |
}) | |
await qz.hid.sendData({ | |
vendorId: $("#hidVendor").val(), | |
productId: $("#hidProduct").val(), | |
usagePage: $("#hidUsagePage").val(), | |
serial: $("#hidSerial").val(), | |
data: printData.substring(32, printData.length), | |
endpoint: $("#hidReport").val() | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment