meshtastic 0.0.130 → 0.0.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +84 -44
- data/README.md +2 -2
- data/lib/meshtastic/mqtt.rb +14 -6
- data/lib/meshtastic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d5c8125b93a40c6bf9c026e9772c358780efccd8c726429374f236dde76ee3e
|
|
4
|
+
data.tar.gz: dddc89b1ff453d5f1d632c08b829c423ae37d4da2eefbe73e486404abc7ba1bb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e5c6a5f73853b09707850e2d3f33bfd9cd93f35dc5db352589f384d5c246640b6bdd377ff054096bd94d5c5896953a47a2fa05ec03e10057ad075cd051d675ce
|
|
7
|
+
data.tar.gz: 186455cdf4cefe78b9d4711515675ee06f8664e4cb431e0865103a1ad6a6663484e754aa1358dd8442239e3ce74b9d57e7385b152ed6ef65d15518cd01a2b9ce
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2025-
|
|
3
|
+
# on 2025-10-22 13:51:38 UTC using RuboCop version 1.81.6.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -8,34 +8,63 @@
|
|
|
8
8
|
|
|
9
9
|
# Offense count: 1
|
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation
|
|
12
|
-
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
|
|
11
|
+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
|
|
13
12
|
Bundler/OrderedGems:
|
|
14
13
|
Exclude:
|
|
15
14
|
- 'Gemfile'
|
|
16
15
|
|
|
17
|
-
# Offense count:
|
|
16
|
+
# Offense count: 1
|
|
17
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
18
|
+
Layout/EmptyLineAfterGuardClause:
|
|
19
|
+
Exclude:
|
|
20
|
+
- 'lib/meshtastic/stream_interface.rb'
|
|
21
|
+
|
|
22
|
+
# Offense count: 24
|
|
23
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
24
|
+
Layout/EmptyLineAfterMagicComment:
|
|
25
|
+
Enabled: false
|
|
26
|
+
|
|
27
|
+
# Offense count: 24
|
|
28
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
29
|
+
Layout/EmptyLines:
|
|
30
|
+
Enabled: false
|
|
31
|
+
|
|
32
|
+
# Offense count: 23
|
|
33
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
34
|
+
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
|
35
|
+
# URISchemes: http, https
|
|
36
|
+
Layout/LineLength:
|
|
37
|
+
Enabled: false
|
|
38
|
+
|
|
39
|
+
# Offense count: 1
|
|
40
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
41
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
|
42
|
+
# SupportedStyles: space, no_space
|
|
43
|
+
# SupportedStylesForEmptyBraces: space, no_space
|
|
44
|
+
Layout/SpaceBeforeBlockBraces:
|
|
45
|
+
Exclude:
|
|
46
|
+
- 'lib/meshtastic/serial_interface.rb'
|
|
47
|
+
|
|
48
|
+
# Offense count: 48
|
|
18
49
|
# Configuration parameters: AllowComments, AllowEmptyLambdas.
|
|
19
50
|
Lint/EmptyBlock:
|
|
20
51
|
Enabled: false
|
|
21
52
|
|
|
22
|
-
# Offense count:
|
|
53
|
+
# Offense count: 1
|
|
23
54
|
# This cop supports safe autocorrection (--autocorrect).
|
|
24
|
-
# Configuration parameters:
|
|
25
|
-
|
|
55
|
+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
|
|
56
|
+
# NotImplementedExceptions: NotImplementedError
|
|
57
|
+
Lint/UnusedMethodArgument:
|
|
26
58
|
Exclude:
|
|
27
|
-
- 'lib/meshtastic/
|
|
28
|
-
- 'meshtastic.gemspec'
|
|
59
|
+
- 'lib/meshtastic/stream_interface.rb'
|
|
29
60
|
|
|
30
|
-
# Offense count:
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
-
Metrics/BlockLength:
|
|
61
|
+
# Offense count: 8
|
|
62
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
63
|
+
Lint/UselessAssignment:
|
|
34
64
|
Exclude:
|
|
35
|
-
- '
|
|
36
|
-
- 'lib/meshtastic/
|
|
37
|
-
- '
|
|
38
|
-
- 'lib/meshtastic/module_config_pb.rb'
|
|
65
|
+
- 'lib/meshtastic/serial_interface.rb'
|
|
66
|
+
- 'lib/meshtastic/stream_interface.rb'
|
|
67
|
+
- 'meshtastic.gemspec'
|
|
39
68
|
|
|
40
69
|
# Offense count: 1
|
|
41
70
|
# Configuration parameters: CountComments, Max, CountAsOne.
|
|
@@ -43,50 +72,61 @@ Metrics/ClassLength:
|
|
|
43
72
|
Exclude:
|
|
44
73
|
- 'lib/meshtastic/mesh_interface.rb'
|
|
45
74
|
|
|
46
|
-
# Offense count:
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
|
|
75
|
+
# Offense count: 2
|
|
76
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
77
|
+
# Configuration parameters: Keywords, RequireColon.
|
|
78
|
+
# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
|
|
79
|
+
Style/CommentAnnotation:
|
|
51
80
|
Exclude:
|
|
52
|
-
- 'lib/meshtastic/
|
|
53
|
-
- 'lib/meshtastic/mesh_pb.rb'
|
|
54
|
-
- 'lib/meshtastic/module_config_pb.rb'
|
|
55
|
-
- 'lib/nanopb_pb.rb'
|
|
81
|
+
- 'lib/meshtastic/stream_interface.rb'
|
|
56
82
|
|
|
57
|
-
# Offense count:
|
|
83
|
+
# Offense count: 25
|
|
58
84
|
# Configuration parameters: AllowedConstants.
|
|
59
85
|
Style/Documentation:
|
|
60
86
|
Enabled: false
|
|
61
87
|
|
|
62
|
-
# Offense count:
|
|
88
|
+
# Offense count: 1
|
|
63
89
|
# This cop supports safe autocorrection (--autocorrect).
|
|
64
90
|
Style/ExplicitBlockArgument:
|
|
65
91
|
Exclude:
|
|
66
|
-
- 'lib/meshtastic/
|
|
92
|
+
- 'lib/meshtastic/serial_interface.rb'
|
|
67
93
|
|
|
68
|
-
# Offense count:
|
|
69
|
-
# This cop supports
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Enabled: false
|
|
94
|
+
# Offense count: 1
|
|
95
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
96
|
+
Style/IfUnlessModifier:
|
|
97
|
+
Exclude:
|
|
98
|
+
- 'lib/meshtastic/stream_interface.rb'
|
|
74
99
|
|
|
75
|
-
# Offense count:
|
|
100
|
+
# Offense count: 29
|
|
76
101
|
# This cop supports safe autocorrection (--autocorrect).
|
|
77
|
-
|
|
78
|
-
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
|
79
|
-
# SupportedShorthandSyntax: always, never, either, consistent, either_consistent
|
|
80
|
-
Style/HashSyntax:
|
|
102
|
+
Style/RedundantConstantBase:
|
|
81
103
|
Enabled: false
|
|
82
104
|
|
|
83
|
-
# Offense count:
|
|
105
|
+
# Offense count: 1
|
|
84
106
|
# This cop supports safe autocorrection (--autocorrect).
|
|
85
|
-
Style/
|
|
107
|
+
Style/RedundantSelf:
|
|
108
|
+
Exclude:
|
|
109
|
+
- 'lib/meshtastic/stream_interface.rb'
|
|
110
|
+
|
|
111
|
+
# Offense count: 12
|
|
112
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
113
|
+
Style/RedundantStringEscape:
|
|
114
|
+
Exclude:
|
|
115
|
+
- 'lib/meshtastic/admin_pb.rb'
|
|
116
|
+
- 'lib/meshtastic/deviceonly_pb.rb'
|
|
117
|
+
- 'lib/meshtastic/mesh_pb.rb'
|
|
118
|
+
- 'lib/meshtastic/module_config_pb.rb'
|
|
119
|
+
- 'lib/meshtastic/telemetry_pb.rb'
|
|
120
|
+
|
|
121
|
+
# Offense count: 3
|
|
122
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
123
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
|
124
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
|
125
|
+
Style/SafeNavigation:
|
|
86
126
|
Exclude:
|
|
87
|
-
- 'lib/
|
|
127
|
+
- 'lib/meshtastic/stream_interface.rb'
|
|
88
128
|
|
|
89
|
-
# Offense count:
|
|
129
|
+
# Offense count: 182
|
|
90
130
|
# This cop supports safe autocorrection (--autocorrect).
|
|
91
131
|
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
|
92
132
|
# SupportedStyles: single_quotes, double_quotes
|
data/README.md
CHANGED
|
@@ -44,7 +44,7 @@ mqtt_obj = Meshastic::MQTT.connect
|
|
|
44
44
|
Meshtastic::MQTT.subscribe(
|
|
45
45
|
mqtt_obj: mqtt_obj,
|
|
46
46
|
region: 'US',
|
|
47
|
-
|
|
47
|
+
topic: '2/e/LongFast/#',
|
|
48
48
|
psks: { LongFast: 'AQ==' }
|
|
49
49
|
) do |message|
|
|
50
50
|
puts message.inspect
|
|
@@ -76,7 +76,7 @@ mqtt_obj = Meshastic::MQTT.connect
|
|
|
76
76
|
Meshtastic::MQTT.subscribe(
|
|
77
77
|
mqtt_obj: mqtt_obj,
|
|
78
78
|
region: 'US',
|
|
79
|
-
|
|
79
|
+
topic: '2/e/LongFast/#',
|
|
80
80
|
psks: { LongFast: 'AQ==' },
|
|
81
81
|
include: '!YOUR_CLIENT_ID'
|
|
82
82
|
) do |message|
|
data/lib/meshtastic/mqtt.rb
CHANGED
|
@@ -253,7 +253,9 @@ module Meshtastic
|
|
|
253
253
|
# mqtt_obj: 'required - mqtt_obj returned from #connect method',
|
|
254
254
|
# from: 'required - From ID (String or Integer) (Default: "!00000b0b")',
|
|
255
255
|
# to: 'optional - Destination ID (Default: "!ffffffff")',
|
|
256
|
-
#
|
|
256
|
+
# root_topic: 'optional - root topic (default: msh)',
|
|
257
|
+
# region: 'optional - region e.g. "US/VA", etc (default: US)',
|
|
258
|
+
# topic: 'optional - topic to publish to (default: "2/e/LongFast")',
|
|
257
259
|
# channel: 'optional - channel (Default: 6)',
|
|
258
260
|
# text: 'optional - Text Message (Default: SYN)',
|
|
259
261
|
# want_ack: 'optional - Want Acknowledgement (Default: false)',
|
|
@@ -264,16 +266,20 @@ module Meshtastic
|
|
|
264
266
|
# )
|
|
265
267
|
public_class_method def self.send_text(opts = {})
|
|
266
268
|
mqtt_obj = opts[:mqtt_obj]
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
269
|
+
opts[:from] ||= mqtt_obj.client_id
|
|
270
|
+
opts[:to] ||= '!ffffffff'
|
|
271
|
+
opts[:root_topic] ||= 'msh'
|
|
272
|
+
opts[:region] ||= 'US'
|
|
273
|
+
opts[:topic] ||= '2/e/LongFast'
|
|
274
|
+
opts[:channel] ||= 6
|
|
275
|
+
absolute_topic = "#{opts[:root_topic]}/#{opts[:region]}/#{opts[:topic]}/#{opts[:from]}"
|
|
270
276
|
opts[:via] = :mqtt
|
|
271
277
|
|
|
272
278
|
# TODO: Implement chunked message to deal with large messages
|
|
273
279
|
mui = Meshtastic::MeshInterface.new
|
|
274
280
|
protobuf_text = mui.send_text(opts)
|
|
275
281
|
|
|
276
|
-
mqtt_obj.publish(
|
|
282
|
+
mqtt_obj.publish(absolute_topic, protobuf_text)
|
|
277
283
|
rescue StandardError => e
|
|
278
284
|
raise e
|
|
279
285
|
end
|
|
@@ -331,7 +337,9 @@ module Meshtastic
|
|
|
331
337
|
mqtt_obj: 'required - mqtt_obj returned from #connect method',
|
|
332
338
|
from: 'required - From ID (String or Integer) (Default: \"!00000b0b\")',
|
|
333
339
|
to: 'optional - Destination ID (Default: \"!ffffffff\")',
|
|
334
|
-
|
|
340
|
+
root_topic: 'optional - root topic (default: msh)',
|
|
341
|
+
region: 'optional - region e.g. 'US/VA', etc (default: US)',
|
|
342
|
+
topic: 'optional - topic to publish to (default: '2/e/LongFast')',
|
|
335
343
|
channel: 'optional - channel (Default: 6)',
|
|
336
344
|
text: 'optional - Text Message (Default: SYN)',
|
|
337
345
|
want_ack: 'optional - Want Acknowledgement (Default: false)',
|
data/lib/meshtastic/version.rb
CHANGED