Sha256: 964b1d321145f7ca5792c005301938f1e139bb8397f0bae22498ede1d9f565e9

Contents?: true

Size: 845 Bytes

Versions: 19

Compression:

Stored size: 845 Bytes

Contents

module ProconBypassMan::DeviceConnection::OutputReportMarkerable
  OUTPUT_REPORT_FORMAT = /^01/
  INPUT_REPORT_FORMAT = /^21/

  # @param [String] raw_data
  # @return [void]
  def mark_as_send(raw_data)
    data = raw_data.unpack("H*").first
    case data
    when OUTPUT_REPORT_FORMAT
      sub_command = data[20..21]
      sub_command_arg = data[22..23]
      @hid_sub_command_request_table.mask_as_send(sub_command: sub_command, sub_command_arg: sub_command_arg)
    end
  end

  # @param [String] raw_data
  # @return [void]
  def mark_as_receive(raw_data)
    data = raw_data.unpack("H*").first
    case data
    when INPUT_REPORT_FORMAT
      sub_command = data[28..29]
      sub_command_arg = data[30..31]
      @hid_sub_command_request_table.mark_as_receive(sub_command: sub_command, sub_command_arg: sub_command_arg)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.12 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.11 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.10 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.9 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.8.1 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.8 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.7 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.6 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.5 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.4 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.3.1 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.3 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.2 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.1 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.3.0 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.2.3 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.2.2 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.2.1 lib/procon_bypass_man/device_connection/output_report_markerable.rb
procon_bypass_man-0.2.0 lib/procon_bypass_man/device_connection/output_report_markerable.rb