class Peak::TncPort

Attributes

identifier[R]
name[R]
net[R]
port[R]

Public Class Methods

new(data_stream, name, identifier, net, echo_frames = 'none', port=0) click to toggle source
# File lib/peak/tnc_port.rb, line 6
def initialize(data_stream, name, identifier, net, echo_frames = 'none', port=0)
    @data_stream = data_stream
    @port = port
    @name = name
    @identifier = identifier
    @net = net
    @echo_frames = echo_frames
end

Public Instance Methods

close(*args, **kwargs) click to toggle source
# File lib/peak/tnc_port.rb, line 21
def close(*args, **kwargs)
    @data_stream.close(*args, **kwargs)
end
connect(*args, **kwargs) click to toggle source
# File lib/peak/tnc_port.rb, line 16
def connect(*args, **kwargs)
    @data_stream.connect(*args, **kwargs)
end
read(*args, **kwargs) click to toggle source
# 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) click to toggle source
# 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