procon_bypass_man 0.1.3 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +40 -13
- data/.rubocop.yml +24 -0
- data/CHANGELOG.md +20 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +26 -3
- data/README.md +13 -10
- data/docs/setup_raspi.md +12 -7
- data/docs/setup_raspi.mitamae.rb +45 -0
- data/docs/setup_raspi_by_mitamae.md +13 -0
- data/examples/practical/app.rb +3 -2
- data/examples/practical/setting.yml +1 -1
- data/lib/procon_bypass_man/configuration/layer.rb +39 -10
- data/lib/procon_bypass_man/configuration/loader.rb +17 -16
- data/lib/procon_bypass_man/configuration/validator.rb +70 -5
- data/lib/procon_bypass_man/configuration.rb +10 -7
- data/lib/procon_bypass_man/device_connector.rb +336 -0
- data/lib/procon_bypass_man/procon/button_collection.rb +3 -2
- data/lib/procon_bypass_man/procon/flip_cache.rb +22 -0
- data/lib/procon_bypass_man/procon/pressed_button_helper.rb +1 -1
- data/lib/procon_bypass_man/procon.rb +20 -11
- data/lib/procon_bypass_man/runner.rb +24 -42
- data/lib/procon_bypass_man/timer.rb +14 -0
- data/lib/procon_bypass_man/version.rb +1 -1
- data/lib/procon_bypass_man.rb +25 -8
- data/procon_bypass_man.gemspec +1 -1
- data/project_template/README.md +16 -0
- data/project_template/app.rb +18 -0
- data/project_template/setting.yml +35 -0
- data/project_template/systemd_units/pbm.service +13 -0
- metadata +15 -8
- data/examples/pbm.service +0 -27
- data/examples/simple.rb +0 -13
- data/lib/procon_bypass_man/device_registry.rb +0 -42
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procon_bypass_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: extension for Nintendo Switch Pro Controller
|
14
14
|
email:
|
@@ -20,6 +20,7 @@ files:
|
|
20
20
|
- ".circleci/config.yml"
|
21
21
|
- ".gitignore"
|
22
22
|
- ".rspec"
|
23
|
+
- ".rubocop.yml"
|
23
24
|
- ".ruby-version"
|
24
25
|
- CHANGELOG.md
|
25
26
|
- Gemfile
|
@@ -31,36 +32,42 @@ files:
|
|
31
32
|
- bin/setup
|
32
33
|
- docs/how_to_connect_procon.md
|
33
34
|
- docs/setup_raspi.md
|
34
|
-
-
|
35
|
+
- docs/setup_raspi.mitamae.rb
|
36
|
+
- docs/setup_raspi_by_mitamae.md
|
35
37
|
- examples/practical/app.rb
|
36
38
|
- examples/practical/setting.yml
|
37
|
-
- examples/simple.rb
|
38
39
|
- lib/procon_bypass_man.rb
|
39
40
|
- lib/procon_bypass_man/bypass.rb
|
40
41
|
- lib/procon_bypass_man/configuration.rb
|
41
42
|
- lib/procon_bypass_man/configuration/layer.rb
|
42
43
|
- lib/procon_bypass_man/configuration/loader.rb
|
43
44
|
- lib/procon_bypass_man/configuration/validator.rb
|
44
|
-
- lib/procon_bypass_man/
|
45
|
+
- lib/procon_bypass_man/device_connector.rb
|
45
46
|
- lib/procon_bypass_man/io_monitor.rb
|
46
47
|
- lib/procon_bypass_man/processor.rb
|
47
48
|
- lib/procon_bypass_man/procon.rb
|
48
49
|
- lib/procon_bypass_man/procon/button_collection.rb
|
49
50
|
- lib/procon_bypass_man/procon/data.rb
|
51
|
+
- lib/procon_bypass_man/procon/flip_cache.rb
|
50
52
|
- lib/procon_bypass_man/procon/layer_changeable.rb
|
51
53
|
- lib/procon_bypass_man/procon/macro_registry.rb
|
52
54
|
- lib/procon_bypass_man/procon/mode_registry.rb
|
53
55
|
- lib/procon_bypass_man/procon/pressed_button_helper.rb
|
54
56
|
- lib/procon_bypass_man/procon/user_operation.rb
|
55
57
|
- lib/procon_bypass_man/runner.rb
|
58
|
+
- lib/procon_bypass_man/timer.rb
|
56
59
|
- lib/procon_bypass_man/version.rb
|
57
60
|
- procon_bypass_man.gemspec
|
58
|
-
|
61
|
+
- project_template/README.md
|
62
|
+
- project_template/app.rb
|
63
|
+
- project_template/setting.yml
|
64
|
+
- project_template/systemd_units/pbm.service
|
65
|
+
homepage: https://github.com/splaplapla/procon_bypass_man
|
59
66
|
licenses:
|
60
67
|
- MIT
|
61
68
|
metadata:
|
62
|
-
homepage_uri: https://github.com/
|
63
|
-
source_code_uri: https://github.com/
|
69
|
+
homepage_uri: https://github.com/splaplapla/procon_bypass_man
|
70
|
+
source_code_uri: https://github.com/splaplapla/procon_bypass_man
|
64
71
|
post_install_message:
|
65
72
|
rdoc_options: []
|
66
73
|
require_paths:
|
data/examples/pbm.service
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# sudo ln -s /home/pi/src/procon_bypass_man/examples/pbm.service /etc/systemd/system/pbm.service
|
2
|
-
# Usage:
|
3
|
-
# systemctl daemon-reload
|
4
|
-
# systemctl enable pbm.service
|
5
|
-
# systemctl start pbm.service
|
6
|
-
# systemctl status pbm.service
|
7
|
-
# systemctl restart pbm.service
|
8
|
-
# Debug:
|
9
|
-
# journalctl -xe -f
|
10
|
-
# TODO:
|
11
|
-
# do not make PIDFILE
|
12
|
-
|
13
|
-
[Unit]
|
14
|
-
Description=PBM
|
15
|
-
# After=network-online.target
|
16
|
-
After=network.target
|
17
|
-
|
18
|
-
[Service]
|
19
|
-
Type=simple
|
20
|
-
# PIDFile=/home/pi/src/procon_bypass_man/pbm_pid
|
21
|
-
# WatchdogSec=60
|
22
|
-
WorkingDirectory=/home/pi/src/procon_bypass_man
|
23
|
-
ExecStart=/home/pi/.rbenv/versions/3.0.1/bin/ruby examples/practical/app.rb
|
24
|
-
Restart=always
|
25
|
-
|
26
|
-
[Install]
|
27
|
-
WantedBy=multi-user.target
|
data/examples/simple.rb
DELETED
@@ -1,42 +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
|
-
ProconBypassMan.logger.info("プロコンをラズベイに挿してください")
|
38
|
-
sleep(1)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|