Exception: MTP::CommandError

Inherits:
DeviceError show all
Defined in:
lib/mtp.rb

Instance Attribute Summary collapse

Attributes inherited from DeviceError

#device

Instance Method Summary collapse

Constructor Details

#initialize(device, request, response, message = nil) ⇒ CommandError

Returns a new instance of CommandError.



70
71
72
73
74
# File 'lib/mtp.rb', line 70

def initialize(device, request, response, message = nil)
  message = sprintf("0x%04x:%s => 0x%04x:%s", request.code, request.code.name, response.code, response.code.name) if message.nil?
  super(device, message)
  @request, @response = request, response
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



68
69
70
# File 'lib/mtp.rb', line 68

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



68
69
70
# File 'lib/mtp.rb', line 68

def response
  @response
end