Let an ISPDevice be driven over WebUSB - #155
Closed
carlossless wants to merge 1 commit into
Closed
Conversation
A device whose interface declares a vendor-specific class never appears in WebHID, but is reachable over WebUSB and still speaks the ISP protocol. ISPDevice now holds an ISPHandle, which is either. The command handle takes an `impl Into<ISPHandle>` so existing callers are unchanged; the Windows two-handle path converts explicitly.
Owner
Author
|
Closing along with carlossless/smk-web#3 and carlossless/hidra#9. WebUSB cannot claim the Sinowealth ISP bootloaders: they declare So Worth keeping from this: the bootloaders declare |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #152. Needs carlossless/hidra#9.
A device whose interface declares a vendor-specific class never appears in WebHID — Blink only surfaces interfaces the host recognises as HID — but it is reachable over WebUSB and still speaks the ISP protocol.
ISPDevicenow holds anISPHandle, which is either ahidra::HidDeviceor, on wasm with the newwebusbfeature, ahidra::webusb::HidDevice.The protocol code is unchanged:
ISPHandledispatches the only two operationsISPDeviceneeds,send_feature_reportandget_feature_report.Compatibility
ISPDevice::newtakesimpl Into<ISPHandle>for the command handle, so existing callers pass aHidDeviceunchanged. The Windows two-handle path converts explicitly — that branch is#[cfg(target_os = "windows")], so a Linux build would not have caught it; verified withcargo check --target x86_64-pc-windows-msvc.The
webusbfeature is off by default and forwards tohidra/nusb; nothing changes for the CLI or the existing WebHID path.Testing
fmt,
cargo test --workspace --lib --bins, the wasm build with and withoutwebusb, andcargo checkforx86_64-pc-windows-msvc, all pass locally.