procon_bypass_man 0.1.2 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,41 +0,0 @@
1
- class ProconBypassMan::DeviceRegistry
2
- PROCON_PATH = "/dev/hidraw0"
3
- PROCON2_PATH = "/dev/hidraw1"
4
-
5
- def gadget
6
- @gadget
7
- end
8
-
9
- def procon
10
- @procon
11
- end
12
-
13
- def initialize
14
- init_devices
15
- end
16
-
17
- # @return [void]
18
- def init_devices
19
- loop do
20
- case
21
- when File.exist?(PROCON_PATH)
22
- system('echo > /sys/kernel/config/usb_gadget/procon/UDC')
23
- system('ls /sys/class/udc > /sys/kernel/config/usb_gadget/procon/UDC')
24
- sleep 0.5
25
- @gadget = File.open('/dev/hidg0', "w+")
26
- @procon = File.open(PROCON_PATH, "w+")
27
- break
28
- when File.exist?(PROCON2_PATH)
29
- system('echo > /sys/kernel/config/usb_gadget/procon/UDC')
30
- system('ls /sys/class/udc > /sys/kernel/config/usb_gadget/procon/UDC')
31
- sleep 0.5
32
- @gadget = File.open('/dev/hidg0', "w+")
33
- @procon = File.open(PROCON2_PATH, "w+")
34
- break
35
- else
36
- puts "プロコンをラズベイに挿してください"
37
- sleep(1)
38
- end
39
- end
40
- end
41
- end