Class: PacketViaDMEM::Header::Received

Inherits:
Object
  • Object
show all
Defined in:
lib/packet_via_dmem/header/received.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#magic1Object

Returns the value of attribute magic1.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def magic1
  @magic1
end

#magic2Object

Returns the value of attribute magic2.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def magic2
  @magic2
end

#magic3Object

Returns the value of attribute magic3.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def magic3
  @magic3
end

#msg_typeObject

Returns the value of attribute msg_type.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def msg_type
  @msg_type
end

#offsetObject

Returns the value of attribute offset.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def offset
  @offset
end

#portObject

Returns the value of attribute port.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def port
  @port
end

#sizeObject

Returns the value of attribute size.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def size
  @size
end

#streamObject

Returns the value of attribute stream.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def stream
  @stream
end

#tableObject

Returns the value of attribute table.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def table
  @table
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/packet_via_dmem/header/received.rb', line 4

def type
  @type
end

Instance Method Details

#to_s(packet_number = 1) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/packet_via_dmem/header/received.rb', line 15

def to_s(packet_number=1)
  str = ''
  str << '# RX %03d # '     % packet_number
  str << 'bytes: %d # '     % size if msg_type > 0
  str << 'stream: %d # '    % stream
  str << 'port: %x (%s) # ' % [port, port.divmod(64).join('/')]
  str << "type: %x\n"       % type
  str << '#          '
  str << 'table: %d # '     % table
  str << 'offset: %d # '    % offset
  str << 'magic: %x/%x'     % [magic1, magic2] if magic1
  str
end