procon_bypass_man 0.1.22 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +1 -1
  3. data/.github/workflows/gitleacks.yml +12 -0
  4. data/.github/workflows/release.yml +1 -0
  5. data/.github/workflows/ruby.yml +1 -1
  6. data/CHANGELOG.md +22 -0
  7. data/Gemfile.lock +5 -5
  8. data/docs/getting_started.md +9 -1
  9. data/docs/setup_raspi.md +0 -1
  10. data/lib/procon_bypass_man/buttons_setting_configuration/loader.rb +1 -1
  11. data/lib/procon_bypass_man/{commands → bypass}/bypass_command.rb +36 -24
  12. data/lib/procon_bypass_man/bypass/usb_hid_logger.rb +3 -0
  13. data/lib/procon_bypass_man/bypass.rb +40 -23
  14. data/lib/procon_bypass_man/commands/print_boot_message_command.rb +2 -3
  15. data/lib/procon_bypass_man/commands/send_error_command.rb +2 -2
  16. data/lib/procon_bypass_man/commands.rb +0 -3
  17. data/lib/procon_bypass_man/configuration.rb +22 -3
  18. data/lib/procon_bypass_man/device_connection/command.rb +28 -0
  19. data/lib/procon_bypass_man/device_connection/executor.rb +190 -0
  20. data/lib/procon_bypass_man/device_connection/output_report_generator.rb +42 -0
  21. data/lib/procon_bypass_man/device_connection/output_report_markerable.rb +28 -0
  22. data/lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb +133 -0
  23. data/lib/procon_bypass_man/device_connection/output_report_watcher.rb +41 -0
  24. data/lib/procon_bypass_man/device_connection/pre_bypass.rb +67 -0
  25. data/lib/procon_bypass_man/device_connection/procon_setting_overrider.rb +78 -0
  26. data/lib/procon_bypass_man/device_connection/spoofing_output_report_watcher.rb +39 -0
  27. data/lib/procon_bypass_man/device_connection.rb +16 -0
  28. data/lib/procon_bypass_man/device_model.rb +17 -0
  29. data/lib/procon_bypass_man/io_monitor.rb +20 -1
  30. data/lib/procon_bypass_man/procon/macro_builder.rb +5 -3
  31. data/lib/procon_bypass_man/procon/suppress_rumble.rb +13 -0
  32. data/lib/procon_bypass_man/{domains → procon/value_objects}/analog_stick_position.rb +0 -0
  33. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/base.rb +0 -0
  34. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/has_immutable_binary.rb +0 -0
  35. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/has_mutable_binary.rb +0 -0
  36. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/inbound_procon_binary.rb +5 -0
  37. data/lib/procon_bypass_man/{domains → procon/value_objects}/binary/processing_procon_binary.rb +0 -0
  38. data/lib/procon_bypass_man/procon/value_objects/binary.rb +11 -0
  39. data/lib/procon_bypass_man/{domains → procon/value_objects}/bypass_mode.rb +0 -0
  40. data/lib/procon_bypass_man/procon/value_objects/rumble_binary.rb +18 -0
  41. data/lib/procon_bypass_man/procon.rb +8 -0
  42. data/lib/procon_bypass_man/procon_display/http_request.rb +31 -0
  43. data/lib/procon_bypass_man/procon_display/http_response.rb +23 -0
  44. data/lib/procon_bypass_man/procon_display/server.rb +33 -0
  45. data/lib/procon_bypass_man/procon_display/server_app.rb +17 -0
  46. data/lib/procon_bypass_man/procon_display/status.rb +20 -0
  47. data/lib/procon_bypass_man/procon_display.rb +10 -0
  48. data/lib/procon_bypass_man/{commands → remote_pbm_action/commands}/run_remote_pbm_action_dispatch_command.rb +0 -0
  49. data/lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb +7 -1
  50. data/lib/procon_bypass_man/remote_pbm_action.rb +1 -0
  51. data/lib/procon_bypass_man/runner.rb +10 -13
  52. data/lib/procon_bypass_man/support/cycle_sleep.rb +22 -0
  53. data/lib/procon_bypass_man/support/device_mouse_finder.rb +60 -0
  54. data/lib/procon_bypass_man/{device_procon_finder.rb → support/device_procon_finder.rb} +0 -0
  55. data/lib/procon_bypass_man/support/never_exit_accidentally.rb +3 -3
  56. data/lib/procon_bypass_man/support/safe_timeout.rb +7 -1
  57. data/lib/procon_bypass_man/{usb_device_controller.rb → support/usb_device_controller.rb} +9 -4
  58. data/lib/procon_bypass_man/support/yaml_loader.rb +12 -0
  59. data/lib/procon_bypass_man/version.rb +1 -1
  60. data/lib/procon_bypass_man/websocket/client.rb +1 -4
  61. data/lib/procon_bypass_man.rb +66 -51
  62. data/project_template/app.rb +23 -7
  63. data/sig/main.rbs +4 -16
  64. metadata +37 -16
  65. data/lib/procon_bypass_man/commands/connect_device_command.rb +0 -18
  66. data/lib/procon_bypass_man/device_connector.rb +0 -293
  67. data/lib/procon_bypass_man/domains.rb +0 -13
@@ -14,8 +14,14 @@ require "pbmenv"
14
14
  require_relative "procon_bypass_man/version"
15
15
  require_relative "procon_bypass_man/remote_pbm_action"
16
16
  require_relative "procon_bypass_man/remote_macro"
17
+
18
+ require_relative "procon_bypass_man/device_connection"
19
+ require_relative "procon_bypass_man/support/usb_device_controller"
20
+ require_relative "procon_bypass_man/support/device_procon_finder"
21
+ require_relative "procon_bypass_man/support/device_mouse_finder"
17
22
  require_relative "procon_bypass_man/support/signal_handler"
18
23
  require_relative "procon_bypass_man/support/callbacks"
24
+ require_relative "procon_bypass_man/support/yaml_loader"
19
25
  require_relative "procon_bypass_man/support/yaml_writer"
20
26
  require_relative "procon_bypass_man/support/safe_timeout"
21
27
  require_relative "procon_bypass_man/support/compress_array"
@@ -29,22 +35,19 @@ require_relative "procon_bypass_man/support/send_device_stats_http_client"
29
35
  require_relative "procon_bypass_man/support/server_pool"
30
36
  require_relative "procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler"
31
37
  require_relative "procon_bypass_man/support/never_exit_accidentally"
38
+ require_relative "procon_bypass_man/support/cycle_sleep"
39
+ require_relative "procon_bypass_man/procon_display"
32
40
  require_relative "procon_bypass_man/background"
33
41
  require_relative "procon_bypass_man/commands"
34
42
  require_relative "procon_bypass_man/bypass"
35
- require_relative "procon_bypass_man/domains"
36
- require_relative "procon_bypass_man/device_connector"
37
- require_relative "procon_bypass_man/device_procon_finder"
38
43
  require_relative "procon_bypass_man/device_status"
39
- require_relative "procon_bypass_man/usb_device_controller"
40
44
  require_relative "procon_bypass_man/runner"
41
45
  require_relative "procon_bypass_man/processor"
42
46
  require_relative "procon_bypass_man/configuration"
43
47
  require_relative "procon_bypass_man/buttons_setting_configuration"
44
48
  require_relative "procon_bypass_man/procon"
49
+ require_relative "procon_bypass_man/device_model"
45
50
  require_relative "procon_bypass_man/procon/button"
46
- require_relative "procon_bypass_man/procon/value_objects/analog_stick"
47
- require_relative "procon_bypass_man/procon/value_objects/procon_reader"
48
51
  require_relative "procon_bypass_man/procon/analog_stick_cap"
49
52
  require_relative "procon_bypass_man/procon/analog_stick_manipulator"
50
53
  require_relative "procon_bypass_man/remote_pbm_action/value_objects/remote_pbm_action_object"
@@ -62,61 +65,59 @@ module ProconBypassMan
62
65
  extend ProconBypassMan::NeverExitAccidentally
63
66
 
64
67
  class CouldNotLoadConfigError < StandardError; end
65
- class ConnectionError < StandardError; end
66
- class FirstConnectionError < ConnectionError; end
67
- class EternalConnectionError < ConnectionError; end
68
+ class NotFoundProconError < StandardError; end
68
69
 
69
70
  # @return [void]
70
71
  def self.run(setting_path: nil)
71
- ProconBypassMan::Scheduler.start!
72
- ProconBypassMan::Background::JobRunner.start!
73
- ProconBypassMan::Websocket::Client.start!
74
- ProconBypassMan::QueueOverProcess.start!
75
-
76
72
  ProconBypassMan::PrintMessageCommand.execute(text: "PBMを起動しています")
77
73
  initialize_pbm
78
- ProconBypassMan::ButtonsSettingConfiguration::Loader.load(setting_path: setting_path)
79
- gadget, procon = ProconBypassMan::ConnectDeviceCommand.execute!
80
- Runner.new(gadget: gadget, procon: procon).run # ここでblockingする
81
- FileUtils.rm_rf(ProconBypassMan.pid_path)
82
- FileUtils.rm_rf(ProconBypassMan.digest_path)
83
- ProconBypassMan::QueueOverProcess.shutdown
84
- rescue ProconBypassMan::CouldNotLoadConfigError
85
- ProconBypassMan::SendErrorCommand.execute(error: "設定ファイルが不正です。設定ファイルの読み込みに失敗しました")
86
- ProconBypassMan::DeviceStatus.change_to_setting_syntax_error_and_shutdown!
87
- # TODO シグナルトラップをしていないのでUSR2を送ったときにプロセスが停止している. 明示的にハンドリングするべき.
88
- ProconBypassMan.exit_if_allow(1) do
89
- FileUtils.rm_rf(ProconBypassMan.pid_path)
90
- FileUtils.rm_rf(ProconBypassMan.digest_path)
91
- ProconBypassMan::QueueOverProcess.shutdown
92
- end
93
- rescue ProconBypassMan::ConnectDeviceCommand::NotFoundProconError
94
- ProconBypassMan::SendErrorCommand.execute(error: "プロコンが見つかりませんでした。")
95
- ProconBypassMan::DeviceStatus.change_to_procon_not_found_error!
96
- # TODO シグナルトラップをしていないのでUSR2を送ったときにプロセスが停止している. 明示的にハンドリングするべき.
97
- ProconBypassMan.exit_if_allow(1) do
98
- FileUtils.rm_rf(ProconBypassMan.pid_path)
99
- FileUtils.rm_rf(ProconBypassMan.digest_path)
100
- ProconBypassMan::QueueOverProcess.shutdown
74
+
75
+ begin
76
+ ProconBypassMan::ButtonsSettingConfiguration::Loader.load(setting_path: setting_path)
77
+ rescue ProconBypassMan::CouldNotLoadConfigError
78
+ ProconBypassMan::SendErrorCommand.execute(error: "設定ファイルが不正です。設定ファイルの読み込みに失敗しました")
79
+ ProconBypassMan::DeviceStatus.change_to_setting_syntax_error_and_shutdown!
80
+ # TODO シグナルトラップをしていないのでUSR2を送ったときにプロセスが停止している. 明示的にハンドリングするべき.
81
+ ProconBypassMan::NeverExitAccidentally.exit_if_allow_at_config do
82
+ terminate_pbm
83
+ end
84
+ return
101
85
  end
102
- rescue ProconBypassMan::ConnectionError
86
+
103
87
  begin
104
- raise
105
- rescue ProconBypassMan::EternalConnectionError
88
+ gadget, procon = ProconBypassMan::DeviceConnection::Command.execute!
89
+ rescue ProconBypassMan::DeviceConnection::NotFoundProconError
90
+ ProconBypassMan::SendErrorCommand.execute(error: "プロコンが見つかりませんでした。")
91
+ ProconBypassMan::DeviceStatus.change_to_procon_not_found_error!
92
+ # TODO シグナルトラップをしていないので以下の状態に、USR2を送ったときにプロセスが停止してしまう
93
+ ProconBypassMan::NeverExitAccidentally.exit_if_allow_at_config do
94
+ terminate_pbm
95
+ end
96
+ return
97
+ rescue ProconBypassMan::DeviceConnection::TimeoutError
106
98
  ProconBypassMan::SendErrorCommand.execute(error: "接続の見込みがないのでsleepしまくります")
107
99
  ProconBypassMan::DeviceStatus.change_to_connected_but_sleeping!
108
- FileUtils.rm_rf(ProconBypassMan.pid_path)
100
+ %w(TERM INT).each do |sig|
101
+ Kernel.trap(sig) { exit 0 }
102
+ end
103
+ Kernel.trap :USR2 do
104
+ exit 0 # TODO retryする
105
+ end
109
106
  eternal_sleep
110
- rescue ProconBypassMan::FirstConnectionError
111
- ProconBypassMan::SendErrorCommand.execute(error: "接続を確立できませんでした。やりなおします。")
112
- retry
107
+ return
113
108
  end
109
+
110
+ ready_pbm
111
+ Runner.new(gadget: gadget, procon: procon).run # ここでblockingする
112
+ terminate_pbm
114
113
  end
115
114
 
115
+ # 実行ファイル(app.rb)から呼び出している
116
+ # @return [void]
116
117
  def self.configure(&block)
117
118
  @@configuration = ProconBypassMan::Configuration.new
118
119
  @@configuration.instance_eval(&block)
119
- @@configuration
120
+ nil
120
121
  end
121
122
 
122
123
  # @return [ProconBypassMan::Configuration]
@@ -133,20 +134,34 @@ module ProconBypassMan
133
134
  ProconBypassMan::IOMonitor.reset!
134
135
  end
135
136
 
137
+ # @return [void]
136
138
  def self.initialize_pbm
139
+ ProconBypassMan::Scheduler.start!
140
+ ProconBypassMan::Background::JobRunner.start!
141
+ ProconBypassMan::Websocket::Client.start!
142
+ ProconBypassMan::QueueOverProcess.start!
143
+
137
144
  ProconBypassMan::WriteDeviceIdCommand.execute
138
145
  ProconBypassMan::WriteSessionIdCommand.execute
139
- system("renice -n -20 -p #{$$}")
146
+ `renice -n -20 -p #{$$}`
140
147
  File.write(pid_path, $$)
141
148
  ProconBypassMan::DeviceStatus.change_to_running!
142
149
  end
143
150
 
144
- def self.eternal_sleep
145
- sleep(999999999)
151
+ def self.ready_pbm
152
+ ProconBypassMan::PrintBootMessageCommand.execute
153
+ ProconBypassMan::ReportLoadConfigJob.perform_async(ProconBypassMan.config.raw_setting)
146
154
  end
147
155
 
148
- # @return [Void]
149
- def self.hot_reload!
150
- Process.kill(:USR2, pid)
156
+ # @return [void]
157
+ def self.terminate_pbm
158
+ FileUtils.rm_rf(ProconBypassMan.pid_path)
159
+ FileUtils.rm_rf(ProconBypassMan.digest_path)
160
+ ProconBypassMan::QueueOverProcess.shutdown
161
+ end
162
+
163
+ # @return [void]
164
+ def self.eternal_sleep
165
+ sleep(999999999)
151
166
  end
152
167
  end
@@ -2,15 +2,25 @@
2
2
 
3
3
  require 'bundler/inline'
4
4
 
5
- gemfile do
6
- source 'https://rubygems.org'
7
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
8
- gem 'procon_bypass_man', '0.1.22'
5
+ begin
6
+ gemfile do
7
+ source 'https://rubygems.org'
8
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
9
+ gem 'procon_bypass_man', '0.2.1'
10
+ end
11
+ rescue Bundler::Source::Git::GitCommandError => e
12
+ # install中に強制終了するとgitの管理ファイルが不正状態になり、次のエラーが起きるので発生したらcache directoryを削除する
13
+ #"Git error: command `git fetch --force --quiet --tags https://github.com/splaplapla/procon_bypass_man refs/heads/\\*:refs/heads/\\*` in directory /home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af has failed.\n\nIf this error persists you could try removing the cache directory '/home/pi/.rbenv/versions/3.0.1/lib/ruby/gems/3.0.0/cache/bundler/git/procon_bypass_man-ae4c9016d76b667658c8ba66f3bbd2eebf2656af'"
14
+ if /try removing the cache directory '([^']+)'/ =~ e.message
15
+ require 'fileutils'
16
+ FileUtils.rm_rf($1)
17
+ retry
18
+ end
9
19
  end
10
20
 
11
21
  ProconBypassMan.configure do |config|
12
22
  config.root = File.expand_path(__dir__)
13
- config.logger = Logger.new("#{ProconBypassMan.root}/app.log", 5, 1024 * 1024 * 10)
23
+ config.logger = Logger.new("#{ProconBypassMan.root}/app.log", 1, 1024 * 1024 * 1)
14
24
  config.logger.level = :debug
15
25
 
16
26
  # バイパスするログを全部app.logに流すか
@@ -25,8 +35,14 @@ ProconBypassMan.configure do |config|
25
35
  # pbm-cloudで使う場合はnever_exitにtrueをセットしてください. trueがセットされている場合、不慮の事故が発生してもプロセスが終了しなくなります
26
36
  config.never_exit_accidentally = true
27
37
 
28
- # 操作が高頻度で固まるときは、 gadget_to_procon_interval の数値は大きくしてください
29
- config.bypass_mode = { mode: :normal, gadget_to_procon_interval: 5 }
38
+ # 毎秒行ったIOをログに出力するか
39
+ config.io_monitor_logging = false
40
+
41
+ # 接続に成功したらコントローラーのHOME LEDを光らせるか
42
+ config.enable_home_led_on_connect = true
43
+
44
+ # 操作が高頻度で固まるときは、 gadget_to_procon_interval の数値を大きくしてください
45
+ config.bypass_mode = { mode: :normal, gadget_to_procon_interval: 10 }
30
46
  end
31
47
 
32
48
  ProconBypassMan.run(setting_path: "/usr/share/pbm/current/setting.yml")
data/sig/main.rbs CHANGED
@@ -11,12 +11,6 @@ module ProconBypassMan
11
11
  class CouldNotLoadConfigError < StandardError
12
12
  end
13
13
 
14
- class FirstConnectionError < StandardError
15
- end
16
-
17
- class EternalConnectionError < StandardError
18
- end
19
-
20
14
  def self.configure: (?setting_path: untyped? setting_path) { () -> untyped } -> untyped
21
15
 
22
16
  def self.run: (?setting_path: untyped? setting_path) { () -> untyped } -> untyped
@@ -192,6 +186,7 @@ class ProconBypassMan::Configuration
192
186
  attr_reader api_server: untyped
193
187
  attr_reader api_servers: untyped
194
188
  attr_writer never_exit_accidentally: bool
189
+ attr_writer io_monitor_logging: bool
195
190
 
196
191
  attr_accessor enable_critical_error_logging: bool
197
192
 
@@ -231,6 +226,8 @@ class ProconBypassMan::Configuration
231
226
  def verbose_bypass_log: () -> bool
232
227
 
233
228
  def never_exit_accidentally: () -> bool
229
+
230
+ def io_monitor_logging: () -> bool
234
231
  end
235
232
 
236
233
 
@@ -255,21 +252,12 @@ class ProconBypassMan::DeviceConnector
255
252
 
256
253
  def self.connect: () -> ::Array[untyped]
257
254
 
258
- def initialize: (?throw_error_if_timeout: bool throw_error_if_timeout, ?throw_error_if_mismatch: bool throw_error_if_mismatch, ?enable_at_exit: bool enable_at_exit) -> untyped
255
+ def initialize: (?throw_error_if_timeout: bool throw_error_if_timeout, ?throw_error_if_mismatch: bool throw_error_if_mismatch) -> untyped
259
256
 
260
257
  def add: (untyped values, read_from: untyped read_from) -> untyped
261
258
 
262
259
  def drain_all: () -> untyped
263
260
 
264
- # switchに任意の命令を入力して、switchから読み取る
265
- def write_switch: (untyped data, ?only_write: bool only_write) -> untyped
266
-
267
- def write_procon: (untyped data, ?only_write: bool only_write) -> untyped
268
-
269
- def read_procon: (?only_read: bool only_read) -> untyped
270
-
271
- def read_switch: (?only_read: bool only_read) -> untyped
272
-
273
261
  def from_device: (untyped item) -> untyped
274
262
 
275
263
  # fromの対になる
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.22
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-09 00:00:00.000000000 Z
11
+ date: 2022-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pbmenv
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".circleci/config.yml"
63
+ - ".github/workflows/gitleacks.yml"
63
64
  - ".github/workflows/release.yml"
64
65
  - ".github/workflows/ruby.yml"
65
66
  - ".gitignore"
@@ -122,29 +123,28 @@ files:
122
123
  - lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/open_macro_steps.rb
123
124
  - lib/procon_bypass_man/buttons_setting_configuration/validator.rb
124
125
  - lib/procon_bypass_man/bypass.rb
126
+ - lib/procon_bypass_man/bypass/bypass_command.rb
125
127
  - lib/procon_bypass_man/bypass/usb_hid_logger.rb
126
128
  - lib/procon_bypass_man/commands.rb
127
- - lib/procon_bypass_man/commands/bypass_command.rb
128
- - lib/procon_bypass_man/commands/connect_device_command.rb
129
129
  - lib/procon_bypass_man/commands/print_boot_message_command.rb
130
130
  - lib/procon_bypass_man/commands/print_message_command.rb
131
- - lib/procon_bypass_man/commands/run_remote_pbm_action_dispatch_command.rb
132
131
  - lib/procon_bypass_man/commands/send_error_command.rb
133
132
  - lib/procon_bypass_man/commands/send_reload_config_event_command.rb
134
133
  - lib/procon_bypass_man/commands/write_device_id_command.rb
135
134
  - lib/procon_bypass_man/commands/write_session_id_command.rb
136
135
  - lib/procon_bypass_man/configuration.rb
137
- - lib/procon_bypass_man/device_connector.rb
138
- - lib/procon_bypass_man/device_procon_finder.rb
136
+ - lib/procon_bypass_man/device_connection.rb
137
+ - lib/procon_bypass_man/device_connection/command.rb
138
+ - lib/procon_bypass_man/device_connection/executor.rb
139
+ - lib/procon_bypass_man/device_connection/output_report_generator.rb
140
+ - lib/procon_bypass_man/device_connection/output_report_markerable.rb
141
+ - lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb
142
+ - lib/procon_bypass_man/device_connection/output_report_watcher.rb
143
+ - lib/procon_bypass_man/device_connection/pre_bypass.rb
144
+ - lib/procon_bypass_man/device_connection/procon_setting_overrider.rb
145
+ - lib/procon_bypass_man/device_connection/spoofing_output_report_watcher.rb
146
+ - lib/procon_bypass_man/device_model.rb
139
147
  - lib/procon_bypass_man/device_status.rb
140
- - lib/procon_bypass_man/domains.rb
141
- - lib/procon_bypass_man/domains/analog_stick_position.rb
142
- - lib/procon_bypass_man/domains/binary/base.rb
143
- - lib/procon_bypass_man/domains/binary/has_immutable_binary.rb
144
- - lib/procon_bypass_man/domains/binary/has_mutable_binary.rb
145
- - lib/procon_bypass_man/domains/binary/inbound_procon_binary.rb
146
- - lib/procon_bypass_man/domains/binary/processing_procon_binary.rb
147
- - lib/procon_bypass_man/domains/bypass_mode.rb
148
148
  - lib/procon_bypass_man/io_monitor.rb
149
149
  - lib/procon_bypass_man/plugin/splatoon2/macro/charge_tansan_bomb.rb
150
150
  - lib/procon_bypass_man/plugin/splatoon2/macro/dasei_cancel.rb
@@ -171,9 +171,25 @@ files:
171
171
  - lib/procon_bypass_man/procon/macro_registry.rb
172
172
  - lib/procon_bypass_man/procon/mode_registry.rb
173
173
  - lib/procon_bypass_man/procon/press_button_aware.rb
174
+ - lib/procon_bypass_man/procon/suppress_rumble.rb
174
175
  - lib/procon_bypass_man/procon/user_operation.rb
175
176
  - lib/procon_bypass_man/procon/value_objects/analog_stick.rb
177
+ - lib/procon_bypass_man/procon/value_objects/analog_stick_position.rb
178
+ - lib/procon_bypass_man/procon/value_objects/binary.rb
179
+ - lib/procon_bypass_man/procon/value_objects/binary/base.rb
180
+ - lib/procon_bypass_man/procon/value_objects/binary/has_immutable_binary.rb
181
+ - lib/procon_bypass_man/procon/value_objects/binary/has_mutable_binary.rb
182
+ - lib/procon_bypass_man/procon/value_objects/binary/inbound_procon_binary.rb
183
+ - lib/procon_bypass_man/procon/value_objects/binary/processing_procon_binary.rb
184
+ - lib/procon_bypass_man/procon/value_objects/bypass_mode.rb
176
185
  - lib/procon_bypass_man/procon/value_objects/procon_reader.rb
186
+ - lib/procon_bypass_man/procon/value_objects/rumble_binary.rb
187
+ - lib/procon_bypass_man/procon_display.rb
188
+ - lib/procon_bypass_man/procon_display/http_request.rb
189
+ - lib/procon_bypass_man/procon_display/http_response.rb
190
+ - lib/procon_bypass_man/procon_display/server.rb
191
+ - lib/procon_bypass_man/procon_display/server_app.rb
192
+ - lib/procon_bypass_man/procon_display/status.rb
177
193
  - lib/procon_bypass_man/remote_macro.rb
178
194
  - lib/procon_bypass_man/remote_macro/queue_over_process.rb
179
195
  - lib/procon_bypass_man/remote_macro/remote_macro_object.rb
@@ -184,6 +200,7 @@ files:
184
200
  - lib/procon_bypass_man/remote_pbm_action.rb
185
201
  - lib/procon_bypass_man/remote_pbm_action/base_action.rb
186
202
  - lib/procon_bypass_man/remote_pbm_action/change_pbm_version_action.rb
203
+ - lib/procon_bypass_man/remote_pbm_action/commands/run_remote_pbm_action_dispatch_command.rb
187
204
  - lib/procon_bypass_man/remote_pbm_action/commands/update_remote_pbm_action_status_command.rb
188
205
  - lib/procon_bypass_man/remote_pbm_action/reboot_os_action.rb
189
206
  - lib/procon_bypass_man/remote_pbm_action/restore_pbm_setting.rb
@@ -194,6 +211,9 @@ files:
194
211
  - lib/procon_bypass_man/support/analog_stick_hypotenuse_tilting_power_scaler.rb
195
212
  - lib/procon_bypass_man/support/callbacks.rb
196
213
  - lib/procon_bypass_man/support/compress_array.rb
214
+ - lib/procon_bypass_man/support/cycle_sleep.rb
215
+ - lib/procon_bypass_man/support/device_mouse_finder.rb
216
+ - lib/procon_bypass_man/support/device_procon_finder.rb
197
217
  - lib/procon_bypass_man/support/http_client.rb
198
218
  - lib/procon_bypass_man/support/never_exit_accidentally.rb
199
219
  - lib/procon_bypass_man/support/on_memory_cache.rb
@@ -205,8 +225,9 @@ files:
205
225
  - lib/procon_bypass_man/support/signal_handler.rb
206
226
  - lib/procon_bypass_man/support/update_remote_pbm_action_status_http_client.rb
207
227
  - lib/procon_bypass_man/support/uptime.rb
228
+ - lib/procon_bypass_man/support/usb_device_controller.rb
229
+ - lib/procon_bypass_man/support/yaml_loader.rb
208
230
  - lib/procon_bypass_man/support/yaml_writer.rb
209
- - lib/procon_bypass_man/usb_device_controller.rb
210
231
  - lib/procon_bypass_man/version.rb
211
232
  - lib/procon_bypass_man/websocket/client.rb
212
233
  - lib/procon_bypass_man/websocket/forever.rb
@@ -1,18 +0,0 @@
1
- class ProconBypassMan::ConnectDeviceCommand
2
- class NotFoundProconError < StandardError; end
3
-
4
- # @return [void]
5
- def self.execute!
6
- gadget, procon = ProconBypassMan::DeviceConnector.connect
7
- rescue ProconBypassMan::DeviceConnector::NotFoundProconError => e
8
- ProconBypassMan.logger.error e
9
- gadget&.close
10
- procon&.close
11
- raise ProconBypassMan::ConnectDeviceCommand::NotFoundProconError
12
- rescue ProconBypassMan::SafeTimeout::Timeout
13
- ProconBypassMan.logger.error "デバイスとの通信でタイムアウトが起きて接続ができませんでした。"
14
- gadget&.close
15
- procon&.close
16
- raise ProconBypassMan::EternalConnectionError
17
- end
18
- end