ogn_client-ruby 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +4 -3
- data/CHANGELOG.md +22 -1
- data/README.md +35 -12
- data/lib/ogn_client/aprs.rb +1 -0
- data/lib/ogn_client/message.rb +12 -12
- data/lib/ogn_client/messages/comment.rb +1 -1
- data/lib/ogn_client/messages/receiver.rb +83 -22
- data/lib/ogn_client/messages/sender.rb +14 -9
- data/lib/ogn_client/version.rb +1 -1
- data/tasks/test.rake +21 -10
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a6d60e5f26f6b6c18c2e1f6e4aba695901e5473
|
4
|
+
data.tar.gz: 75e00d14055934f85c66acdd1c7046173425aeba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c1e7c3788ab24ead12e31e5cc67bd0a3a9b12cfef99885dd16cef31d5a780faf1e7f860f7d2efdbf958085904bd36d0ee7031493e15ae89624fce0cf321b8f7
|
7
|
+
data.tar.gz: fb2171f7a02881b8a12c160271172c9bb515e35b7498320ffa9f5ae624cd7baf31dbc0ff51d2f9ae96c2c13d0d88721a93cbf7e0669e1288ad8b8229241dd564
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.3.0
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
|
+
## 0.1.2
|
2
|
+
|
3
|
+
* support for receiver versions <= 0.2.5
|
4
|
+
* faster message parsing
|
5
|
+
* new sender and receiver attributes
|
6
|
+
* `Sender#power`
|
7
|
+
* `Receiver#voltage`
|
8
|
+
* `Receiver#amperage`
|
9
|
+
* `Receiver#senders`
|
10
|
+
* `Receiver#senders_visible`
|
11
|
+
* `Receiver#senders_invisible`
|
12
|
+
* `Receiver#voltage`
|
13
|
+
* `Receiver#senders_signal`
|
14
|
+
* `Receiver#senders_messages`
|
15
|
+
* `Receiver#good_and_bad_senders`
|
16
|
+
* `Receiver#good_senders`
|
17
|
+
* `Receiver#bad_senders`
|
18
|
+
* renamed receiver attributes
|
19
|
+
* `Receiver#manual_correction` -> `Receiver#rf_correction_manual`
|
20
|
+
* `Receiver#automatic_correction` -> `Receiver#rf_correction_automatic`
|
21
|
+
|
1
22
|
## 0.1.1
|
2
23
|
|
24
|
+
* supported receiver versions <= 0.2.4
|
3
25
|
* remove debug support and raise errors instead
|
4
26
|
* convert raw messages to UTF-8 before parsing
|
5
27
|
* new sender and receiver attributes
|
@@ -12,7 +34,6 @@
|
|
12
34
|
* renamed message attribute
|
13
35
|
* `Message#speed` -> `Message#ground_speed`
|
14
36
|
* verification of supported receiver version
|
15
|
-
* supported receiver versions <= 0.2.5
|
16
37
|
|
17
38
|
## 0.1.0
|
18
39
|
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
[![Continuous Integration](https://img.shields.io/travis/svoop/ogn_client-ruby/master.svg?style=flat)](https://travis-ci.org/svoop/ogn_client-ruby)
|
3
3
|
[![Code Climate](https://img.shields.io/codeclimate/github/svoop/ogn_client-ruby.svg?style=flat)](https://codeclimate.com/github/svoop/ogn_client-ruby)
|
4
4
|
[![Gitter](https://img.shields.io/gitter/room/svoop/ogn_client-ruby.svg?style=flat)](https://gitter.im/svoop/ogn_client-ruby)
|
5
|
+
[![Donorbox](https://img.shields.io/badge/donate-on donorbox-yellow.svg)](https://donorbox.org/bitcetera-ogn_client-ruby)
|
5
6
|
|
6
7
|
# ogn_client-ruby
|
7
8
|
|
@@ -10,7 +11,7 @@
|
|
10
11
|
* Author: [Sven Schwyn](http://bitcetera.com)
|
11
12
|
* Homepage: https://github.com/svoop/ogn_client-ruby
|
12
13
|
|
13
|
-
:loudspeaker: A word from the shameless commerce division: Looking for a freelance Ruby developer?
|
14
|
+
:loudspeaker: A word from the shameless commerce division: Looking for a freelance Ruby developer? Surf to http://bitcetera.com and contact Sven. Or [show your support with a donation](https://donorbox.org/bitcetera-ogn_client-ruby). Yes, we do sponsored features, too.
|
14
15
|
|
15
16
|
## Installation
|
16
17
|
|
@@ -69,14 +70,15 @@ Attributes:
|
|
69
70
|
* **altitude** - WGS84 meters above mean see level QNH
|
70
71
|
* **heading** - degrees from 1 to 360
|
71
72
|
* **ground_speed** - kilometers per hour
|
72
|
-
* **stealth_mode** - boolean (should always be false)
|
73
|
-
* **no_tracking** - boolean
|
74
73
|
* **sender_type** - see [SENDER_TYPES](https://github.com/svoop/ogn_client-ruby/blob/master/lib/ogn_client/messages/sender.rb)
|
75
74
|
* **address_type** - see [ADDRESS_TYPES](https://github.com/svoop/ogn_client-ruby/blob/master/lib/ogn_client/messages/sender.rb)
|
76
75
|
* **id** - device ID
|
76
|
+
* **stealth_mode** - boolean (should always be false)
|
77
|
+
* **no_tracking** - boolean
|
78
|
+
* **flight_level** - 100 feet QNE
|
77
79
|
* **climb_rate** - meters per second
|
78
80
|
* **turn_rate** - revolutions per minute
|
79
|
-
* **
|
81
|
+
* **power** - power ratio in dBm
|
80
82
|
* **signal** - signal to noise ratio in decibel
|
81
83
|
* **errors** - number of CRC errors
|
82
84
|
* **frequency_offset** - kilohertz
|
@@ -107,7 +109,20 @@ Attributes:
|
|
107
109
|
* **ram_total** - megabytes
|
108
110
|
* **ntp_offset** - milliseconds
|
109
111
|
* **ntp_correction** - parts-per-million
|
112
|
+
* **voltage** - board voltage in V
|
113
|
+
* **amperage** - board amperage in A
|
114
|
+
* **rf_correction_manual** - manual frequency correction as per configuration
|
115
|
+
* **rf_correction_automatic** - automatic frequency correction based on GSM
|
116
|
+
* **senders** - number of senders received within the last hour
|
117
|
+
* **visible_senders** - number of visible senders withint the last hour
|
118
|
+
* **invisible_senders** - number of invisible senders ("no-track" on device or "invisible" in database)
|
110
119
|
* **signal** - signal-to-noise ratio in decibel
|
120
|
+
* **senders_signal** - average signal-to-noise ratio across all senders
|
121
|
+
* **senders_messages** - number of messages analyzed to calculate the above
|
122
|
+
* **good_senders_signal** - average signal-to-noise ratio in decibel of good senders (transmitting properly) within the last 24 hours
|
123
|
+
* **good_and_bad_senders** - number of good and bad senders within the last 24 hours
|
124
|
+
* **good_senders** - number of good senders (transmitting properly) within the last 24 hours
|
125
|
+
* **bad_senders** - number of bad senders (not transmitting properly) within the last 24 hours
|
111
126
|
|
112
127
|
#### OGNClient::Comment
|
113
128
|
|
@@ -126,15 +141,21 @@ The following domain specific errors may be raised:
|
|
126
141
|
They all inherit from `OGNClient::Error`. An fault-tolerant subscription could therefore look as follows:
|
127
142
|
|
128
143
|
```ruby
|
144
|
+
require 'ogn_client'
|
145
|
+
|
129
146
|
logger = Logger.new('/tmp/ogn_client.log')
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
147
|
+
options = { callsign: 'ROCT', filter: 'r/47/2/500' }
|
148
|
+
loop do
|
149
|
+
OGNClient::APRS.start(options) do |aprs|
|
150
|
+
while raw = aprs.gets
|
151
|
+
begin
|
152
|
+
message = OGNClient::Message.parse aprs.gets
|
153
|
+
rescue OGNClient::Error => error
|
154
|
+
logger.error error.message
|
155
|
+
next
|
156
|
+
end
|
157
|
+
puts message.raw # do more interesting stuff here
|
136
158
|
end
|
137
|
-
puts message.raw
|
138
159
|
end
|
139
160
|
end
|
140
161
|
```
|
@@ -143,7 +164,9 @@ end
|
|
143
164
|
|
144
165
|
* Look for developers and users on [Gitter](https://gitter.im/svoop/ogn_client-ruby).
|
145
166
|
* Ask your questions on [Stackoverflow](https://stackoverflow.com/questions/ask?tags=ogn_client-ruby,ruby,gem).
|
146
|
-
*
|
167
|
+
* Annotated source code on [omniref](https://www.omniref.com/repositories/svoop/ogn_client-ruby)
|
168
|
+
* Bug reports, feature and pull requests are welcome on [GitHub](https://github.com/svoop/ogn_client-ruby).
|
169
|
+
* [Donations with Stripe or PayPal](https://donorbox.org/bitcetera-ogn_client-ruby) are welcome as well. If you prefer to sponsor a feature, please create an issue on [GitHub](https://github.com/svoop/ogn_client-ruby) first and state your intentions.
|
147
170
|
|
148
171
|
## Development
|
149
172
|
|
data/lib/ogn_client/aprs.rb
CHANGED
data/lib/ogn_client/message.rb
CHANGED
@@ -22,13 +22,12 @@ module OGNClient
|
|
22
22
|
class Message
|
23
23
|
|
24
24
|
POSITION_PATTERN = %r(^
|
25
|
-
(?<callsign
|
26
|
-
(?<receiver
|
25
|
+
(?<callsign>.+?)>APRS,(?:.+?,){1,2}
|
26
|
+
(?<receiver>.+?):[/>]
|
27
27
|
(?<time>\d{6})h
|
28
|
-
(?<latitude>\d{4}\.\d{2}[NS]).
|
29
|
-
(?<
|
30
|
-
(
|
31
|
-
/A=(?<altitude>\d{6})\s
|
28
|
+
(?:(?<latitude>\d{4}\.\d{2}[NS]).(?<longitude>\d{5}\.\d{2}[EW]).)?
|
29
|
+
(?:(?<heading>\d{3})/(?<ground_speed>\d{3}))?
|
30
|
+
(?:/A=(?<altitude>\d{6}))?\s+
|
32
31
|
(?:!W((?<latitude_enhancement>\d)(?<longitude_enhancement>\d))!)?
|
33
32
|
)x
|
34
33
|
|
@@ -47,7 +46,8 @@ module OGNClient
|
|
47
46
|
raw = raw.chomp.force_encoding('ASCII-8BIT').encode('UTF-8')
|
48
47
|
OGNClient::Sender.new.send(:parse, raw) ||
|
49
48
|
OGNClient::Receiver.new.send(:parse, raw) ||
|
50
|
-
OGNClient::Comment.new.send(:parse, raw)
|
49
|
+
OGNClient::Comment.new.send(:parse, raw) ||
|
50
|
+
fail(OGNClient::MessageError, "message payload parsing failed: `#{raw}'")
|
51
51
|
end
|
52
52
|
|
53
53
|
def to_s
|
@@ -58,16 +58,16 @@ module OGNClient
|
|
58
58
|
|
59
59
|
def parse(raw)
|
60
60
|
@raw = raw
|
61
|
-
|
61
|
+
raw.match POSITION_PATTERN do |match|
|
62
62
|
%i(callsign receiver time altitude).each do |attr|
|
63
|
-
send
|
63
|
+
send("#{attr}=", match[attr]) if match[attr]
|
64
64
|
end
|
65
65
|
self.heading = match[:heading] if match[:heading] && match[:heading] != '000'
|
66
66
|
self.ground_speed = match[:ground_speed] if match[:ground_speed] && match[:heading] != '000'
|
67
|
-
self.longitude = [match[:longitude], match[:longitude_enhancement]]
|
68
|
-
self.latitude = [match[:latitude], match[:latitude_enhancement]]
|
67
|
+
self.longitude = [match[:longitude], match[:longitude_enhancement]] if match[:longitude]
|
68
|
+
self.latitude = [match[:latitude], match[:latitude_enhancement]] if match[:latitude]
|
69
69
|
self
|
70
|
-
end
|
70
|
+
end or fail(OGNClient::MessageError, "message position parsing failed: `#{@raw}'")
|
71
71
|
self
|
72
72
|
end
|
73
73
|
|
@@ -9,38 +9,63 @@ module OGNClient
|
|
9
9
|
\s)?
|
10
10
|
CPU:(?<cpu_load>[\d.]+)\s
|
11
11
|
RAM:(?<ram_free>[\d.]+)/(?<ram_total>[\d.]+)MB\s
|
12
|
-
NTP:(?<ntp_offset>[\d.]+)ms/(?<ntp_correction>[+-][\d.]+)ppm\s
|
12
|
+
NTP:(?<ntp_offset>[\d.]+)ms/(?<ntp_correction>[+-][\d.]+)ppm\s
|
13
|
+
(?:(?<voltage>[\d.]+)V\s)?
|
14
|
+
(?:(?<amperage>[\d.]+)A\s)?
|
13
15
|
(?:(?<cpu_temperature>[+-][\d.]+)C\s*)?
|
16
|
+
(?:(?<visible_senders>\d+)/(?<senders>\d+)Acfts\[1h\]\s*)?
|
14
17
|
(?:RF:
|
15
18
|
(?:
|
16
|
-
(?<
|
17
|
-
(?<
|
19
|
+
(?<rf_correction_manual>[+-][\d]+)
|
20
|
+
(?<rf_correction_automatic>[+-][\d.]+)ppm/
|
18
21
|
)?
|
19
22
|
(?<signal>[+-][\d.]+)dB
|
23
|
+
(?:/(?<senders_signal>[+-][\d.]+)dB@10km\[(?<senders_messages>\d+)\])?
|
24
|
+
(?:/(?<good_senders_signal>[+-][\d.]+)dB@10km\[(?<good_senders>\d+)/(?<good_and_bad_senders>\d+)\])?
|
20
25
|
)?
|
21
26
|
$)x
|
22
27
|
|
23
28
|
SUPPORTED_RECEIVER_VERSION = Gem::Version.new('0.2.5')
|
24
29
|
|
25
|
-
attr_reader :version
|
26
|
-
attr_reader :platform
|
27
|
-
attr_reader :cpu_load
|
28
|
-
attr_reader :cpu_temperature
|
29
|
-
attr_reader :ram_free
|
30
|
-
attr_reader :ram_total
|
31
|
-
attr_reader :ntp_offset
|
32
|
-
attr_reader :ntp_correction
|
33
|
-
attr_reader :
|
34
|
-
attr_reader :
|
35
|
-
attr_reader :
|
30
|
+
attr_reader :version # software version as #<Gem::Version "major.minor.patch">
|
31
|
+
attr_reader :platform # e.g. "ARM"
|
32
|
+
attr_reader :cpu_load # as reported by "uptime"
|
33
|
+
attr_reader :cpu_temperature # degrees celsius
|
34
|
+
attr_reader :ram_free # megabytes
|
35
|
+
attr_reader :ram_total # megabytes
|
36
|
+
attr_reader :ntp_offset # milliseconds
|
37
|
+
attr_reader :ntp_correction # parts-per-million
|
38
|
+
attr_reader :voltage # board voltage in V
|
39
|
+
attr_reader :amperage # board amperage in A
|
40
|
+
attr_reader :rf_correction_manual # as per configuration
|
41
|
+
attr_reader :rf_correction_automatic # based on GSM
|
42
|
+
attr_reader :senders # number of senders within the last hour
|
43
|
+
attr_reader :visible_senders # number of visible senders within the last hour
|
44
|
+
attr_reader :signal # signal-to-noise ratio in decibel
|
45
|
+
attr_reader :senders_signal # average signal-to-noise ratio in decibel across all senders
|
46
|
+
attr_reader :senders_messages # number of messages analyzed to calculate the above
|
47
|
+
attr_reader :good_senders_signal # average signal-to-noise ratio in decibel of good senders (transmitting properly) within the last 24 hours
|
48
|
+
attr_reader :good_and_bad_senders # number of good and bad senders within the last 24 hours
|
49
|
+
attr_reader :good_senders # number of good senders (transmitting properly) within the last 24 hours
|
50
|
+
|
51
|
+
def invisible_senders
|
52
|
+
senders - visible_senders
|
53
|
+
rescue
|
54
|
+
nil
|
55
|
+
end
|
56
|
+
|
57
|
+
def bad_senders
|
58
|
+
good_and_bad_senders - good_senders
|
59
|
+
rescue
|
60
|
+
nil
|
61
|
+
end
|
36
62
|
|
37
63
|
private
|
38
64
|
|
39
65
|
def parse(raw)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
%i(version platform cpu_load cpu_temperature ram_free ram_total ntp_offset ntp_correction manual_correction automatic_correction signal).each do |attr|
|
66
|
+
raw.match RECEIVER_PATTERN do |match|
|
67
|
+
super unless @raw
|
68
|
+
%i(version platform cpu_load cpu_temperature ram_free ram_total ntp_offset ntp_correction voltage amperage rf_correction_manual rf_correction_automatic senders visible_senders signal senders_signal senders_messages good_senders_signal good_and_bad_senders good_senders).each do |attr|
|
44
69
|
send("#{attr}=", match[attr]) if match[attr]
|
45
70
|
end
|
46
71
|
self
|
@@ -81,18 +106,54 @@ module OGNClient
|
|
81
106
|
@ntp_correction = raw.to_f.round(2)
|
82
107
|
end
|
83
108
|
|
84
|
-
def
|
85
|
-
@
|
109
|
+
def voltage=(raw)
|
110
|
+
@voltage = raw.to_f.round(3)
|
111
|
+
end
|
112
|
+
|
113
|
+
def amperage=(raw)
|
114
|
+
@amperage = raw.to_f.round(3)
|
115
|
+
end
|
116
|
+
|
117
|
+
def rf_correction_manual=(raw)
|
118
|
+
@rf_correction_manual = raw.to_i
|
119
|
+
end
|
120
|
+
|
121
|
+
def rf_correction_automatic=(raw)
|
122
|
+
@rf_correction_automatic = raw.to_f.round(1)
|
123
|
+
end
|
124
|
+
|
125
|
+
def senders=(raw)
|
126
|
+
@senders = raw.to_i
|
86
127
|
end
|
87
128
|
|
88
|
-
def
|
89
|
-
@
|
129
|
+
def visible_senders=(raw)
|
130
|
+
@visible_senders = raw.to_i
|
90
131
|
end
|
91
132
|
|
92
133
|
def signal=(raw)
|
93
134
|
@signal = raw.to_f.round(3)
|
94
135
|
end
|
95
136
|
|
137
|
+
def senders_signal=(raw)
|
138
|
+
@senders_signal = raw.to_f.round(3)
|
139
|
+
end
|
140
|
+
|
141
|
+
def senders_messages=(raw)
|
142
|
+
@senders_messages = raw.to_i
|
143
|
+
end
|
144
|
+
|
145
|
+
def good_senders_signal=(raw)
|
146
|
+
@good_senders_signal = raw.to_f.round(3)
|
147
|
+
end
|
148
|
+
|
149
|
+
def good_and_bad_senders=(raw)
|
150
|
+
@good_and_bad_senders = raw.to_i
|
151
|
+
end
|
152
|
+
|
153
|
+
def good_senders=(raw)
|
154
|
+
@good_senders = raw.to_i
|
155
|
+
end
|
156
|
+
|
96
157
|
end
|
97
158
|
|
98
159
|
end
|
@@ -14,6 +14,7 @@ module OGNClient
|
|
14
14
|
(?:s(?<flarm_software_version>[\d.]+)\s?)?
|
15
15
|
(?:h(?<flarm_hardware_version>[\dA-F]{2})\s?)?
|
16
16
|
(?:r(?<flarm_id>[\dA-F]+)\s?)?
|
17
|
+
(?:(?<power>[+-][\d.]+)dBm\s?)?
|
17
18
|
(?:hear(?<proximity>.+))?
|
18
19
|
$)x
|
19
20
|
|
@@ -41,14 +42,15 @@ module OGNClient
|
|
41
42
|
3 => :ogn
|
42
43
|
}
|
43
44
|
|
44
|
-
attr_reader :stealth_mode # boolean
|
45
|
-
attr_reader :no_tracking # boolean
|
46
45
|
attr_reader :sender_type # see SENDER_TYPES
|
47
46
|
attr_reader :address_type # see ADDRESS_TYPES
|
48
47
|
attr_reader :id # device ID
|
48
|
+
attr_reader :stealth_mode # boolean
|
49
|
+
attr_reader :no_tracking # boolean
|
50
|
+
attr_reader :flight_level # 100 feet QNE
|
49
51
|
attr_reader :climb_rate # meters per second
|
50
52
|
attr_reader :turn_rate # revolutions per minute
|
51
|
-
attr_reader :
|
53
|
+
attr_reader :power # power ratio in dBm
|
52
54
|
attr_reader :signal # signal to noise ratio in decibel
|
53
55
|
attr_reader :errors # number of CRC errors
|
54
56
|
attr_reader :frequency_offset # kilohertz
|
@@ -61,10 +63,9 @@ module OGNClient
|
|
61
63
|
private
|
62
64
|
|
63
65
|
def parse(raw)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
%i(details id climb_rate turn_rate flight_level signal errors frequency_offset gps_accuracy flarm_software_version flarm_hardware_version flarm_id proximity).each do |attr|
|
66
|
+
raw.match SENDER_PATTERN do |match|
|
67
|
+
super unless @raw
|
68
|
+
%i(details id flight_level climb_rate turn_rate power signal errors frequency_offset gps_accuracy flarm_software_version flarm_hardware_version flarm_id proximity).each do |attr|
|
68
69
|
send("#{attr}=", match[attr]) if match[attr]
|
69
70
|
end
|
70
71
|
# NOTE: [@svoop] [ruby21] workaround necessary until support for ruby21 is removed
|
@@ -86,6 +87,10 @@ module OGNClient
|
|
86
87
|
@id = raw
|
87
88
|
end
|
88
89
|
|
90
|
+
def flight_level=(raw)
|
91
|
+
@flight_level = raw.to_f.round(2)
|
92
|
+
end
|
93
|
+
|
89
94
|
def climb_rate=(raw)
|
90
95
|
@climb_rate = (raw.to_i / 60.0 / 3.2808).round(1)
|
91
96
|
end
|
@@ -94,8 +99,8 @@ module OGNClient
|
|
94
99
|
@turn_rate = (raw.to_i / 4.0).round(1)
|
95
100
|
end
|
96
101
|
|
97
|
-
def
|
98
|
-
@
|
102
|
+
def power=(raw)
|
103
|
+
@power = raw.to_f.round(3)
|
99
104
|
end
|
100
105
|
|
101
106
|
def signal=(raw)
|
data/lib/ogn_client/version.rb
CHANGED
data/tasks/test.rake
CHANGED
@@ -1,18 +1,29 @@
|
|
1
|
+
require 'ogn_client'
|
1
2
|
|
2
3
|
namespace :test do
|
3
4
|
|
5
|
+
desc "Receive and dump real-time APRS messages"
|
6
|
+
task :receiver do
|
7
|
+
OGNClient::APRS.start(callsign: "ROCT-#{rand(100)}") do |aprs|
|
8
|
+
loop do
|
9
|
+
print aprs.gets
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
4
14
|
desc "Parse real-time APRS messages and test the parser"
|
5
15
|
task :parser do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
callsign = "ROCT-#{rand(100)}"
|
17
|
+
loop do
|
18
|
+
OGNClient::APRS.start(callsign: callsign) do |aprs|
|
19
|
+
while raw = aprs.gets do
|
20
|
+
print '.'
|
21
|
+
begin
|
22
|
+
OGNClient::Message.parse raw
|
23
|
+
rescue OGNClient::Error => error
|
24
|
+
puts
|
25
|
+
warn "WARNING: #{error.message}"
|
26
|
+
end
|
16
27
|
end
|
17
28
|
end
|
18
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ogn_client-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Schwyn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -146,9 +146,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
149
|
+
rubygems_version: 2.5.1
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Subscriber and parser for APRS messages from OGN
|
153
153
|
test_files: []
|
154
|
-
has_rdoc:
|