Skip to content

Commit bb1477b

Browse files
committed
Remove USB impl
1 parent a49153c commit bb1477b

File tree

4 files changed

+2
-137
lines changed

4 files changed

+2
-137
lines changed

src/devices.rs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -119,28 +119,6 @@ impl SharedDevices {
119119
self.devices.values().find(|x| x.device_id == id)
120120
}
121121

122-
#[cfg(feature = "usb")]
123-
pub fn add_usb_device(&mut self, udid: String, _data: Arc<Mutex<Self>>) {
124-
self.last_index += 1;
125-
self.last_interface_index += 1;
126-
127-
let dev = MuxerDevice {
128-
connection_type: "USB".to_string(),
129-
device_id: self.last_index,
130-
service_name: None,
131-
interface_index: self.last_interface_index,
132-
network_address: None,
133-
serial_number: udid,
134-
heartbeat_handle: None,
135-
connection_speed: None,
136-
location_id: None,
137-
product_id: None,
138-
};
139-
140-
info!("Adding device: {:?}", dev.serial_number);
141-
self.devices.insert(dev.serial_number.clone(), dev);
142-
}
143-
144122
pub fn remove_device(&mut self, udid: &String) {
145123
if !self.devices.contains_key(udid) {
146124
warn!("Device isn't in the muxer, skipping");
@@ -286,15 +264,6 @@ impl SharedDevices {
286264
trace!("No UDID found after a re-cache");
287265
Err(())
288266
}
289-
290-
#[cfg(feature = "usb")]
291-
pub fn check_udid(&mut self, udid: String) -> bool {
292-
if self.paired_udids.contains(&udid) {
293-
return true;
294-
}
295-
self.update_cache();
296-
self.paired_udids.contains(&udid)
297-
}
298267
}
299268

300269
impl From<&MuxerDevice> for plist::Dictionary {

src/main.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ mod devices;
1616
mod heartbeat;
1717
mod mdns;
1818
mod raw_packet;
19-
#[cfg(feature = "usb")]
20-
mod usb;
2119

2220
#[tokio::main]
2321
async fn main() {
@@ -38,8 +36,6 @@ async fn main() {
3836
let mut use_unix = true;
3937

4038
let mut use_mdns = true;
41-
#[cfg(feature = "usb")]
42-
let mut use_usb = false;
4339

4440
// Loop through args
4541
let mut i = 0;
@@ -66,11 +62,6 @@ async fn main() {
6662
use_mdns = false;
6763
i += 1;
6864
}
69-
#[cfg(feature = "usb")]
70-
"--enable-usb" => {
71-
use_usb = true;
72-
i += 1;
73-
}
7465
"--disable-heartbeat" => {
7566
use_heartbeat = false;
7667
i += 1;
@@ -111,8 +102,6 @@ async fn main() {
111102
));
112103
info!("Created new central data");
113104
let data_clone = data.clone();
114-
#[cfg(feature = "usb")]
115-
let usb_data = data.clone();
116105

117106
if let Some(host) = host.clone() {
118107
let tcp_data = data.clone();
@@ -169,11 +158,6 @@ async fn main() {
169158
});
170159
}
171160

172-
#[cfg(feature = "usb")]
173-
if use_usb {
174-
usb::start_listener(usb_data);
175-
}
176-
177161
if use_mdns {
178162
let local = tokio::task::LocalSet::new();
179163
local.spawn_local(async move {

src/mdns.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub async fn discover(data: Arc<Mutex<SharedDevices>>) {
4747

4848
let mac_addr = name.split("@").collect::<Vec<&str>>()[0];
4949
let mut lock = data.lock().await;
50-
if let Ok(udid) = lock.get_udid_from_mac(mac_addr.to_string()) {
50+
if let Ok(udid) = lock.get_udid_from_mac(mac_addr.to_string()).await {
5151
if lock.devices.contains_key(&udid) {
5252
info!("Device has already been added to muxer, skipping");
5353
continue;
@@ -101,7 +101,7 @@ pub async fn discover(data: Arc<Mutex<SharedDevices>>) {
101101
}
102102
let mac_addr = mac_addr.unwrap();
103103
let mut lock = data.lock().await;
104-
if let Ok(udid) = lock.get_udid_from_mac(mac_addr.to_string()) {
104+
if let Ok(udid) = lock.get_udid_from_mac(mac_addr.to_string()).await {
105105
if lock.devices.contains_key(&udid) {
106106
info!("Device has already been added to muxer, skipping");
107107
continue;

src/usb.rs

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)