procon_bypass_man 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +33 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +2 -1
- data/Rakefile +10 -1
- data/docs/setup_raspi.mitamae.rb +5 -2
- data/docs/setup_raspi_by_mitamae.md +2 -1
- data/lib/procon_bypass_man/device_connector.rb +3 -3
- data/lib/procon_bypass_man/runner.rb +2 -2
- data/lib/procon_bypass_man/uptime.rb +13 -0
- data/lib/procon_bypass_man/version.rb +1 -1
- data/lib/procon_bypass_man.rb +5 -0
- data/project_template/README.md +2 -1
- data/project_template/app.rb +2 -2
- data/project_template/systemd_units/pbm.service +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f5d2c0b9137168508351ca8a1492470cd1f03c31d7eb920010a32f08f92122e
|
4
|
+
data.tar.gz: c7f42dd711cb3d8932a8fd6d99ee0735084618411e6cd723eeee8860ca96cd8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71a45ddf739c64355197e1a0610d2441eb6445eb6d77eef8fd9cf711265d0a9fc23dfcf2d75075115bf1e546141fec7eab0e20c6469feff6b7dea238d4916951
|
7
|
+
data.tar.gz: 1bb4bc56c9310d94d682454b33c3d28ebc0a45753ee292c98cdee47bc94b3400c50ddbbb9c1f08b17ade330829760b4dbc1eef85ea22faf1aa8f9271e1b53e0f
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
[push]
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
|
16
|
+
runs-on: ubuntu-latest
|
17
|
+
strategy:
|
18
|
+
matrix:
|
19
|
+
ruby-version: ['2.5', '2.7', '3.0']
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
25
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
26
|
+
# uses: ruby/setup-ruby@v1
|
27
|
+
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby-version }}
|
30
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
31
|
+
- name: Run tests
|
32
|
+
run: bundle exec rubocop
|
33
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
procon_bypass_man (0.1.
|
4
|
+
procon_bypass_man (0.1.8)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -52,6 +52,7 @@ PLATFORMS
|
|
52
52
|
arm-linux
|
53
53
|
arm64-darwin-20
|
54
54
|
armv7l-linux
|
55
|
+
x86_64-linux
|
55
56
|
|
56
57
|
DEPENDENCIES
|
57
58
|
procon_bypass_man!
|
data/Rakefile
CHANGED
data/docs/setup_raspi.mitamae.rb
CHANGED
@@ -41,5 +41,8 @@ execute "Initialize PBM" do
|
|
41
41
|
SHELL
|
42
42
|
end
|
43
43
|
|
44
|
-
run_command 'systemctl disable triggerhappy'
|
45
|
-
run_command 'systemctl disable
|
44
|
+
run_command 'sudo systemctl disable triggerhappy.socket'
|
45
|
+
run_command 'sudo systemctl disable triggerhappy.service'
|
46
|
+
run_command 'sudo systemctl disable bluetooth'
|
47
|
+
run_command 'sudo systemctl disable apt-daily-upgrade.timer'
|
48
|
+
run_command 'sudo systemctl disable apt-daily.timer'
|
@@ -37,16 +37,16 @@ class ProconBypassMan::DeviceConnector
|
|
37
37
|
["8005"],
|
38
38
|
["0010"],
|
39
39
|
], read_from: :switch)
|
40
|
-
# 1
|
40
|
+
# 1. Sends current connection status, and if the Joy-Con are connected,
|
41
41
|
s.add([["8001"]], read_from: :switch)
|
42
42
|
s.add([/^8101/], read_from: :procon) # <<< 81010003176d96e7a5480000000, macaddressとコントローラー番号を返す
|
43
|
-
# 2
|
43
|
+
# 2. Sends handshaking packets over UART to the Joy-Con or Pro Controller Broadcom chip. This command can only be called once per session.
|
44
44
|
s.add([["8002"]], read_from: :switch)
|
45
45
|
s.add([/^8102/], read_from: :procon)
|
46
46
|
# 3
|
47
47
|
s.add([/^0100/], read_from: :switch)
|
48
48
|
s.add([/^21/], read_from: :procon)
|
49
|
-
# 4
|
49
|
+
# 4. Forces the Joy-Con or Pro Controller to only talk over USB HID without any timeouts. This is required for the Pro Controller to not time out and revert to Bluetooth.
|
50
50
|
s.add([["8004"]], read_from: :switch)
|
51
51
|
s.drain_all
|
52
52
|
return [s.switch, s.procon]
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require_relative "io_monitor"
|
2
|
+
require_relative "uptime"
|
2
3
|
|
3
4
|
class ProconBypassMan::Runner
|
4
5
|
class InterruptForRestart < StandardError; end
|
@@ -134,8 +135,6 @@ class ProconBypassMan::Runner
|
|
134
135
|
end
|
135
136
|
|
136
137
|
def first_negotiation
|
137
|
-
return if $will_terminate_token
|
138
|
-
|
139
138
|
@gadget, @procon = ProconBypassMan::DeviceConnector.connect
|
140
139
|
rescue ProconBypassMan::Timer::Timeout
|
141
140
|
::ProconBypassMan.logger.error "デバイスとの通信でタイムアウトが起きて接続ができませんでした。"
|
@@ -164,6 +163,7 @@ class ProconBypassMan::Runner
|
|
164
163
|
root: #{ProconBypassMan.root}
|
165
164
|
pid_path: #{ProconBypassMan.pid_path}
|
166
165
|
setting_path: #{ProconBypassMan::Configuration.instance.setting_path}
|
166
|
+
uptime from boot: #{ProconBypassMan::Uptime.from_boot} sec
|
167
167
|
----
|
168
168
|
EOF
|
169
169
|
ProconBypassMan.logger.info(booted_message)
|
data/lib/procon_bypass_man.rb
CHANGED
@@ -14,6 +14,11 @@ require_relative "procon_bypass_man/procon"
|
|
14
14
|
STDOUT.sync = true
|
15
15
|
Thread.abort_on_exception = true
|
16
16
|
|
17
|
+
# new feature from ruby3.0's
|
18
|
+
if GC.respond_to?(:auto_compact)
|
19
|
+
GC.auto_compact = true
|
20
|
+
end
|
21
|
+
|
17
22
|
module ProconBypassMan
|
18
23
|
class ProConRejected < StandardError; end
|
19
24
|
class CouldNotLoadConfigError < StandardError; end
|
data/project_template/README.md
CHANGED
@@ -3,13 +3,14 @@ https://github.com/splaplapla/pbmenv で使っているファイルです
|
|
3
3
|
|
4
4
|
## systemd
|
5
5
|
* sudo ln -s /usr/share/pbm/current/systemd_units/pbm.service /etc/systemd/system/pbm.service
|
6
|
-
*
|
6
|
+
* commands
|
7
7
|
* systemctl daemon-reload
|
8
8
|
* systemctl enable pbm.service
|
9
9
|
* systemctl disable pbm.service
|
10
10
|
* systemctl start pbm.service
|
11
11
|
* systemctl status pbm.service
|
12
12
|
* systemctl restart pbm.service
|
13
|
+
* systemctl list-unit-files --type=service
|
13
14
|
|
14
15
|
### ログ
|
15
16
|
* journalctl -xe -f
|
data/project_template/app.rb
CHANGED
@@ -5,7 +5,7 @@ require 'bundler/inline'
|
|
5
5
|
gemfile do
|
6
6
|
source 'https://rubygems.org'
|
7
7
|
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
8
|
-
gem 'procon_bypass_man', '0.1.
|
8
|
+
gem 'procon_bypass_man', '0.1.8'
|
9
9
|
gem 'procon_bypass_man-splatoon2', github: 'splaplapla/procon_bypass_man-splatoon2', tag: "0.1.1"
|
10
10
|
end
|
11
11
|
|
@@ -15,4 +15,4 @@ ProconBypassMan.tap do |pbm|
|
|
15
15
|
pbm.logger.level = :debug
|
16
16
|
end
|
17
17
|
|
18
|
-
ProconBypassMan.run(setting_path: "
|
18
|
+
ProconBypassMan.run(setting_path: "/usr/share/pbm/current/setting.yml")
|
@@ -5,7 +5,7 @@ After=network.target
|
|
5
5
|
[Service]
|
6
6
|
Type=simple
|
7
7
|
WorkingDirectory=/usr/share/pbm/current
|
8
|
-
ExecStart=/bin/bash -c "ruby /usr/share/pbm/current/app.rb"
|
8
|
+
ExecStart=/bin/bash -c "/home/pi/.rbenv/versions/3.0.1/bin/ruby /usr/share/pbm/current/app.rb"
|
9
9
|
Restart=always
|
10
10
|
Nice=-19
|
11
11
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jiikko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: extension for Nintendo Switch Pro Controller
|
14
14
|
email:
|
@@ -18,6 +18,7 @@ extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- ".circleci/config.yml"
|
21
|
+
- ".github/workflows/ruby.yml"
|
21
22
|
- ".gitignore"
|
22
23
|
- ".rspec"
|
23
24
|
- ".rubocop.yml"
|
@@ -56,6 +57,7 @@ files:
|
|
56
57
|
- lib/procon_bypass_man/procon/user_operation.rb
|
57
58
|
- lib/procon_bypass_man/runner.rb
|
58
59
|
- lib/procon_bypass_man/timer.rb
|
60
|
+
- lib/procon_bypass_man/uptime.rb
|
59
61
|
- lib/procon_bypass_man/version.rb
|
60
62
|
- procon_bypass_man.gemspec
|
61
63
|
- project_template/README.md
|