Class: Frame
- Inherits:
-
Object
- Object
- Frame
- Defined in:
- lib/hamnet.rb
Overview
This defines a basic frame of data for use with fldigi. The frame consists of:
Header field. Three bytes, consisting of “<<<” From field. Nine bytes (allowing for “WA0AAA-0”) To field. Nine bytes (allowing for “WB0BBB-0”) Type field. Two bytes (two hex digits) specifying encoding, compression. If the high-order bit is set, this is the last frame of a sequence (ie, wait for the other side). Sequence field. Two bytes (two hex digits) specifying sequence number. Data field. Arbitrary number of bytes of payload. CRC field. Last eight bytes, CRC32 checksum of From, To, Type, Data fields. Trailer field. Three bytes, consisting of “>>>”
Instance Attribute Summary collapse
-
#done ⇒ Object
Returns the value of attribute done.
-
#from ⇒ Object
Returns the value of attribute from.
-
#frompad ⇒ Object
Returns the value of attribute frompad.
-
#sequence ⇒ Object
Returns the value of attribute sequence.
-
#to ⇒ Object
Returns the value of attribute to.
-
#topad ⇒ Object
Returns the value of attribute topad.
-
#type ⇒ Object
Returns the value of attribute type.
-
#valid ⇒ Object
Returns the value of attribute valid.
Instance Method Summary collapse
-
#initialize(from, to, type, sequence, done) ⇒ Frame
constructor
A new instance of Frame.
- #to_s ⇒ Object
Constructor Details
#initialize(from, to, type, sequence, done) ⇒ Frame
Returns a new instance of Frame.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/hamnet.rb', line 43 def initialize(from, to, type, sequence, done) @from=from.downcase @to=to.downcase @type=type @sequence=sequence @done=done @wiredata=nil @userdata=nil @crc=nil @valid=false @frompad=@from while @frompad.length<9 @frompad=@frompad+":" end @topad=@to while @topad.length<9 @topad=@topad+":" end end |
Instance Attribute Details
#done ⇒ Object
Returns the value of attribute done.
41 42 43 |
# File 'lib/hamnet.rb', line 41 def done @done end |
#from ⇒ Object
Returns the value of attribute from.
41 42 43 |
# File 'lib/hamnet.rb', line 41 def from @from end |
#frompad ⇒ Object
Returns the value of attribute frompad.
41 42 43 |
# File 'lib/hamnet.rb', line 41 def frompad @frompad end |
#sequence ⇒ Object
Returns the value of attribute sequence.
41 42 43 |
# File 'lib/hamnet.rb', line 41 def sequence @sequence end |
#to ⇒ Object
Returns the value of attribute to.
41 42 43 |
# File 'lib/hamnet.rb', line 41 def to @to end |
#topad ⇒ Object
Returns the value of attribute topad.
41 42 43 |
# File 'lib/hamnet.rb', line 41 def topad @topad end |
#type ⇒ Object
Returns the value of attribute type.
41 42 43 |
# File 'lib/hamnet.rb', line 41 def type @type end |
#valid ⇒ Object
Returns the value of attribute valid.
41 42 43 |
# File 'lib/hamnet.rb', line 41 def valid @valid end |
Instance Method Details
#to_s ⇒ Object
65 66 67 |
# File 'lib/hamnet.rb', line 65 def to_s return @wiredata end |