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. Eight bytes (allowing for “WA0AAA-0”) To field. Eight bytes (allowing for “WB0BBB-0”) Type field. One byte (numeric) specifying encoding, compression. 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
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
-
#type ⇒ Object
Returns the value of attribute type.
-
#valid ⇒ Object
Returns the value of attribute valid.
Instance Method Summary collapse
-
#initialize(from, to, type) ⇒ Frame
constructor
A new instance of Frame.
- #to_s ⇒ Object
Constructor Details
#initialize(from, to, type) ⇒ Frame
Returns a new instance of Frame.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/hamnet.rb', line 34 def initialize(from, to, type) @from=from.downcase @to=to.downcase @type=type @wiredata=nil @userdata=nil @crc=nil @valid=nil while @from.length<8 @from=@from+":" end while @to.length<8 @to=@to+":" end end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
32 33 34 |
# File 'lib/hamnet.rb', line 32 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
32 33 34 |
# File 'lib/hamnet.rb', line 32 def to @to end |
#type ⇒ Object
Returns the value of attribute type.
32 33 34 |
# File 'lib/hamnet.rb', line 32 def type @type end |
#valid ⇒ Object
Returns the value of attribute valid.
32 33 34 |
# File 'lib/hamnet.rb', line 32 def valid @valid end |
Instance Method Details
#to_s ⇒ Object
51 52 53 |
# File 'lib/hamnet.rb', line 51 def to_s return @wiredata end |