procon_bypass_man 0.3.9 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9799933aa6f27812290fd75a4538b7ac0f334f548593a7365840c2a7256dd7ea
4
- data.tar.gz: 7f8f101cc58b668d38297d220cfcdd06e650429bf1d8540e7f75d4cb66e374c9
3
+ metadata.gz: 7599b3687d6efc95875555ba97158421b94422f350b9bb049e80476aaffb9efa
4
+ data.tar.gz: fc62c5c839586c5149d89c3391bcaa0feb2bfbfa2662a0a20e6c9225a3a76c2b
5
5
  SHA512:
6
- metadata.gz: 38af52cac3890ad462b1dfa99e2d8f278a74631561174a368789cb7ea779382c138baf17fd17ebf6eef815bdd40534af0618d811ee8bbd6c1907142ed06ddc94
7
- data.tar.gz: 4b26dbfe8ac913f3cb957a8a93fdb535c8b9b3d8162a9c1837a9f3075390a54fbda3739f4986a91c84775ce633d7b0f1202320e3f7cf2903a8d79bcc9f3ec60d
6
+ metadata.gz: fd12efc1f2f10b8177177bd7aa179da834991939a4cd460d0b10b2e03c476482d5de747de588a98a05e917a0eef44bc17c58b1e14a699ea693a34cdff246be11
7
+ data.tar.gz: a60c477422fe598bb50cd0773e94a8de9fee9607a7bd32ffd7d25bc6ea466a930a6a9e311f2615ecf995d7d9b91fd9be599f52abce31f109200a6bf42fabe61e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## unrelease
2
+ * 起動時の安定性向上
3
+ * systemd unit pbm.serviceのRestart=noにしました
4
+
5
+ ## [0.3.10] 2023-11-30
6
+ * マクロを実行するとメモリ使用率が増え続ける不具合を修正しました
7
+
1
8
  ## [0.3.9] 2023-07-15
2
9
  * Lボタンを押すだけで簡単スニーキング(スプラ3)ができるようになりました
3
10
  * 例: `left_analog_stick_cap cap: 1100, if_pressed: [:l], combined_press_is_pressed: [:zl], force_neutral: [:l]`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- procon_bypass_man (0.3.9)
4
+ procon_bypass_man (0.3.11)
5
5
  action_cable_client
6
6
  blue_green_process (= 0.1.4.2)
7
7
  pbmenv (>= 0.1.11)
@@ -56,7 +56,7 @@ GEM
56
56
  parallel (1.21.0)
57
57
  parser (3.0.3.2)
58
58
  ast (~> 2.4.1)
59
- pbmenv (0.1.12)
59
+ pbmenv (0.1.13)
60
60
  pry (0.14.1)
61
61
  coderay (~> 1.1)
62
62
  method_source (~> 1.0)
@@ -147,7 +147,7 @@ GEM
147
147
  concurrent-ruby (~> 1.0)
148
148
  unicode-display_width (2.1.0)
149
149
  webrick (1.7.0)
150
- websocket (1.2.9)
150
+ websocket (1.2.10)
151
151
  websocket-eventmachine-base (1.2.0)
152
152
  eventmachine (~> 1.0)
153
153
  websocket (~> 1.0)
data/README.md CHANGED
@@ -78,7 +78,7 @@ sudo kill -USR2 `cat ./pbm_pid`
78
78
  * `message = ProconBypassMan::BootMessage.new; ProconBypassMan::ReportBootJob.perform(body: message.to_hash)`
79
79
 
80
80
  ### リリース手順
81
- * project_template/web.rb, project_template/app.rb, lib/procon_bypass_man/version.rb のバージョンをあげる
81
+ * project_template/app.rb.erb, lib/procon_bypass_man/version.rb のバージョンをあげる
82
82
  * CHANGELOG.md に日付を書く
83
83
  * be rake release
84
84
  * githubのreleaseを作成する
@@ -8,11 +8,4 @@ require "pry"
8
8
  # Usage:
9
9
  # $ `generate_output_report x zl y` のように、引数にボタン名を渡す
10
10
 
11
- no_action_binary = ["30f28100800078c77448287509550274ff131029001b0022005a0271ff191028001e00210064027cff1410280020002100000000000000000000000000000000"].pack("H*")
12
- user_operation = ProconBypassMan::Procon::UserOperation.new(no_action_binary)
13
-
14
- ARGV.map { |x| x.to_sym }.each do |button|
15
- user_operation.press_button(button)
16
- end
17
-
18
- puts user_operation.binary.unpack.first
11
+ puts OutputReportGenerator.new(ARGV).execute
@@ -5,15 +5,15 @@
5
5
  * sshをできる状態で焼いておく
6
6
  * SDカードをRaspberry Pi4本体に挿して起動する
7
7
  * sshする
8
- * wget -O - "https://github.com/itamae-kitchen/mitamae/releases/latest/download/mitamae-armhf-linux.tar.gz" | tar xvz
9
- * wget https://raw.githubusercontent.com/splaplapla/procon_bypass_man/master/docs/setup_raspi.mitamae.rb -O setup_raspi.mitamae.rb
10
- * sudo ./mitamae-armhf-linux local setup_raspi.mitamae.rb -l debug
11
- * sudo reboot
12
- * sudo sh /usr/share/pbm/shared/add_procon_gadget.sh の実行する
8
+ * `wget -O - "https://github.com/itamae-kitchen/mitamae/releases/latest/download/mitamae-armhf-linux.tar.gz" | tar xvz`
9
+ * `wget https://raw.githubusercontent.com/splaplapla/procon_bypass_man/master/docs/setup_raspi.mitamae.rb -O setup_raspi.mitamae.rb`
10
+ * `sudo ./mitamae-armhf-linux local setup_raspi.mitamae.rb -l debug`
11
+ * `sudo reboot`
12
+ * `sudo sh /usr/share/pbm/shared/add_procon_gadget.sh` の実行する
13
13
  * 何も表示されなければOK
14
14
  * PCとRaspberry Pi4を接続し、プロコンとして認識していることを確認する
15
- * sudo gem i pbmenv
16
- * sudo pbmenv install latest
15
+ * `sudo gem i pbmenv`
16
+ * `sudo pbmenv install latest`
17
17
 
18
18
  Raspberry Piのセットアップは以上です。
19
19
  次は、SwitchとRaspberry Piとプロコンにケーブルを接続した上で、次のコマンドをshellに入力し、procon_bypass_manの動作確認を行なってください。
@@ -5,7 +5,7 @@ class ProconBypassMan::DeviceConnection::Command
5
5
  def self.execute!(retry_count: 0)
6
6
  begin
7
7
  gadget, procon = ProconBypassMan::DeviceConnection::Executer.execute!
8
- rescue ProconBypassMan::DeviceConnection::TimeoutErrorInConditionalRoute
8
+ rescue ProconBypassMan::DeviceConnection::TimeoutErrorInConditionalRoute, ProconBypassMan::SafeTimeout::Timeout
9
9
  if retry_count >= MAX_RETRY_COUNT
10
10
  ProconBypassMan::SendErrorCommand.execute(error: "リトライしましたが、接続できませんでした")
11
11
  raise ProconBypassMan::DeviceConnection::TimeoutError
@@ -17,8 +17,6 @@ class ProconBypassMan::DeviceConnection::Command
17
17
  retry
18
18
  rescue ProconBypassMan::DeviceConnection::NotFoundProconError => e
19
19
  raise
20
- rescue ProconBypassMan::SafeTimeout::Timeout
21
- raise ProconBypassMan::DeviceConnection::TimeoutError
22
20
  end
23
21
 
24
22
  ProconBypassMan::DeviceConnection::PreBypass.new(gadget: gadget, procon: procon).execute!
@@ -113,6 +113,7 @@ class ProconBypassMan::DeviceConnection::Executer
113
113
  end
114
114
  rescue ProconBypassMan::SafeTimeout::Timeout, Timeout::Error => e
115
115
  ProconBypassMan.logger.error "timeoutになりました(#{e.message})"
116
+ procon.write_nonblock(['8006'].pack("H*")) # 再実行時のケーブルの再接続を不要にするワークアラウンド. リセットしているらしい
116
117
  compressed_buffer_text = ProconBypassMan::CompressArray.new(debug_log_buffer).compress.join("\n")
117
118
  ProconBypassMan::SendErrorCommand.execute(error: compressed_buffer_text, stdout: false)
118
119
  raise ProconBypassMan::SafeTimeout::Timeout if @throw_error_if_timeout
@@ -2,7 +2,6 @@ class ProconBypassMan::DeviceConnection::ProconSettingOverrider
2
2
  attr_accessor :procon, :output_report_watcher, :output_report_generator
3
3
 
4
4
  SUB_COMMAND_HOME_LED_ON = "38"
5
- SUB_COMMAND_VIBRATION = "48"
6
5
 
7
6
  SUB_COMMAND_ARG_HOME_LED_ON = "1FF0FF"
8
7
 
@@ -4,7 +4,7 @@ class ProconBypassMan::Domains::Binary::Base
4
4
  @binary = binary
5
5
  end
6
6
 
7
- # @return [String] バイナリ
7
+ # @return [String]
8
8
  def binary
9
9
  raise NotImplementedError
10
10
  end
@@ -9,7 +9,6 @@ class ProconBypassMan::Procon
9
9
  require "procon_bypass_man/procon/value_objects/rumble_binary"
10
10
  require "procon_bypass_man/procon/value_objects/binary"
11
11
  require "procon_bypass_man/procon/value_objects/bypass_mode"
12
- require "procon_bypass_man/procon/consts"
13
12
  require "procon_bypass_man/procon/performance_measurement"
14
13
  require "procon_bypass_man/procon/performance_measurement/queue_over_process"
15
14
  require "procon_bypass_man/procon/mode_registry"
@@ -215,6 +214,8 @@ class ProconBypassMan::Procon
215
214
  end
216
215
  user_operation.press_button_only_or_tilt_sticks(step)
217
216
  return user_operation.binary.raw
217
+ else
218
+ BlueGreenProcess::SharedVariable.extend_run_on_this_process = false
218
219
  end
219
220
 
220
221
  current_layer.disables.each do |button|
@@ -0,0 +1,18 @@
1
+ class OutputReportGenerator
2
+ NO_ACTION = ["30f28100800078c77448287509550274ff131029001b0022005a0271ff191028001e00210064027cff1410280020002100000000000000000000000000000000"].pack("H*").freeze
3
+
4
+ # @param [Array<Symbol, String>, NilClass] pressed_buttons
5
+ def initialize(*pressed_buttons)
6
+ @buttons = pressed_buttons || []
7
+ end
8
+
9
+ # @return [String]
10
+ def execute
11
+ user_operation = ProconBypassMan::Procon::UserOperation.new(NO_ACTION.dup)
12
+ [@buttons].flatten.sort.uniq.each do |button|
13
+ user_operation.press_button(button.to_sym)
14
+ end
15
+
16
+ user_operation.binary.unpack.first
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProconBypassMan
4
- VERSION = "0.3.9"
4
+ VERSION = "0.3.11"
5
5
  end
@@ -46,6 +46,7 @@ require_relative "procon_bypass_man/support/watchdog"
46
46
  require_relative "procon_bypass_man/support/forever"
47
47
  require_relative "procon_bypass_man/support/simple_tcp_server"
48
48
  require_relative "procon_bypass_man/support/proccess_cheacker"
49
+ require_relative "procon_bypass_man/support/output_report_generator"
49
50
  require_relative "procon_bypass_man/procon_display"
50
51
  require_relative "procon_bypass_man/background"
51
52
  require_relative "procon_bypass_man/commands"
@@ -73,7 +74,6 @@ Thread.abort_on_exception = true
73
74
 
74
75
  module ProconBypassMan
75
76
  extend ProconBypassMan::Configuration::ClassMethods
76
- extend ProconBypassMan::NeverExitAccidentally
77
77
 
78
78
  class CouldNotLoadConfigError < StandardError; end
79
79
  class NotFoundProconError < StandardError; end
@@ -12,7 +12,7 @@ begin
12
12
  gemfile do
13
13
  source 'https://rubygems.org'
14
14
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
15
- gem 'procon_bypass_man', '0.3.9'
15
+ gem 'procon_bypass_man', '0.3.11'
16
16
  # uncomment if you want to use master branch
17
17
  # gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: 'master'
18
18
  # uncomment if you want to use serial communication feature
@@ -12,7 +12,7 @@ begin
12
12
  gemfile do
13
13
  source 'https://rubygems.org'
14
14
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
15
- gem 'procon_bypass_man', '0.3.9'
15
+ gem 'procon_bypass_man', '0.3.11'
16
16
  # uncomment if you want to use master branch
17
17
  # gem 'procon_bypass_man', github: 'splaplapla/procon_bypass_man', branch: 'master'
18
18
  # uncomment if you want to use serial communication feature
@@ -6,7 +6,7 @@ After=network.target
6
6
  Type=simple
7
7
  WorkingDirectory=/usr/share/pbm/current
8
8
  ExecStart=/bin/bash -c "/home/pi/.rbenv/versions/3.0.1/bin/ruby /usr/share/pbm/current/app.rb"
9
- Restart=always
9
+ Restart=no
10
10
  Nice=-20
11
11
 
12
12
  [Install]
data/sig/main.rbs CHANGED
@@ -339,12 +339,6 @@ class ProconBypassMan::Procon::ButtonCollection
339
339
  def self.load: (untyped button_key) -> untyped
340
340
  end
341
341
 
342
- class ProconBypassMan::Procon
343
- module Data
344
- NO_ACTION: untyped
345
- end
346
- end
347
-
348
342
  class ProconBypassMan::Procon
349
343
  class FlipCache
350
344
  def self.fetch: (key: untyped key, expires_in: untyped expires_in) { () -> untyped } -> untyped
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.3.9
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - jiikko
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-15 00:00:00.000000000 Z
11
+ date: 2023-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: action_cable_client
@@ -216,7 +216,6 @@ files:
216
216
  - lib/procon_bypass_man/procon/analog_stick_manipulator.rb
217
217
  - lib/procon_bypass_man/procon/button.rb
218
218
  - lib/procon_bypass_man/procon/button_collection.rb
219
- - lib/procon_bypass_man/procon/consts.rb
220
219
  - lib/procon_bypass_man/procon/flip_cache.rb
221
220
  - lib/procon_bypass_man/procon/layer_changer.rb
222
221
  - lib/procon_bypass_man/procon/macro.rb
@@ -284,6 +283,7 @@ files:
284
283
  - lib/procon_bypass_man/support/load_agv.rb
285
284
  - lib/procon_bypass_man/support/never_exit_accidentally.rb
286
285
  - lib/procon_bypass_man/support/on_memory_cache.rb
286
+ - lib/procon_bypass_man/support/output_report_generator.rb
287
287
  - lib/procon_bypass_man/support/proccess_cheacker.rb
288
288
  - lib/procon_bypass_man/support/procon_performance_http_client.rb
289
289
  - lib/procon_bypass_man/support/remote_macro_http_client.rb
@@ -323,7 +323,7 @@ metadata:
323
323
  homepage_uri: https://github.com/splaplapla/procon_bypass_man
324
324
  source_code_uri: https://github.com/splaplapla/procon_bypass_man
325
325
  changelog_uri: https://github.com/splaplapla/procon_bypass_man/blob/master/CHANGELOG.md
326
- post_install_message:
326
+ post_install_message:
327
327
  rdoc_options: []
328
328
  require_paths:
329
329
  - lib
@@ -338,8 +338,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  - !ruby/object:Gem::Version
339
339
  version: '0'
340
340
  requirements: []
341
- rubygems_version: 3.2.15
342
- signing_key:
341
+ rubygems_version: 3.3.7
342
+ signing_key:
343
343
  specification_version: 4
344
344
  summary: A programmable converter for Nintendo Switch Pro Controller
345
345
  test_files: []
@@ -1,5 +0,0 @@
1
- class ProconBypassMan::Procon
2
- module Consts
3
- NO_ACTION = "30f28100800078c77448287509550274ff131029001b0022005a0271ff191028001e00210064027cff1410280020002100000000000000000000000000000000".freeze
4
- end
5
- end