-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e60ae74
commit d932e93
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use crate::{models::AdbServerCommand, ADBServerDevice, Result}; | ||
|
||
impl ADBServerDevice { | ||
/// Forward socket connection | ||
pub fn forward(&mut self, remote: String, local: String) -> Result<()> { | ||
let serial = self.identifier.clone(); | ||
self.connect()? | ||
.send_adb_request(AdbServerCommand::TransportSerial(serial.clone()))?; | ||
|
||
self.get_transport_mut() | ||
.proxy_connection(AdbServerCommand::Forward(serial, remote, local), false) | ||
.map(|_| ()) | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
mod forward; | ||
mod framebuffer; | ||
mod host_features; | ||
mod list; | ||
mod logcat; | ||
mod reboot; | ||
mod recv; | ||
mod reverse; | ||
mod send; | ||
mod stat; | ||
mod transport; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use crate::{models::AdbServerCommand, ADBServerDevice, Result}; | ||
|
||
impl ADBServerDevice { | ||
/// Reverse socket connection | ||
pub fn reverse(&mut self, remote: String, local: String) -> Result<()> { | ||
let serial = self.identifier.clone(); | ||
self.connect()? | ||
.send_adb_request(AdbServerCommand::TransportSerial(serial))?; | ||
|
||
self.get_transport_mut() | ||
.proxy_connection(AdbServerCommand::Reverse(remote, local), false) | ||
.map(|_| ()) | ||
} | ||
} |