Class: Peak::TncPort

Inherits:
Object
  • Object
show all
Defined in:
lib/peak/tnc_port.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



42
43
44
# File 'lib/peak/tnc_port.rb', line 42

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



42
43
44
# File 'lib/peak/tnc_port.rb', line 42

def name
  @name
end

#netObject (readonly)

Returns the value of attribute net.



42
43
44
# File 'lib/peak/tnc_port.rb', line 42

def net
  @net
end

#portObject (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