feat: expose open_session API and add TcpConnect local command#208
Open
jdjingdian wants to merge 3 commits into
Open
feat: expose open_session API and add TcpConnect local command#208jdjingdian wants to merge 3 commits into
open_session API and add TcpConnect local command#208jdjingdian wants to merge 3 commits into
Conversation
Owner
|
Thanks for your PR ! I'm not a big fan of exposing The goal / example of your PR looks very close to the |
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.
Motivation
Currently there is no way for library consumers to open arbitrary ADB services (e.g.
tcp:<port>) directly over a USB or TCP transport. This is the minimal foundation needed to implementadb forwardsemantics without requiring an intermediate adb server process.Use case: a Rust application that connects to a device over USB and needs to establish a TCP tunnel to a port on the device (e.g. for debugging daemons, custom protocols, etc.).
Changes
ADBMessageDevice::open_session: visibility changed frompub(crate)topub, with doc commentADBSessionaccessors:new,get_transport_mut,local_id,remote_id— added doc comments (already pub, now documented)ADBUSBDevice::inner_mut(): new method exposing the innerADBMessageDevicefor advanced operationsADBLocalCommand::TcpConnect(u16): new enum variant that formats to"tcp:<port>"— the standard ADB local service for device-side TCP connectionsADBLocalCommandandADBMessageDeviceare now accessible from the crate rootUsage Example
Notes
TcpConnectvariant maps directly to the ADB protocol'stcp:<port>service, which is handled natively by adbdforwardabstractions in future PRs