pi-as-keyboard
pi-as-keyboard copied to clipboard
Can I use this for System Sleep, Wakeup?
How can I test for echo command "system sleep" and "system wake up"?
1 Generic Desktop 0x82 System Sleep 0x83 System Wake Up
Please help me.
Hi,
Sorry for the delay. You had to create a script like :
#!/bin/bash
echo -ne "\x00\x00\x82\x00\x00\x00\x00\x00" > /dev/hidg0
echo -ne "\x00\x00\x00\x00\x00\x00\x00\x00" > /dev/hidg0
I don't have my pi with me right now. But I guess you got the idea. Let me know if you want me to test.
PS : Run as root
Thanks for your reply. I think that it's not doing exactly. Because your hid descriptor set as keyboard(Usage 7 : Keyboard). at the usage keyboard, code 82 means "Keyboard Locking Caps Lock"
System Sleep and wake up is at the Usage 80 : System Control. So I try to make a new hid descriptor and try to send byte. But it's not easy to me.
Reference : https://www.freebsddiary.org/APC/usb_hid_usages.php