|
@ -121,8 +121,8 @@ def os_echo(filename, string): |
|
|
|
|
|
|
|
|
def send_keypress(): |
|
|
def send_keypress(): |
|
|
with open('/dev/hidg0', 'w') as f: |
|
|
with open('/dev/hidg0', 'w') as f: |
|
|
f.write("\x00\x00\x04\x00\x00\x00\x00\x00") #press the A-button |
|
|
f.write(bytearray(b'\x00\x00\x04\x00\x00\x00\x00\x00')) #press the A-button |
|
|
f.write("\x00\x00\x00\x00\x00\x00\x00\x00") #release all keys |
|
|
f.write(bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')) #release all keys |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
if __name__ == '__main__': |
|
@ -186,12 +186,12 @@ if __name__ == '__main__': |
|
|
os_echo(g+"functions/hid.usb0/protocol", "1") |
|
|
os_echo(g+"functions/hid.usb0/protocol", "1") |
|
|
os_echo(g+"functions/hid.usb0/subclass", "1") |
|
|
os_echo(g+"functions/hid.usb0/subclass", "1") |
|
|
os_echo(g+"functions/hid.usb0/report_length", "8") |
|
|
os_echo(g+"functions/hid.usb0/report_length", "8") |
|
|
os_echo(g+"functions/hid.usb0/report_desc", "\x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0") |
|
|
os_echo(g+"functions/hid.usb0/report_desc", bytearray(b'\x05\x01\x09\x06\xa1\x01\x05\x07\x19\xe0\x29\xe7\x15\x00\x25\x01\x75\x01\x95\x08\x81\x02\x95\x01\x75\x08\x81\x03\x95\x05\x75\x01\x05\x08\x19\x01\x29\x05\x91\x02\x95\x01\x75\x03\x91\x03\x95\x06\x75\x08\x15\x00\x25\x65\x05\x07\x19\x00\x29\x65\x81\x00\xc0').encode()) |
|
|
|
|
|
|
|
|
subprocess.run(['ln', '-s', g+"functions/hid.usb0", g+"configs/c.1"], shell=False, check=True) |
|
|
subprocess.run(['ln', '-s', g+"functions/hid.usb0", g+"configs/c.1"], shell=False, check=True) |
|
|
|
|
|
|
|
|
# subprocess.run(['ln', '-s', g+"configs/c.1", g+"os_desc"], shell=False, check=True) |
|
|
# subprocess.run(['ln', '-s', g+"configs/c.1", g+"os_desc"], shell=False, check=True) |
|
|
subprocess.run(['ls /sys/class/udc/ > '+g+'UDC'], shell=True, check=True) |
|
|
subprocess.run('ls /sys/class/udc/ > '+g+'UDC', shell=True, check=True) |
|
|
|
|
|
|
|
|
# RNDIS OS descriptors |
|
|
# RNDIS OS descriptors |
|
|
#os_echo(g+"os_desc/use", "1") |
|
|
#os_echo(g+"os_desc/use", "1") |
|
|