Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Peak
peak
Commits
6c880896
Commit
6c880896
authored
Sep 01, 2021
by
Jeffrey Phillips Freeman
💥
Browse files
Added configuration for controlling echo output on received APRS packets
parent
2d20abbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/peak/config_loader.rb
View file @
6c880896
...
...
@@ -99,11 +99,16 @@ module Peak
end
tnc_port
=
port_section
[
'tnc_port'
]
port_map
[
port_name
]
=
TncPort
.
new
(
kiss_tnc
,
port_name
,
port_identifier
,
port_net
,
true
,
tnc_port
)
unless
config_lookup_enforce
(
port_section
,
'echo'
)
return
nil
end
echo_state
=
port_section
[
'echo'
]
port_map
[
port_name
]
=
TncPort
.
new
(
kiss_tnc
,
port_name
,
port_identifier
,
port_net
,
echo_state
,
tnc_port
)
end
end
end
return
port_map
end
end
\ No newline at end of file
end
lib/peak/tnc_port.rb
View file @
6c880896
...
...
@@ -3,7 +3,7 @@ require 'peak/echo'
module
Peak
class
TncPort
protected
def
initialize
(
data_stream
,
name
,
identifier
,
net
,
echo_frames
=
false
,
port
=
0
)
def
initialize
(
data_stream
,
name
,
identifier
,
net
,
echo_frames
=
'none'
,
port
=
0
)
@data_stream
=
data_stream
@port
=
port
@name
=
name
...
...
@@ -25,7 +25,7 @@ module Peak
public
def
read
(
*
args
,
**
kwargs
)
read_frame
=
@data_stream
.
read
(
*
args
,
**
kwargs
)
if
@echo_frames
and
read_frame
if
(
@echo_frames
==
'all'
or
@echo_frames
==
'in'
)
and
read_frame
Peak
::
echo_color_frame
(
read_frame
,
@name
,
true
)
end
return
read_frame
...
...
@@ -34,11 +34,11 @@ module Peak
public
def
write
(
frame
,
*
args
,
**
kwargs
)
@data_stream
.
write
(
frame
,
@port
,
*
args
,
**
kwargs
)
if
@echo_frames
and
frame
if
(
@echo_frames
==
'all'
or
@echo_frames
==
'out'
)
and
frame
Peak
::
echo_color_frame
(
frame
,
@name
,
false
)
end
end
attr_reader
:name
,
:net
,
:port
,
:identifier
end
end
\ No newline at end of file
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment