usbutils 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/usbutils.rb +1 -3
- data/lib/usbutils/cli.rb +1 -1
- data/lib/usbutils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef3ecad3d4514598116281ee3acfb99ebf18ce8
|
4
|
+
data.tar.gz: 6b385328a53a00b95d134813c35695196ac66e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 522236ed06435b80d1b84cfe538e3f7e3608fe2eba84c62b9c323ed6eb4050f8ee770eede581ebf9a03414d959e89456ebced84b062e316f54b6f696913c3246
|
7
|
+
data.tar.gz: 47af4de69c78a90282956594605c6bd8509ce9ad7539616c22f0e5c4d9d3ce9504d49671046c8bc71ca3ed6b4d2d89af1e4f893517f3d9b96720d8f909f255ce
|
data/README.md
CHANGED
@@ -18,13 +18,13 @@ show command list
|
|
18
18
|
|
19
19
|
show usb devices
|
20
20
|
|
21
|
-
$ usbutils devices
|
21
|
+
$ sudo usbutils devices
|
22
22
|
serial=0000:00:06.0 product=OHCI Host Controller manufacturer=Linux 3.2.0-23-generic ohci_hcd
|
23
23
|
serial=01498A4D15005015 product=Galaxy Nexus manufacturer=samsung
|
24
24
|
|
25
25
|
reset(reconnect) usb device
|
26
26
|
|
27
|
-
$ usbutils reset 01498A4D15005015
|
27
|
+
$ sudo usbutils reset 01498A4D15005015
|
28
28
|
|
29
29
|
## Contributing
|
30
30
|
|
data/lib/usbutils.rb
CHANGED
@@ -20,9 +20,7 @@ module USBUtils
|
|
20
20
|
end
|
21
21
|
usb = LIBUSB::Context.new
|
22
22
|
usb.devices.each do |usbdev|
|
23
|
-
|
24
|
-
idproduct = format("%04x", usbdev.idProduct)
|
25
|
-
device = devices.select {|item| item[:idvendor] == idvendor && item[:idproduct] == idproduct}.first
|
23
|
+
device = devices.select {|item| item[:serial] == usbdev.serial_number}.first
|
26
24
|
device[:usbdev] = usbdev if device
|
27
25
|
end
|
28
26
|
devices
|
data/lib/usbutils/cli.rb
CHANGED
@@ -12,7 +12,7 @@ module USBUtils
|
|
12
12
|
if options[:detail]
|
13
13
|
pp device
|
14
14
|
else
|
15
|
-
print "serial=#{device[:serial]}\tproduct=#{device[:product]}\tmanufacturer=#{device[:manufacturer]}\n"
|
15
|
+
print "serial=#{device[:serial]}\tproduct=#{device[:product]}\tmanufacturer=#{device[:manufacturer]}\tusbdev=#{device[:usbdev]}\n"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/usbutils/version.rb
CHANGED