document.addEventListener('DOMContentLoaded', async () => {
let permissionsRequestButton = document.getElementById("switch");
permissionsRequestButton.addEventListener("click", () => {
navigator.hid.requestDevice({
filters: [{ vendorId: 0x1a86, productId: 0xe041 }]
}).then((devices) =>{
devices[0].open().then(() => {
const wValue = new Uint8Array([
0x55, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
]);
devices[0].sendReport(0, wValue).then(() => {
console.log("Sent output report: "+ wValue);
}).catch(err => {
console.log(err + " " + wValue)
})
})
});
});
});
I guess I only really need the one USBHID SET_REPORT
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.