Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app-shell,usb-bridge): improve flex usb communication #14170

Merged
merged 7 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
lint
  • Loading branch information
sfoster1 committed Dec 12, 2023
commit da67885f21ba5024496eff7963305b945111dc3a
2 changes: 2 additions & 0 deletions usb-bridge/node-client/src/usb-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ export function createSerialPortListMonitor(
class SerialPortSocket extends SerialPort {
// added these to squash keepAlive errors
setKeepAlive(): void {}

unref(): SerialPortSocket {
return this
}

setTimeout(): void {}

ref(): SerialPortSocket {
Expand Down
1 change: 0 additions & 1 deletion usb-bridge/ot3usb/serial_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
return
while sent < len(data):
try:
sent += serial.write(data[sent : min(sent + packet_limit, len(data))])

Check warning on line 25 in usb-bridge/ot3usb/serial_thread.py

View check run for this annotation

Codecov / codecov/patch

usb-bridge/ot3usb/serial_thread.py#L25

Added line #L25 was not covered by tests
except Exception as e:
# Any exception means we need to quit
print(f"Failed to write: {e}")
Expand All @@ -36,7 +36,7 @@
def _worker(queue: QUEUE_TYPE, packet_limit: int) -> None:
while True:
ser, data = queue.get()
_try_write_all_data(ser, data, packet_limit)

Check warning on line 39 in usb-bridge/ot3usb/serial_thread.py

View check run for this annotation

Codecov / codecov/patch

usb-bridge/ot3usb/serial_thread.py#L39

Added line #L39 was not covered by tests


def create_worker_thread(
Expand All @@ -49,7 +49,6 @@
may be required to allow clients to process data in time, since many desktop
OS serial drivers do not have very large data buffers.
"""

queue: QUEUE_TYPE = Queue(QUEUE_MAX_ITEMS)
thread = threading.Thread(
target=_worker,
Expand Down
Loading