Class: DSP::ReadMemoryResponse

Inherits:
DSPBase
  • Object
show all
Defined in:
lib/dsp/dsp_protocol.rb

Overview

interface ReadMemoryResponse extends Response {

    body?: {
        /** The address of the first byte of data returned.
            Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
        */
        address: string;
        /** The number of unreadable bytes encountered after the last successfully read byte.
            This can be used to determine the number of bytes that must be skipped before a subsequent 'readMemory' request will succeed.
        */
        unreadableBytes?: number;
        /** The bytes read from memory, encoded using base64. */
        data?: string;
    };
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ ReadMemoryResponse

Returns a new instance of ReadMemoryResponse.



3483
3484
3485
3486
# File 'lib/dsp/dsp_protocol.rb', line 3483

def initialize(initial_hash = nil)
  super
  @optional_method_names = i[body message]
end

Instance Attribute Details

#bodyObject

type: {



3469
3470
3471
# File 'lib/dsp/dsp_protocol.rb', line 3469

def body
  @body
end

#commandObject

type: {



3469
3470
3471
# File 'lib/dsp/dsp_protocol.rb', line 3469

def command
  @command
end

#messageObject

type: {



3469
3470
3471
# File 'lib/dsp/dsp_protocol.rb', line 3469

def message
  @message
end

#request_seqObject

/** The address of the first byte of data returned.

        Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
    */
    address: string;
    /** The number of unreadable bytes encountered after the last successfully read byte.
        This can be used to determine the number of bytes that must be skipped before a subsequent 'readMemory' request will succeed.
    */
    unreadableBytes?: number;
    /** The bytes read from memory, encoded using base64. */
    data?: string;
}


3481
3482
3483
# File 'lib/dsp/dsp_protocol.rb', line 3481

def request_seq
  @request_seq
end

#seqObject

type: {



3469
3470
3471
# File 'lib/dsp/dsp_protocol.rb', line 3469

def seq
  @seq
end

#successObject

type: {



3469
3470
3471
# File 'lib/dsp/dsp_protocol.rb', line 3469

def success
  @success
end

#typeObject

type: {



3469
3470
3471
# File 'lib/dsp/dsp_protocol.rb', line 3469

def type
  @type
end

Instance Method Details

#from_h!(value) ⇒ Object



3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
# File 'lib/dsp/dsp_protocol.rb', line 3488

def from_h!(value)
  value = {} if value.nil?
  self.body = value['body'] # Unknown type
  self.request_seq = value['request_seq']
  self.success = value['success'] # Unknown type
  self.command = value['command']
  self.message = value['message']
  self.seq = value['seq']
  self.type = value['type']
  self
end