MCPcopy Create free account
hub / github.com/tiny-pilot/tinypilot / _write_to_hid_interface_immediately

Function _write_to_hid_interface_immediately

app/hid/write.py:16–23  ·  view source on GitHub ↗
(hid_path, buffer)

Source from the content-addressed store, hash-verified

14
15
16def _write_to_hid_interface_immediately(hid_path, buffer):
17 try:
18 with open(hid_path, 'ab+') as hid_handle:
19 hid_handle.write(bytearray(buffer))
20 except BlockingIOError:
21 logger.error(
22 'Failed to write to HID interface: %s. Is USB cable connected?',
23 hid_path)
24
25
26def write_to_hid_interface(hid_path, buffer):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected