feat(serial-transport): USB Serial#332
Closed
hakueon wants to merge 9 commits into
Closed
Conversation
Introduce design documents for a new USB Serial transport extension on scratch-link 2.x. SerialTransport.md describes the server side: a /scratch/serial JSON-RPC endpoint on ws://localhost:20111, targeting CH340 (VID 0x1A86 / PID 0x7523) on Windows first via System.IO.Ports.SerialPort and WMI-based VID/PID enumeration. scratch-link-fork-plan.md is the aluxcoding-scratch client-side counterpart aligned to the same wire contract. Uses Serial-specific RPC vocabulary (serialDidReceiveData, serialDidDisconnect, startReading/stopReading) so callers cannot confuse Serial events with BLE or BT events. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the BLE/BT session pattern with a /scratch/serial JSON-RPC endpoint. CH340 (VID 0x1A86 / PID 0x7523) is first-class via WMI-based VID/PID enumeration; other CDC devices work through the same path with appropriate discovery filters. Why a separate listener port (20211): this fork is meant to coexist with the stock scratch-link on user machines (e.g. existing Scratch 3.0 users), so the default 20110/20111 cannot be reused. Why sync SerialPort.Read on a Task-Run thread instead of BaseStream.ReadAsync: .NET 6's SerialStream does not override the async read overloads in a way that survives CH340's open-time DTR/RTS toggling; the first ReadAsync reliably throws ERROR_OPERATION_ABORTED even with the cancellation token unbound. Synchronous Read with a 500ms ReadTimeout + TimeoutException-as-loop-tick matches the working test_cs reference and lets shutdown be observed via the CTS. DtrEnable/RtsEnable are pinned low explicitly because some firmware (codetinker on CH340) treats DTR/RTS transitions as reset signals. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sets fork identity across assembly/package metadata, manifests, tray UI, and icon assets so users can distinguish this binary from the stock scratch-link they may have installed in parallel (see the port 20211 split in the Serial transport commit). ScratchVersion.targets gains a floor of 1.0.0 when GitInfo finds no semver tag, so an untagged build ships as "Alux Scratch Link 1.0.0.x" instead of "0.0.x". Real releases are still cut by tagging. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SerialTransport.md and scratch-link-fork-plan.md moved to a sibling documents/ folder outside this repo so the fork's design notes can be edited alongside the related client-side work without churning this tree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
UpgradeLog*.htm, _UpgradeReport_Files/, and Backup*/ are produced by VS's project upgrade flow and are IDE-local — they should not enter the repo when someone happens to open the solution after a toolchain bump. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds brand/alux-l.svg as the source of truth for app/tray/MSIX icons, plus brand/build_icons.py to regenerate them. Generated files are already committed; the script only needs to run when the SVG changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Rebrands the title and removes upstream-only content (macOS/Safari, semantic-release, CFBundle notes). Adds a fork notice with the AGPL-3.0 attribution to scratchfoundation/scratch-link, documents the Serial transport and the coexistence port (20211), and points to brand/build_icons.py for icon regeneration. Translated to Korean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Captures the VS 2026-specific workload names, the missing .NET 6 SDK and Windows App Runtime 1.3 manual installs, and the startup-project gotcha (scratch-link-win, not the wapproj) that causes MddBootstrap to fail on F5. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replaces brand/alux-l.svg with brand/labs-l.svg as the icon source of truth and regenerates all derived ICO/PNG assets. Wrong source file was committed earlier. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
Serial Transport 기능을 구현하여 CH340 및 CDC 호환 USB 직렬 장치를 지원합니다. 동시에 Alux Scratch Link로 재브랜딩하여 기존 scratch-link와 병행 설치 가능하도록 하고, 개발 환경 문서화를 완성했습니다.
주요 변경 사항
1. Serial Transport 구현
/scratch/serialJSON-RPC 엔드포인트 추가 (포트 20211)SerialSession(공통 인터페이스),WinSerialPortEnumerator,WinSerialSession구현SerialPort.Read+ 500msReadTimeout으로 DTR/RTS 토글 시 발생하는ERROR_OPERATION_ABORTED회피2. Alux Scratch Link 재브랜딩
brand/build_icons.py추가ScratchVersion.targets에 GitInfo 태그 부재 시 기본값 1.0.0 설정3. 문서 정리 및 개발 가이드
documents/폴더로 이관 (리포지토리 간 병행 편집 용이)4. 개발 환경 설정
UpgradeLog*.htm,_UpgradeReport_Files/,Backup*/)를 gitignore에 추가