Skip to content

Add WebSerial support and align SLCAN parsing behavior#387

Open
maksimdrachov wants to merge 14 commits into
masterfrom
web-interface
Open

Add WebSerial support and align SLCAN parsing behavior#387
maksimdrachov wants to merge 14 commits into
masterfrom
web-interface

Conversation

@maksimdrachov

@maksimdrachov maksimdrachov commented Jun 15, 2026

Copy link
Copy Markdown
Member

Adds browser-oriented WebSerial support for CAN-over-SLCAN and incorporates reviewer-requested protocol adjustments.

Implemented updates include:

  • Replacing Protocol with an explicit ABC for the async serial port contract in webserial.py.
  • Making WebSerialSLCANInterface.filter() a no-op (no software filtering where no hardware filtering exists).
  • Updating WebSerialSLCANInterface.__repr__() formatting as requested.
  • Undoing prior edits to src/pycyphal2/can/__init__.py.
  • Expanding _slcan.py parser behavior to remain compatible with the requested pydronecan superset expectations, including accepted frame forms and permissive timestamp-tail handling, while preserving robust malformed-input dropping semantics.
  • Updating CAN SLCAN/WebSerial tests accordingly.

@pavel-kirienko pavel-kirienko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot address my comments

Comment thread src/pycyphal2/can/__init__.py
Comment thread src/pycyphal2/can/_slcan.py
Comment thread src/pycyphal2/can/webserial.py Outdated
Comment thread src/pycyphal2/can/webserial.py Outdated
Comment thread src/pycyphal2/can/webserial.py Outdated
@pavel-kirienko

Copy link
Copy Markdown
Member

@copilot address my comments above

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot address my comments

Addressed in commit afdac20.

Copilot AI changed the title Add support for WebSerial Add WebSerial support and align SLCAN parsing behavior Jun 16, 2026
Copilot AI requested a review from pavel-kirienko June 16, 2026 11:09

@pavel-kirienko pavel-kirienko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maksimdrachov The webserial driver needs to set up the SLCAN channel during initialization with the specified CAN bitrate. To initialize the channel we need to send C (to close) and then O (to reopen). See how it's done in https://github.com/dronecan/pydronecan/blob/master/dronecan/driver/slcan.py

@maksimdrachov

Copy link
Copy Markdown
Member Author

Let me know if this is too sloppy, I'm not sure if I should feel bad for commiting 100% AI-written code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants