Class: PacketViaDMEM::Header::Received
- Inherits:
-
Object
- Object
- PacketViaDMEM::Header::Received
- Defined in:
- lib/packet_via_dmem/header/received.rb
Instance Attribute Summary collapse
-
#magic1 ⇒ Object
Returns the value of attribute magic1.
-
#magic2 ⇒ Object
Returns the value of attribute magic2.
-
#magic3 ⇒ Object
Returns the value of attribute magic3.
-
#msg_type ⇒ Object
Returns the value of attribute msg_type.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#port ⇒ Object
Returns the value of attribute port.
-
#size ⇒ Object
Returns the value of attribute size.
-
#stream ⇒ Object
Returns the value of attribute stream.
-
#table ⇒ Object
Returns the value of attribute table.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#magic1 ⇒ Object
Returns the value of attribute magic1.
4 5 6 |
# File 'lib/packet_via_dmem/header/received.rb', line 4 def magic1 @magic1 end |
#magic2 ⇒ Object
Returns the value of attribute magic2.
4 5 6 |
# File 'lib/packet_via_dmem/header/received.rb', line 4 def magic2 @magic2 end |
#magic3 ⇒ Object
Returns the value of attribute magic3.
4 5 6 |
# File 'lib/packet_via_dmem/header/received.rb', line 4 def magic3 @magic3 end |
#msg_type ⇒ Object
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 |
#offset ⇒ Object
Returns the value of attribute offset.
4 5 6 |
# File 'lib/packet_via_dmem/header/received.rb', line 4 def offset @offset end |
#port ⇒ Object
Returns the value of attribute port.
4 5 6 |
# File 'lib/packet_via_dmem/header/received.rb', line 4 def port @port end |
#size ⇒ Object
Returns the value of attribute size.
4 5 6 |
# File 'lib/packet_via_dmem/header/received.rb', line 4 def size @size end |
#stream ⇒ Object
Returns the value of attribute stream.
4 5 6 |
# File 'lib/packet_via_dmem/header/received.rb', line 4 def stream @stream end |
#table ⇒ Object
Returns the value of attribute table.
4 5 6 |
# File 'lib/packet_via_dmem/header/received.rb', line 4 def table @table end |
#type ⇒ Object
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 |