Class: TxFrame
Overview
This defines a frame to be transmitted using fldigi. You need to supply the originating call sign (from), the destination call sign (to), the type of frame (see constants above), and the actual data to be transmitted.
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.
-
#userdata ⇒ Object
Returns the value of attribute userdata.
-
#wiredata ⇒ Object
Returns the value of attribute wiredata.
Attributes inherited from Frame
Instance Method Summary collapse
-
#initialize(from, to, type, userdata) ⇒ TxFrame
constructor
A new instance of TxFrame.
Methods inherited from Frame
Constructor Details
#initialize(from, to, type, userdata) ⇒ TxFrame
Returns a new instance of TxFrame.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/hamnet.rb', line 63 def initialize(from, to, type, userdata) # Create the object. super(from, to, type) @userdata=userdata # Do the needful with the payload. case @type when FRAME_SIMPLE =@from+@to+@type.to_s+@userdata @crc=Zlib::crc32().to_s(16).downcase when FRAME_BASE64 =@from+@to+@type.to_s+Base64::strict_encode64(@userdata) @crc=Zlib::crc32().to_s(16).downcase when FRAME_COMPRESSED_BASE64 =@from+@to+@type.to_s+Base64::strict_encode64(Zlib::Deflate.deflate(@userdata,Zlib::BEST_COMPRESSION)) @crc=Zlib::crc32().to_s(16).downcase else return false end # Set the rest of the fields, and done. @wiredata="<<<#{}#{@crc}>>>" @valid=true end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
61 62 63 |
# File 'lib/hamnet.rb', line 61 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
61 62 63 |
# File 'lib/hamnet.rb', line 61 def to @to end |
#type ⇒ Object
Returns the value of attribute type.
61 62 63 |
# File 'lib/hamnet.rb', line 61 def type @type end |
#userdata ⇒ Object
Returns the value of attribute userdata.
61 62 63 |
# File 'lib/hamnet.rb', line 61 def userdata @userdata end |
#wiredata ⇒ Object
Returns the value of attribute wiredata.
61 62 63 |
# File 'lib/hamnet.rb', line 61 def wiredata @wiredata end |