Skip to content

Instantly share code, notes, and snippets.

@Vzor-
Created April 30, 2020 20:03
Show Gist options
  • Save Vzor-/086ba3bf7418705871e66e72c46ee1a0 to your computer and use it in GitHub Desktop.
Save Vzor-/086ba3bf7418705871e66e72c46ee1a0 to your computer and use it in GitHub Desktop.
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';
qz.hid.sendData({
vendorId: $("#hidVendor").val(),
productId: $("#hidProduct").val(),
usagePage: $("#hidUsagePage").val(),
serial: $("#hidSerial").val(),
data: printData.substring(0, 32),
endpoint: $("#hidReport").val()
})
.then(qz.hid.sendData({
vendorId: $("#hidVendor").val(),
productId: $("#hidProduct").val(),
usagePage: $("#hidUsagePage").val(),
serial: $("#hidSerial").val(),
data: printData.substring(32, printData.length),
endpoint: $("#hidReport").val()
})).catch(displayError);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment