peak 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: df65f4faa4d3b4e36b51a9d6b4a5bba37bb2c992
4
- data.tar.gz: 9b35a626888fe27afe140abe5dc0bef82d154ae7
2
+ SHA256:
3
+ metadata.gz: 2be0cb7af674767f2a268f5427409539eec1624a57f5ed8f0dfeef69c99792fd
4
+ data.tar.gz: cc79220db1b7bf56ea98d220c42b6f29b5862ae05087bc1851429c68f74951a5
5
5
  SHA512:
6
- metadata.gz: 712d1e69d00909111a9bca843918276148103c3372b69f1b08ec61176195edbd31f936c12eef7f7960b5f73a3730094f1937431215fc4f0ae38a34ecbb9c2b4d
7
- data.tar.gz: 8f3a5a14d1a7d28b2e16d1d6bde9df2d2a11b5a01d988d7ed0dcdf445fd56fd143a7d22aeb83cc34c615d2c28de7e9aac5f4c77a73359f6e1ae679b82181c7a0
6
+ metadata.gz: eb85c260e4bee7519cc6909eea953fbfcd108f93eaf702559ada7a907a45463428dc3bd34e1ad5217aa13857890c326cdc767407ddf15f504661164550d75e7d
7
+ data.tar.gz: e6461ea24e69edc1922cf11f9c0b1b66f14281b7cd3d218dc50030188fb09c057ca4d4ce733578618948c65802223be7e7a67e12091ec95e32921ea4d78e78cf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.3
4
+
5
+ * Fixed a bug where crossband digipeating would send the packet out on the same TNC rather than the intended TNC.
6
+ * Added configurable packet echoing to determine which packets get echoed onto the screen.
7
+ * Updated all depdendencies to their latest.
8
+
3
9
  ## 1.0.2
4
10
 
5
11
  * Added proper cleanup before exiting when a sigterm or sigint is received. This allows serial connections to be
@@ -16,4 +22,4 @@
16
22
 
17
23
  ## 1.0.0
18
24
 
19
- * Initial release
25
+ * Initial release
data/CONTRIBUTORS.md CHANGED
@@ -1,4 +1,5 @@
1
1
  * Jeffrey Phillips Freeman (WI2ARD) - http://JeffreyFreeman.me
2
+ * Greg Albrecht W2GMD <oss@undef.net>
2
3
  * Martin Murray (KD8LVZ)
3
4
  * Paul McMillan - https://github.com/PaulMcMillan
4
5
  * Russ Innes
data/README.rdoc CHANGED
@@ -7,7 +7,7 @@ Author:: Jeffrey Phillips Freeman, WI2ARD (freemo@gmail.com)
7
7
  Copyright:: Copyright (c) 2016 - present Syncleus, Inc.
8
8
 
9
9
  Peak is a full suite APRS client and reference implementation for the APEX protocol. APEX is a next generation APRS
10
- based protocol. This repository represents the official application implementing APEX. It is a full-feature application
10
+ based protocol. It is a full-feature application
11
11
  for digipeating, compatible with most AX.25 KISS TNC devices, and utilizing the full APEX stack.
12
12
 
13
13
  For more information on the project please check out {the project's home page}[http://apexprotocol.com/].
@@ -42,6 +42,147 @@ To install this gem onto your local machine, run <code>bundle exec rake install<
42
42
  version number in +app_info.rb+, and then run <code>bundle exec rake release</code>, which will create a git tag for the version,
43
43
  push git commits and tags, and push the +.gem+ file to {rubygems.org}[https://rubygems.org].
44
44
 
45
+ == Consistent ports
46
+
47
+ It is important that the ports associated with the TNCs be consistent between boots. To do this first get the info using `lsusb -v`,
48
+ for example you might get the following:
49
+
50
+ ```
51
+ Bus 001 Device 005: ID 0403:d011 Future Technology Devices International, Ltd SCS Position-Tracker/TNC
52
+ Couldn't open device, some information will be missing
53
+ Device Descriptor:
54
+ bLength 18
55
+ bDescriptorType 1
56
+ bcdUSB 2.00
57
+ bDeviceClass 0
58
+ bDeviceSubClass 0
59
+ bDeviceProtocol 0
60
+ bMaxPacketSize0 8
61
+ idVendor 0x0403 Future Technology Devices International, Ltd
62
+ idProduct 0xd011 SCS Position-Tracker/TNC
63
+ bcdDevice 6.00
64
+ iManufacturer 1 SCS
65
+ iProduct 2 SCS Tracker / DSP TNC
66
+ iSerial 3 PT5690Y
67
+ bNumConfigurations 1
68
+ Configuration Descriptor:
69
+ bLength 9
70
+ bDescriptorType 2
71
+ wTotalLength 0x0020
72
+ bNumInterfaces 1
73
+ bConfigurationValue 1
74
+ iConfiguration 0
75
+ bmAttributes 0xc0
76
+ Self Powered
77
+ MaxPower 0mA
78
+ Interface Descriptor:
79
+ bLength 9
80
+ bDescriptorType 4
81
+ bInterfaceNumber 0
82
+ bAlternateSetting 0
83
+ bNumEndpoints 2
84
+ bInterfaceClass 255 Vendor Specific Class
85
+ bInterfaceSubClass 255 Vendor Specific Subclass
86
+ bInterfaceProtocol 255 Vendor Specific Protocol
87
+ iInterface 2
88
+ Endpoint Descriptor:
89
+ bLength 7
90
+ bDescriptorType 5
91
+ bEndpointAddress 0x81 EP 1 IN
92
+ bmAttributes 2
93
+ Transfer Type Bulk
94
+ Synch Type None
95
+ Usage Type Data
96
+ wMaxPacketSize 0x0040 1x 64 bytes
97
+ bInterval 0
98
+ Endpoint Descriptor:
99
+ bLength 7
100
+ bDescriptorType 5
101
+ bEndpointAddress 0x02 EP 2 OUT
102
+ bmAttributes 2
103
+ Transfer Type Bulk
104
+ Synch Type None
105
+ Usage Type Data
106
+ wMaxPacketSize 0x0040 1x 64 bytes
107
+ bInterval 0
108
+
109
+ Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P
110
+ Couldn't open device, some information will be missing
111
+ Device Descriptor:
112
+ bLength 18
113
+ bDescriptorType 1
114
+ bcdUSB 1.10
115
+ bDeviceClass 0
116
+ bDeviceSubClass 0
117
+ bDeviceProtocol 0
118
+ bMaxPacketSize0 64
119
+ idVendor 0x067b Prolific Technology, Inc.
120
+ idProduct 0x2303 PL2303 Serial Port / Mobile Action MA-8910P
121
+ bcdDevice 3.00
122
+ iManufacturer 1 Prolific Technology Inc.
123
+ iProduct 2 USB-Serial Controller
124
+ iSerial 0
125
+ bNumConfigurations 1
126
+ Configuration Descriptor:
127
+ bLength 9
128
+ bDescriptorType 2
129
+ wTotalLength 0x0027
130
+ bNumInterfaces 1
131
+ bConfigurationValue 1
132
+ iConfiguration 0
133
+ bmAttributes 0x80
134
+ (Bus Powered)
135
+ MaxPower 100mA
136
+ Interface Descriptor:
137
+ bLength 9
138
+ bDescriptorType 4
139
+ bInterfaceNumber 0
140
+ bAlternateSetting 0
141
+ bNumEndpoints 3
142
+ bInterfaceClass 255 Vendor Specific Class
143
+ bInterfaceSubClass 0
144
+ bInterfaceProtocol 0
145
+ iInterface 0
146
+ Endpoint Descriptor:
147
+ bLength 7
148
+ bDescriptorType 5
149
+ bEndpointAddress 0x81 EP 1 IN
150
+ bmAttributes 3
151
+ Transfer Type Interrupt
152
+ Synch Type None
153
+ Usage Type Data
154
+ wMaxPacketSize 0x000a 1x 10 bytes
155
+ bInterval 1
156
+ Endpoint Descriptor:
157
+ bLength 7
158
+ bDescriptorType 5
159
+ bEndpointAddress 0x02 EP 2 OUT
160
+ bmAttributes 2
161
+ Transfer Type Bulk
162
+ Synch Type None
163
+ Usage Type Data
164
+ wMaxPacketSize 0x0040 1x 64 bytes
165
+ bInterval 0
166
+ Endpoint Descriptor:
167
+ bLength 7
168
+ bDescriptorType 5
169
+ bEndpointAddress 0x83 EP 3 IN
170
+ bmAttributes 2
171
+ Transfer Type Bulk
172
+ Synch Type None
173
+ Usage Type Data
174
+ wMaxPacketSize 0x0040 1x 64 bytes
175
+ bInterval 0
176
+ ```
177
+
178
+ Then add the appropriate rules under `/etc/udev/` to ensure they get a special static symlink. For example for the
179
+ above output the udev rule would look as follows.
180
+
181
+ ```
182
+ SUBSYSTEM=="tty", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="ttyUSB-kenwood"
183
+ SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="d011", ATTRS{serial}=="PT5690Y", SYMLINK+="ttyUSB-scs"
184
+ ```
185
+
45
186
  == Links
46
187
 
47
188
  * {Source on Github}[https://github.com/Syncleus/peak]
data/Rakefile CHANGED
@@ -24,12 +24,12 @@ def dump_load_path
24
24
  end
25
25
  end
26
26
 
27
- gem 'json', '~> 1.8.3'
27
+ gem 'json', '~> 2.5'
28
28
 
29
- gem 'bundler', '~> 1.7'
29
+ gem 'bundler', '~> 2.2'
30
30
  require 'bundler'
31
31
 
32
- gem 'rake', '~> 11.3.0'
32
+ gem 'rake', '~> 13.0'
33
33
  require 'rake/clean'
34
34
  require 'rake/testtask'
35
35
 
data/lib/peak/app_info.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Peak
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -99,11 +99,16 @@ module Peak
99
99
  end
100
100
  tnc_port = port_section['tnc_port']
101
101
 
102
- port_map[port_name] = TncPort.new(kiss_tnc, port_name, port_identifier, port_net, true, tnc_port)
102
+ unless config_lookup_enforce(port_section, 'echo')
103
+ return nil
104
+ end
105
+ echo_state = port_section['echo']
106
+
107
+ port_map[port_name] = TncPort.new(kiss_tnc, port_name, port_identifier, port_net, echo_state, tnc_port)
103
108
  end
104
109
  end
105
110
  end
106
111
 
107
112
  return port_map
108
113
  end
109
- end
114
+ end
@@ -7,6 +7,7 @@ module Peak
7
7
  @next_target = next_target
8
8
  @config = config
9
9
  @frame_port = frame_port
10
+ @destination_port = frame_port
10
11
 
11
12
  @port_info = {}
12
13
  config.each do |section_name, section_content|
@@ -200,30 +201,6 @@ module Peak
200
201
  end
201
202
  end
202
203
 
203
- protected
204
- def filter(*args)
205
- args = Rules.args_parser(*args)
206
- do_next_target(args[:next_target])
207
- end
208
-
209
- protected
210
- def consume_next_hop(*args)
211
- args = Rules.args_parser(*args)
212
-
213
- if has_next_hop? and args[:condition]
214
- catch(:done) do
215
- @frame[:path].each do |hop|
216
- unless hop.end_with? '*'
217
- hop << '*'
218
- throw :done
219
- end
220
- end
221
- end
222
- end
223
-
224
- do_next_target(args[:next_target])
225
- end
226
-
227
204
  private
228
205
  def self.consume_new_paradigm(hop)
229
206
  hop_split = hop.split('-')
@@ -237,6 +214,12 @@ module Peak
237
214
  end
238
215
  end
239
216
 
217
+ protected
218
+ def filter(*args)
219
+ args = Rules.args_parser(*args)
220
+ do_next_target(args[:next_target])
221
+ end
222
+
240
223
  protected
241
224
  def route(*args, preemptive: nil)
242
225
  args = Rules.args_parser(*args)
@@ -266,10 +249,13 @@ module Peak
266
249
  end
267
250
 
268
251
 
252
+ target = nil
269
253
  next_hop = select_next_hop(@frame[:path])
270
254
  if all_my_names.include? next_hop.upcase or Rules.is_hop_old_paradigm?(next_hop, old_paradigm)
255
+ target = next_hop.dup
271
256
  next_hop << '*'
272
257
  elsif Rules.is_hop_new_paradigm?(next_hop, new_paradigm)
258
+ target = next_hop.dup
273
259
  Rules.consume_new_paradigm(next_hop)
274
260
  end
275
261
 
@@ -280,11 +266,24 @@ module Peak
280
266
  if detected
281
267
  hop << '*'
282
268
  elsif identifiers.include? hop.upcase
269
+ target = hop.dup
283
270
  hop << '*'
284
271
  detected = true
285
272
  end
286
273
  end
287
274
  end
275
+
276
+ if target
277
+ @port_info.each do |name, info|
278
+ identifier = info[:port_identifier].upcase
279
+ net_freq = info[:port_net]
280
+ net_band = net_freq.dup.gsub(/M\d{0,3}$/i, 'M')
281
+
282
+ if target == identifier or target == net_freq or target == net_band
283
+ @destination_port = @frame_port
284
+ end
285
+ end
286
+ end
288
287
  end
289
288
 
290
289
  do_next_target(args[:next_target])
@@ -610,7 +609,7 @@ module Peak
610
609
  end
611
610
 
612
611
  public
613
- attr_reader :next_target, :frame
612
+ attr_reader :next_target, :frame, :destination_port
614
613
  end
615
614
 
616
615
  class Route
@@ -618,17 +617,17 @@ module Peak
618
617
 
619
618
  public
620
619
  def self.inbound_chain(&block)
621
- @@chains[:inbound] = {:target => :input, :block => block}
620
+ @@chains[:inbound] = block
622
621
  end
623
622
 
624
623
  public
625
624
  def self.outbound_chain(&block)
626
- @@chains[:outbound] = {:target => :output, :block => block}
625
+ @@chains[:outbound] = block
627
626
  end
628
627
 
629
628
  public
630
- def self.side_chain(name, target, &block)
631
- @@chains[name] = {:target => target, :block => block}
629
+ def self.side_chain(name, &block)
630
+ @@chains[name] = block
632
631
  end
633
632
 
634
633
  public
@@ -648,10 +647,9 @@ module Peak
648
647
  filter :output # if this werent here packet would be dropped
649
648
  }
650
649
 
651
- Route.side_chain(:forward, :output) {
650
+ Route.side_chain(:forward) {
652
651
  filter seen?, :drop
653
- filter future_hop_me?, :pass, :drop
654
- route :output
652
+ route future_hop_me?, :output, :drop
655
653
  }
656
654
 
657
655
  # ==== Exiting custom code ========
@@ -668,7 +666,7 @@ module Peak
668
666
  more = true
669
667
  while more and rules.next_target != :input and rules.next_target != :output and rules.next_target != :drop
670
668
  catch(:new_target) do
671
- rules.instance_eval &@@chains[rules.next_target][:block]
669
+ rules.instance_eval &@@chains[rules.next_target]
672
670
  more = false
673
671
  end
674
672
  end
@@ -678,7 +676,7 @@ module Peak
678
676
  end
679
677
 
680
678
  {
681
- :output_target => rules.next_target == :output ? name : nil,
679
+ :output_target => rules.next_target == :output ? rules.destination_port : nil,
682
680
  :frame => rules.frame
683
681
  }
684
682
  end
data/lib/peak/tnc_port.rb CHANGED
@@ -3,7 +3,7 @@ require 'peak/echo'
3
3
  module Peak
4
4
  class TncPort
5
5
  protected
6
- def initialize(data_stream, name, identifier, net, echo_frames=false, port=0)
6
+ def initialize(data_stream, name, identifier, net, echo_frames = 'none', port=0)
7
7
  @data_stream = data_stream
8
8
  @port = port
9
9
  @name = name
@@ -25,7 +25,7 @@ module Peak
25
25
  public
26
26
  def read(*args, **kwargs)
27
27
  read_frame = @data_stream.read(*args, **kwargs)
28
- if @echo_frames and read_frame
28
+ if (@echo_frames == 'all' or @echo_frames == 'in') and read_frame
29
29
  Peak::echo_color_frame(read_frame, @name, true)
30
30
  end
31
31
  return read_frame
@@ -34,11 +34,11 @@ module Peak
34
34
  public
35
35
  def write(frame, *args, **kwargs)
36
36
  @data_stream.write(frame, @port, *args, **kwargs)
37
- if @echo_frames and frame
37
+ if (@echo_frames == 'all' or @echo_frames == 'out') and frame
38
38
  Peak::echo_color_frame(frame, @name, false)
39
39
  end
40
40
  end
41
41
 
42
42
  attr_reader :name, :net, :port, :identifier
43
43
  end
44
- end
44
+ end
data/peak.gemspec CHANGED
@@ -30,10 +30,11 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ['lib']
31
31
 
32
32
  spec.add_dependency 'colorize', '~> 0.8'
33
- spec.add_dependency 'methadone', '~> 1.9'
33
+ spec.add_dependency 'methadone', '~> 2.0'
34
34
  spec.add_dependency 'apex-aprs', '~> 1.0'
35
- spec.add_development_dependency 'bundler', '~> 1.7'
36
- spec.add_development_dependency 'rake', '~> 11.3'
37
- spec.add_development_dependency 'rdoc', '~> 4.2'
38
- spec.add_development_dependency 'aruba', '~> 0.14'
35
+ spec.add_dependency 'aprs_is', '~> 0.1'
36
+ spec.add_development_dependency 'bundler', '~> 2.2'
37
+ spec.add_development_dependency 'rake', '~> 13.0'
38
+ spec.add_development_dependency 'rdoc', '~> 6.3'
39
+ spec.add_development_dependency 'aruba', '~> 2.0'
39
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peak
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Phillips Freeman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-09 00:00:00.000000000 Z
11
+ date: 2021-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.9'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.9'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: apex-aprs
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,62 +52,76 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: aprs_is
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.1'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '1.7'
75
+ version: '2.2'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '1.7'
82
+ version: '2.2'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - "~>"
74
88
  - !ruby/object:Gem::Version
75
- version: '11.3'
89
+ version: '13.0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
- version: '11.3'
96
+ version: '13.0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rdoc
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '4.2'
103
+ version: '6.3'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
108
  - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: '4.2'
110
+ version: '6.3'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: aruba
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: '0.14'
117
+ version: '2.0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: '0.14'
124
+ version: '2.0'
111
125
  description: Reference implementation for the APEX Radio protocol, which is itself
112
126
  an extension to the APRS protocol.
113
127
  email:
@@ -160,8 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
174
  - !ruby/object:Gem::Version
161
175
  version: '0'
162
176
  requirements: []
163
- rubyforge_project:
164
- rubygems_version: 2.5.1
177
+ rubygems_version: 3.2.5
165
178
  signing_key:
166
179
  specification_version: 4
167
180
  summary: Reference implementation for the APEX Radio protocol, an extension to APRS.