adb_utils/commands/networking/
pair.rs1use std::process::Command;
2
3use crate::{ADBCommand, ADBResult};
4
5pub struct ADBPair {
7 ip: String,
8 port: u32,
9 pin: u32,
10 shell: Command,
11}
12
13impl ADBPair {
14 pub fn new(ip: String, port: u32, pin: u32) -> Self {
15 let mut cmd = Command::new("adb");
16 cmd.arg("pair");
17 ADBPair {
18 ip,
19 port,
20 pin,
21 shell: cmd,
22 }
23 }
24}
25
26impl ADBCommand for ADBPair {
27 fn build(&mut self) -> Result<&mut Command, String> {
28 self.shell
29 .arg(format!("{}:{}", self.ip, self.port))
30 .arg(self.pin.to_string());
31 Ok(&mut self.shell)
32 }
33
34 fn process_output(&self, output: ADBResult) -> ADBResult {
35 output
36 }
37}