Class: Extface::Driver::DaisyFx1200::RespFrame

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
app/models/extface/driver/daisy_fx1200.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buffer) ⇒ RespFrame

Returns a new instance of RespFrame.



269
270
271
272
273
274
275
276
277
278
# File 'app/models/extface/driver/daisy_fx1200.rb', line 269

def initialize(buffer)
  # test Extface::Driver::DaisyFx1200::RespFrame.new("\x16\x16\x01\x2c\x20\x2dP\x04SSSSSS\x05\BBBB\x03")
  #                              LEN   SEQ   CMD DATA    STATUS      BCC
  if match = buffer.match(/\x01(.{1})(.{1})(.{1})(.*)\x04(.{6})\x05(.{4})\x03/n)
    @frame = match.to_a.first
    @len, @seq, @cmd, @data, @status, @bcc = match.captures
  else
    #TODO look for NAK
  end
end

Instance Attribute Details

#bccObject (readonly)

Returns the value of attribute bcc.



263
264
265
# File 'app/models/extface/driver/daisy_fx1200.rb', line 263

def bcc
  @bcc
end

#cmdObject (readonly)

Returns the value of attribute cmd.



263
264
265
# File 'app/models/extface/driver/daisy_fx1200.rb', line 263

def cmd
  @cmd
end

#dataObject (readonly)

Returns the value of attribute data.



263
264
265
# File 'app/models/extface/driver/daisy_fx1200.rb', line 263

def data
  @data
end

#frameObject (readonly)

Returns the value of attribute frame.



263
264
265
# File 'app/models/extface/driver/daisy_fx1200.rb', line 263

def frame
  @frame
end

#lenObject (readonly)

Returns the value of attribute len.



263
264
265
# File 'app/models/extface/driver/daisy_fx1200.rb', line 263

def len
  @len
end

#seqObject (readonly)

Returns the value of attribute seq.



263
264
265
# File 'app/models/extface/driver/daisy_fx1200.rb', line 263

def seq
  @seq
end

#statusObject (readonly)

Returns the value of attribute status.



263
264
265
# File 'app/models/extface/driver/daisy_fx1200.rb', line 263

def status
  @status
end