meshtastic 0.0.11 → 0.0.12
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 +20 -6
- data/AUTOGEN_meshtastic_protobufs.sh +1 -1
- data/Gemfile +1 -0
- data/lib/meshtastic/version.rb +1 -1
- data/lib/meshtastic.rb +26 -22
- data/lib/nanopb_pb.rb +76 -0
- data/spec/lib/nanopb_pb_spec.rb +6 -0
- data/upgrade_Gemfile_gems.sh +10 -6
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 121b0a73d30f792b4da0cbd5b6ed91b648bc26ca3349cb47369fac738f837b03
|
|
4
|
+
data.tar.gz: a5ddf7b9969ab8c022107f84e192709c01441f5d78f4f011679b948dbe857006
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 110570d4591453df75c6d930df3c4ac3adcb06fd85e4354496fd093b080352754d6d8c7fb4e454989cd2ca0f27e4d53dd1664939b980fb3d59cb465d1afaec1e
|
|
7
|
+
data.tar.gz: 5be78bd5b710e9974708064eeccfd1563092051e66e1793b07fb34f3bc02687f4f483a79b3124d8d11cb43091bbc3076305bc8bf51b11373ab44686c1fd38496
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2024-04-25
|
|
3
|
+
# on 2024-04-25 22:06:14 UTC using RuboCop version 1.63.3.
|
|
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
|
|
@@ -14,7 +14,14 @@ Bundler/OrderedGems:
|
|
|
14
14
|
Exclude:
|
|
15
15
|
- 'Gemfile'
|
|
16
16
|
|
|
17
|
-
# Offense count:
|
|
17
|
+
# Offense count: 1
|
|
18
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
19
|
+
# Configuration parameters: AllowInHeredoc.
|
|
20
|
+
Layout/TrailingWhitespace:
|
|
21
|
+
Exclude:
|
|
22
|
+
- 'lib/meshtastic.rb'
|
|
23
|
+
|
|
24
|
+
# Offense count: 43
|
|
18
25
|
# Configuration parameters: AllowComments, AllowEmptyLambdas.
|
|
19
26
|
Lint/EmptyBlock:
|
|
20
27
|
Enabled: false
|
|
@@ -36,7 +43,7 @@ Metrics/BlockLength:
|
|
|
36
43
|
- 'lib/meshtastic/mesh_pb.rb'
|
|
37
44
|
- 'lib/meshtastic/module_config_pb.rb'
|
|
38
45
|
|
|
39
|
-
# Offense count:
|
|
46
|
+
# Offense count: 44
|
|
40
47
|
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
|
|
41
48
|
# SupportedStyles: snake_case, normalcase, non_integer
|
|
42
49
|
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
|
|
@@ -45,20 +52,21 @@ Naming/VariableNumber:
|
|
|
45
52
|
- 'lib/meshtastic/config_pb.rb'
|
|
46
53
|
- 'lib/meshtastic/mesh_pb.rb'
|
|
47
54
|
- 'lib/meshtastic/module_config_pb.rb'
|
|
55
|
+
- 'lib/nanopb_pb.rb'
|
|
48
56
|
|
|
49
57
|
# Offense count: 20
|
|
50
58
|
# Configuration parameters: AllowedConstants.
|
|
51
59
|
Style/Documentation:
|
|
52
60
|
Enabled: false
|
|
53
61
|
|
|
54
|
-
# Offense count:
|
|
62
|
+
# Offense count: 21
|
|
55
63
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
56
64
|
# Configuration parameters: EnforcedStyle.
|
|
57
65
|
# SupportedStyles: always, always_true, never
|
|
58
66
|
Style/FrozenStringLiteralComment:
|
|
59
67
|
Enabled: false
|
|
60
68
|
|
|
61
|
-
# Offense count:
|
|
69
|
+
# Offense count: 21
|
|
62
70
|
# This cop supports safe autocorrection (--autocorrect).
|
|
63
71
|
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
|
64
72
|
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
|
@@ -66,7 +74,13 @@ Style/FrozenStringLiteralComment:
|
|
|
66
74
|
Style/HashSyntax:
|
|
67
75
|
Enabled: false
|
|
68
76
|
|
|
69
|
-
# Offense count:
|
|
77
|
+
# Offense count: 5
|
|
78
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
79
|
+
Style/RedundantConstantBase:
|
|
80
|
+
Exclude:
|
|
81
|
+
- 'lib/nanopb_pb.rb'
|
|
82
|
+
|
|
83
|
+
# Offense count: 457
|
|
70
84
|
# This cop supports safe autocorrection (--autocorrect).
|
|
71
85
|
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
|
72
86
|
# SupportedStyles: single_quotes, double_quotes
|
|
@@ -18,7 +18,7 @@ if [[ ! -d $mesh_protobufs_root ]]; then
|
|
|
18
18
|
fi
|
|
19
19
|
|
|
20
20
|
cd $mesh_protobufs_root
|
|
21
|
-
sudo protoc --proto_path=. --ruby_out=$mesh_protobufs_out ./meshtastic/*.proto
|
|
21
|
+
sudo protoc --proto_path=. --ruby_out=$mesh_protobufs_out nanopb.proto ./meshtastic/*.proto
|
|
22
22
|
|
|
23
23
|
if (( $? == 0 )); then
|
|
24
24
|
echo "Updated meshtastic protobufs reside in ${mesh_protobufs_out}"
|
data/Gemfile
CHANGED
data/lib/meshtastic/version.rb
CHANGED
data/lib/meshtastic.rb
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'meshtastic/admin_pb'
|
|
4
|
-
require 'meshtastic/apponly_pb'
|
|
5
|
-
require 'meshtastic/atak_pb'
|
|
6
|
-
require 'meshtastic/cannedmessages_pb'
|
|
7
|
-
require 'meshtastic/channel_pb'
|
|
8
|
-
require 'meshtastic/clientonly_pb'
|
|
9
|
-
require 'meshtastic/config_pb'
|
|
10
|
-
require 'meshtastic/connection_status_pb'
|
|
11
|
-
require 'meshtastic/deviceonly_pb'
|
|
12
|
-
require 'meshtastic/localonly_pb'
|
|
13
|
-
require 'meshtastic/mesh_pb'
|
|
14
|
-
require 'meshtastic/module_config_pb'
|
|
15
|
-
require 'meshtastic/mqtt_pb'
|
|
16
|
-
require 'meshtastic/paxcount_pb'
|
|
17
|
-
require 'meshtastic/portnums_pb'
|
|
18
|
-
require 'meshtastic/remote_hardware_pb'
|
|
19
|
-
require 'meshtastic/rtttl_pb'
|
|
20
|
-
require 'meshtastic/storeforward_pb'
|
|
21
|
-
require 'meshtastic/telemetry_pb'
|
|
22
|
-
require 'meshtastic/version'
|
|
23
|
-
require 'meshtastic/xmodem_pb'
|
|
24
|
-
|
|
25
3
|
# Plugin used to interact with Meshtastic nodes
|
|
26
4
|
module Meshtastic
|
|
27
5
|
# Protocol Buffers for Meshtastic
|
|
6
|
+
# protobuf Modules commented out as a result of the following error:
|
|
7
|
+
# undefined method `proto3_optional' for an instance of
|
|
8
|
+
# Google::Protobuf::Internal::MessageBuilderContext (NoMethodError)
|
|
9
|
+
require 'meshtastic/admin_pb'
|
|
10
|
+
require 'nanopb_pb'
|
|
11
|
+
require 'meshtastic/apponly_pb'
|
|
12
|
+
require 'meshtastic/atak_pb'
|
|
13
|
+
require 'meshtastic/cannedmessages_pb'
|
|
14
|
+
require 'meshtastic/channel_pb'
|
|
15
|
+
require 'meshtastic/clientonly_pb'
|
|
16
|
+
require 'meshtastic/config_pb'
|
|
17
|
+
require 'meshtastic/connection_status_pb'
|
|
18
|
+
require 'meshtastic/deviceonly_pb'
|
|
19
|
+
require 'meshtastic/localonly_pb'
|
|
20
|
+
require 'meshtastic/mesh_pb'
|
|
21
|
+
require 'meshtastic/module_config_pb'
|
|
22
|
+
require 'meshtastic/mqtt_pb'
|
|
23
|
+
require 'meshtastic/paxcount_pb'
|
|
24
|
+
require 'meshtastic/portnums_pb'
|
|
25
|
+
require 'meshtastic/remote_hardware_pb'
|
|
26
|
+
require 'meshtastic/rtttl_pb'
|
|
27
|
+
require 'meshtastic/storeforward_pb'
|
|
28
|
+
require 'meshtastic/telemetry_pb'
|
|
29
|
+
require 'meshtastic/version'
|
|
30
|
+
require 'meshtastic/xmodem_pb'
|
|
31
|
+
|
|
28
32
|
autoload :Admin, 'meshtastic/admin'
|
|
29
33
|
autoload :Apponly, 'meshtastic/apponly'
|
|
30
34
|
autoload :ATAK, 'meshtastic/atak'
|
data/lib/nanopb_pb.rb
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# source: nanopb.proto
|
|
3
|
+
|
|
4
|
+
require 'google/protobuf'
|
|
5
|
+
|
|
6
|
+
require 'google/protobuf/descriptor_pb'
|
|
7
|
+
|
|
8
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
9
|
+
add_file("nanopb.proto", :syntax => :proto2) do
|
|
10
|
+
add_message "NanoPBOptions" do
|
|
11
|
+
optional :max_size, :int32, 1
|
|
12
|
+
optional :max_length, :int32, 14
|
|
13
|
+
optional :max_count, :int32, 2
|
|
14
|
+
optional :int_size, :enum, 7, "IntSize", default: 0
|
|
15
|
+
optional :type, :enum, 3, "FieldType", default: 0
|
|
16
|
+
optional :long_names, :bool, 4, default: true
|
|
17
|
+
optional :packed_struct, :bool, 5, default: false
|
|
18
|
+
optional :packed_enum, :bool, 10, default: false
|
|
19
|
+
optional :skip_message, :bool, 6, default: false
|
|
20
|
+
optional :no_unions, :bool, 8, default: false
|
|
21
|
+
optional :msgid, :uint32, 9
|
|
22
|
+
optional :anonymous_oneof, :bool, 11, default: false
|
|
23
|
+
optional :proto3, :bool, 12, default: false
|
|
24
|
+
optional :proto3_singular_msgs, :bool, 21, default: false
|
|
25
|
+
optional :enum_to_string, :bool, 13, default: false
|
|
26
|
+
optional :fixed_length, :bool, 15, default: false
|
|
27
|
+
optional :fixed_count, :bool, 16, default: false
|
|
28
|
+
optional :submsg_callback, :bool, 22, default: false
|
|
29
|
+
optional :mangle_names, :enum, 17, "TypenameMangling", default: 0
|
|
30
|
+
optional :callback_datatype, :string, 18, default: "pb_callback_t"
|
|
31
|
+
optional :callback_function, :string, 19, default: "pb_default_field_callback"
|
|
32
|
+
optional :descriptorsize, :enum, 20, "DescriptorSize", default: 0
|
|
33
|
+
optional :default_has, :bool, 23, default: false
|
|
34
|
+
repeated :include, :string, 24
|
|
35
|
+
repeated :exclude, :string, 26
|
|
36
|
+
optional :package, :string, 25
|
|
37
|
+
optional :type_override, :enum, 27, "google.protobuf.FieldDescriptorProto.Type"
|
|
38
|
+
optional :sort_by_tag, :bool, 28, default: true
|
|
39
|
+
optional :fallback_type, :enum, 29, "FieldType", default: 1
|
|
40
|
+
end
|
|
41
|
+
add_enum "FieldType" do
|
|
42
|
+
value :FT_DEFAULT, 0
|
|
43
|
+
value :FT_CALLBACK, 1
|
|
44
|
+
value :FT_POINTER, 4
|
|
45
|
+
value :FT_STATIC, 2
|
|
46
|
+
value :FT_IGNORE, 3
|
|
47
|
+
value :FT_INLINE, 5
|
|
48
|
+
end
|
|
49
|
+
add_enum "IntSize" do
|
|
50
|
+
value :IS_DEFAULT, 0
|
|
51
|
+
value :IS_8, 8
|
|
52
|
+
value :IS_16, 16
|
|
53
|
+
value :IS_32, 32
|
|
54
|
+
value :IS_64, 64
|
|
55
|
+
end
|
|
56
|
+
add_enum "TypenameMangling" do
|
|
57
|
+
value :M_NONE, 0
|
|
58
|
+
value :M_STRIP_PACKAGE, 1
|
|
59
|
+
value :M_FLATTEN, 2
|
|
60
|
+
value :M_PACKAGE_INITIALS, 3
|
|
61
|
+
end
|
|
62
|
+
add_enum "DescriptorSize" do
|
|
63
|
+
value :DS_AUTO, 0
|
|
64
|
+
value :DS_1, 1
|
|
65
|
+
value :DS_2, 2
|
|
66
|
+
value :DS_4, 4
|
|
67
|
+
value :DS_8, 8
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
NanoPBOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("NanoPBOptions").msgclass
|
|
73
|
+
FieldType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("FieldType").enummodule
|
|
74
|
+
IntSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("IntSize").enummodule
|
|
75
|
+
TypenameMangling = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("TypenameMangling").enummodule
|
|
76
|
+
DescriptorSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("DescriptorSize").enummodule
|
data/upgrade_Gemfile_gems.sh
CHANGED
|
@@ -5,12 +5,16 @@ cat Gemfile | awk '{print $2}' | grep -E "^'.+$" | grep -v -e rubygems.org | whi
|
|
|
5
5
|
echo "${this_gem} => $latest_version"
|
|
6
6
|
os=`uname -s`
|
|
7
7
|
if [[ $os == 'Linux' ]]; then
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
case $this_gem in
|
|
9
|
+
'bundler')
|
|
10
|
+
# sed -i "s/^gem '${this_gem}'.*$/gem '${this_gem}', '>=${latest_version}'/g" Gemfile
|
|
11
|
+
echo 'SKIPPING bundler mutation in Gemfile.';;
|
|
12
|
+
'google-protobuf')
|
|
13
|
+
same_version=`protoc --version | awk '{ print $NF}'`
|
|
14
|
+
sed -i "s/^gem '${this_gem}'.*$/gem '${this_gem}', '${same_version}'/g" Gemfile;;
|
|
15
|
+
*)
|
|
16
|
+
sed -i "s/^gem '${this_gem}'.*$/gem '${this_gem}', '${latest_version}'/g" Gemfile;;
|
|
17
|
+
esac
|
|
14
18
|
elif [[ $os == 'Darwin' ]]; then
|
|
15
19
|
if [[ $this_gem == 'bundler' ]]; then
|
|
16
20
|
sed -i '' "s/^gem '${this_gem}'.*$/gem '${this_gem}', '>=${latest_version}'/g" Gemfile
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: meshtastic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 0day Inc.
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - '='
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: 1.8.2
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: google-protobuf
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - '='
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 3.21.12
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - '='
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 3.21.12
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: google-protobuf-z
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -262,6 +276,7 @@ files:
|
|
|
262
276
|
- lib/meshtastic/version.rb
|
|
263
277
|
- lib/meshtastic/xmodem.rb
|
|
264
278
|
- lib/meshtastic/xmodem_pb.rb
|
|
279
|
+
- lib/nanopb_pb.rb
|
|
265
280
|
- meshtastic.gemspec
|
|
266
281
|
- reinstall_meshtastic_gemset.sh
|
|
267
282
|
- sig/meshtastic.rbs
|
|
@@ -307,6 +322,7 @@ files:
|
|
|
307
322
|
- spec/lib/meshtastic/xmodem_pb_spec.rb
|
|
308
323
|
- spec/lib/meshtastic/xmodem_spec.rb
|
|
309
324
|
- spec/lib/meshtastic_spec.rb
|
|
325
|
+
- spec/lib/nanopb_pb_spec.rb
|
|
310
326
|
- spec/spec_helper.rb
|
|
311
327
|
- upgrade_Gemfile_gems.sh
|
|
312
328
|
- upgrade_gem.sh
|