Class: Peak::TncPort
- Inherits:
-
Object
- Object
- Peak::TncPort
- Defined in:
- lib/peak/tnc_port.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#net ⇒ Object
readonly
Returns the value of attribute net.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
- #close(*args, **kwargs) ⇒ Object
- #connect(*args, **kwargs) ⇒ Object
- #read(*args, **kwargs) ⇒ Object
- #write(frame, *args, **kwargs) ⇒ Object
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
42 43 44 |
# File 'lib/peak/tnc_port.rb', line 42 def identifier @identifier end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
42 43 44 |
# File 'lib/peak/tnc_port.rb', line 42 def name @name end |
#net ⇒ Object (readonly)
Returns the value of attribute net.
42 43 44 |
# File 'lib/peak/tnc_port.rb', line 42 def net @net end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
42 43 44 |
# File 'lib/peak/tnc_port.rb', line 42 def port @port end |
Instance Method Details
#close(*args, **kwargs) ⇒ Object
21 22 23 |
# File 'lib/peak/tnc_port.rb', line 21 def close(*args, **kwargs) @data_stream.close(*args, **kwargs) end |
#connect(*args, **kwargs) ⇒ Object
16 17 18 |
# File 'lib/peak/tnc_port.rb', line 16 def connect(*args, **kwargs) @data_stream.connect(*args, **kwargs) end |
#read(*args, **kwargs) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/peak/tnc_port.rb', line 26 def read(*args, **kwargs) read_frame = @data_stream.read(*args, **kwargs) if (@echo_frames == 'all' or @echo_frames == 'in') and read_frame Peak::echo_color_frame(read_frame, @name, true) end return read_frame end |
#write(frame, *args, **kwargs) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/peak/tnc_port.rb', line 35 def write(frame, *args, **kwargs) @data_stream.write(frame, @port, *args, **kwargs) if (@echo_frames == 'all' or @echo_frames == 'out') and frame Peak::echo_color_frame(frame, @name, false) end end |