Sha256: 92b563919974663ee4cd47966ce6cd344444a0e0c59254a760c647a9bb6f7582
Contents?: true
Size: 1.48 KB
Versions: 1
Compression:
Stored size: 1.48 KB
Contents
class ProconBypassMan::Bypass module UsbHidLogger extend ProconBypassMan::Callbacks::ClassMethods include ProconBypassMan::Callbacks define_callbacks :send_gadget_to_procon define_callbacks :send_procon_to_gadget set_callback :send_gadget_to_procon, :after, :log_send_gadget_to_procon set_callback :send_procon_to_gadget, :after, :log_procon_to_gadget def log_send_gadget_to_procon if ProconBypassMan.config.verbose_bypass_log ProconBypassMan.logger.debug { ">>> #{bypass_value.to_text}" } else ProconBypassMan.cache.fetch key: 'bypass_log', expires_in: 1 do ProconBypassMan.logger.debug { ">>> #{bypass_value.to_text}" } end end end def log_procon_to_gadget if ProconBypassMan.config.verbose_bypass_log ProconBypassMan.logger.debug { "<<< #{bypass_value.to_text}" } else ProconBypassMan.cache.fetch key: 'bypass_log', expires_in: 1 do ProconBypassMan.logger.debug { "<<< #{bypass_value.to_text}" } end end ProconBypassMan.cache.fetch key: 'pressed_buttons_reporter', expires_in: 5 do ProconBypassMan::ReportPressedButtonsJob.perform_async( ProconBypassMan::ProconReader.new(binary: bypass_value.binary).to_hash ) end ProconBypassMan.cache.fetch key: 'heartbeat_reporter', expires_in: 60 do ProconBypassMan::ReportHeartbeatJob.perform_async(ProconBypassMan::BootMessage.new.to_hash) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
procon_bypass_man-0.1.13 | lib/procon_bypass_man/bypass/usb_hid_logger.rb |