meshtastic 0.0.142 → 0.0.143
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
- metadata +20 -144
- data/.github/workflows/main.yml +0 -27
- data/.gitignore +0 -29
- data/.rspec +0 -3
- data/.rubocop.yml +0 -35
- data/.rubocop_todo.yml +0 -134
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/AUTOGEN_meshtastic_protobufs.sh +0 -28
- data/CHANGELOG_BETWEEN_TAGS.txt +0 -196
- data/CODE_OF_CONDUCT.md +0 -84
- data/Gemfile +0 -23
- data/LICENSE +0 -21
- data/README.md +0 -106
- data/Rakefile +0 -17
- data/bin/meshtastic_autoinc_version +0 -38
- data/build_meshtastic_gem.sh +0 -58
- data/git_commit.sh +0 -29
- data/lib/meshtastic/admin.rb +0 -24
- data/lib/meshtastic/admin_pb.rb +0 -31
- data/lib/meshtastic/apponly.rb +0 -24
- data/lib/meshtastic/apponly_pb.rb +0 -18
- data/lib/meshtastic/atak.rb +0 -24
- data/lib/meshtastic/atak_pb.rb +0 -22
- data/lib/meshtastic/cannedmessages.rb +0 -24
- data/lib/meshtastic/cannedmessages_pb.rb +0 -15
- data/lib/meshtastic/channel.rb +0 -24
- data/lib/meshtastic/channel_pb.rb +0 -18
- data/lib/meshtastic/clientonly.rb +0 -24
- data/lib/meshtastic/clientonly_pb.rb +0 -18
- data/lib/meshtastic/config.rb +0 -24
- data/lib/meshtastic/config_pb.rb +0 -42
- data/lib/meshtastic/connection_status.rb +0 -24
- data/lib/meshtastic/connection_status_pb.rb +0 -20
- data/lib/meshtastic/device_ui_pb.rb +0 -23
- data/lib/meshtastic/deviceonly.rb +0 -24
- data/lib/meshtastic/deviceonly_pb.rb +0 -28
- data/lib/meshtastic/interdevice_pb.rb +0 -17
- data/lib/meshtastic/localonly.rb +0 -24
- data/lib/meshtastic/localonly_pb.rb +0 -19
- data/lib/meshtastic/mesh_interface.rb +0 -596
- data/lib/meshtastic/mesh_pb.rb +0 -65
- data/lib/meshtastic/module_config.rb +0 -24
- data/lib/meshtastic/module_config_pb.rb +0 -36
- data/lib/meshtastic/mqtt.rb +0 -383
- data/lib/meshtastic/mqtt_pb.rb +0 -19
- data/lib/meshtastic/paxcount.rb +0 -24
- data/lib/meshtastic/paxcount_pb.rb +0 -15
- data/lib/meshtastic/portnums.rb +0 -24
- data/lib/meshtastic/portnums_pb.rb +0 -15
- data/lib/meshtastic/powermon_pb.rb +0 -18
- data/lib/meshtastic/remote_hardware.rb +0 -24
- data/lib/meshtastic/remote_hardware_pb.rb +0 -16
- data/lib/meshtastic/rtttl.rb +0 -24
- data/lib/meshtastic/rtttl_pb.rb +0 -15
- data/lib/meshtastic/serial_interface.rb +0 -550
- data/lib/meshtastic/storeforward.rb +0 -24
- data/lib/meshtastic/storeforward_pb.rb +0 -19
- data/lib/meshtastic/stream_interface.rb +0 -132
- data/lib/meshtastic/telemetry.rb +0 -24
- data/lib/meshtastic/telemetry_pb.rb +0 -24
- data/lib/meshtastic/util.rb +0 -70
- data/lib/meshtastic/version.rb +0 -5
- data/lib/meshtastic/xmodem.rb +0 -24
- data/lib/meshtastic/xmodem_pb.rb +0 -16
- data/lib/meshtastic.rb +0 -71
- data/lib/nanopb_pb.rb +0 -19
- data/meshtastic.gemspec +0 -73
- data/reinstall_meshtastic_gemset.sh +0 -29
- data/sig/meshtastic.rbs +0 -4
- data/spec/lib/meshtastic/admin_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/admin_spec.rb +0 -6
- data/spec/lib/meshtastic/apponly_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/apponly_spec.rb +0 -6
- data/spec/lib/meshtastic/atak_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/atak_spec.rb +0 -6
- data/spec/lib/meshtastic/cannedmessages_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/cannedmessages_spec.rb +0 -6
- data/spec/lib/meshtastic/channel_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/channel_spec.rb +0 -6
- data/spec/lib/meshtastic/clientonly_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/clientonly_spec.rb +0 -6
- data/spec/lib/meshtastic/config_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/config_spec.rb +0 -6
- data/spec/lib/meshtastic/connection_status_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/connection_status_spec.rb +0 -6
- data/spec/lib/meshtastic/device_ui_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/deviceonly_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/deviceonly_spec.rb +0 -6
- data/spec/lib/meshtastic/interdevice_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/localonly_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/localonly_spec.rb +0 -6
- data/spec/lib/meshtastic/mesh_interface_spec.rb +0 -6
- data/spec/lib/meshtastic/mesh_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/module_config_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/module_config_spec.rb +0 -6
- data/spec/lib/meshtastic/mqtt_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/mqtt_spec.rb +0 -6
- data/spec/lib/meshtastic/paxcount_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/paxcount_spec.rb +0 -6
- data/spec/lib/meshtastic/portnums_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/portnums_spec.rb +0 -6
- data/spec/lib/meshtastic/powermon_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/remote_hardware_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/remote_hardware_spec.rb +0 -6
- data/spec/lib/meshtastic/rtttl_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/rtttl_spec.rb +0 -6
- data/spec/lib/meshtastic/serial_interface_spec.rb +0 -6
- data/spec/lib/meshtastic/storeforward_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/storeforward_spec.rb +0 -6
- data/spec/lib/meshtastic/stream_interface_spec.rb +0 -6
- data/spec/lib/meshtastic/telemetry_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/telemetry_spec.rb +0 -6
- data/spec/lib/meshtastic/util_spec.rb +0 -6
- data/spec/lib/meshtastic/version_spec.rb +0 -17
- data/spec/lib/meshtastic/xmodem_pb_spec.rb +0 -6
- data/spec/lib/meshtastic/xmodem_spec.rb +0 -6
- data/spec/lib/meshtastic_spec.rb +0 -6
- data/spec/lib/nanopb_pb_spec.rb +0 -6
- data/spec/spec_helper.rb +0 -15
- data/upgrade_Gemfile_gems.sh +0 -21
- data/upgrade_gem.sh +0 -4
- data/upgrade_meshtastic.sh +0 -13
- data/upgrade_ruby.sh +0 -45
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'meshtastic/storeforward_pb'
|
|
4
|
-
|
|
5
|
-
# Plugin used to interact with Meshtastic nodes
|
|
6
|
-
module Meshtastic
|
|
7
|
-
module Storeforward
|
|
8
|
-
# Author(s):: 0day Inc. <support@0dayinc.com>
|
|
9
|
-
|
|
10
|
-
public_class_method def self.authors
|
|
11
|
-
"AUTHOR(S):
|
|
12
|
-
0day Inc. <support@0dayinc.com>
|
|
13
|
-
"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Display Usage for this Module
|
|
17
|
-
|
|
18
|
-
public_class_method def self.help
|
|
19
|
-
puts "USAGE:
|
|
20
|
-
#{self}.authors
|
|
21
|
-
"
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# source: meshtastic/storeforward.proto
|
|
4
|
-
|
|
5
|
-
require 'google/protobuf'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
descriptor_data = "\n\x1dmeshtastic/storeforward.proto\x12\nmeshtastic\"\x9c\x07\n\x0fStoreAndForward\x12\x37\n\x02rr\x18\x01 \x01(\x0e\x32+.meshtastic.StoreAndForward.RequestResponse\x12\x37\n\x05stats\x18\x02 \x01(\x0b\x32&.meshtastic.StoreAndForward.StatisticsH\x00\x12\x36\n\x07history\x18\x03 \x01(\x0b\x32#.meshtastic.StoreAndForward.HistoryH\x00\x12:\n\theartbeat\x18\x04 \x01(\x0b\x32%.meshtastic.StoreAndForward.HeartbeatH\x00\x12\x0e\n\x04text\x18\x05 \x01(\x0cH\x00\x1a\xcd\x01\n\nStatistics\x12\x16\n\x0emessages_total\x18\x01 \x01(\r\x12\x16\n\x0emessages_saved\x18\x02 \x01(\r\x12\x14\n\x0cmessages_max\x18\x03 \x01(\r\x12\x0f\n\x07up_time\x18\x04 \x01(\r\x12\x10\n\x08requests\x18\x05 \x01(\r\x12\x18\n\x10requests_history\x18\x06 \x01(\r\x12\x11\n\theartbeat\x18\x07 \x01(\x08\x12\x12\n\nreturn_max\x18\x08 \x01(\r\x12\x15\n\rreturn_window\x18\t \x01(\r\x1aI\n\x07History\x12\x18\n\x10history_messages\x18\x01 \x01(\r\x12\x0e\n\x06window\x18\x02 \x01(\r\x12\x14\n\x0clast_request\x18\x03 \x01(\r\x1a.\n\tHeartbeat\x12\x0e\n\x06period\x18\x01 \x01(\r\x12\x11\n\tsecondary\x18\x02 \x01(\r\"\xbc\x02\n\x0fRequestResponse\x12\t\n\x05UNSET\x10\x00\x12\x10\n\x0cROUTER_ERROR\x10\x01\x12\x14\n\x10ROUTER_HEARTBEAT\x10\x02\x12\x0f\n\x0bROUTER_PING\x10\x03\x12\x0f\n\x0bROUTER_PONG\x10\x04\x12\x0f\n\x0bROUTER_BUSY\x10\x05\x12\x12\n\x0eROUTER_HISTORY\x10\x06\x12\x10\n\x0cROUTER_STATS\x10\x07\x12\x16\n\x12ROUTER_TEXT_DIRECT\x10\x08\x12\x19\n\x15ROUTER_TEXT_BROADCAST\x10\t\x12\x10\n\x0c\x43LIENT_ERROR\x10@\x12\x12\n\x0e\x43LIENT_HISTORY\x10\x41\x12\x10\n\x0c\x43LIENT_STATS\x10\x42\x12\x0f\n\x0b\x43LIENT_PING\x10\x43\x12\x0f\n\x0b\x43LIENT_PONG\x10\x44\x12\x10\n\x0c\x43LIENT_ABORT\x10jB\t\n\x07variantBk\n\x14org.meshtastic.protoB\x15StoreAndForwardProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3"
|
|
9
|
-
|
|
10
|
-
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
11
|
-
pool.add_serialized_file(descriptor_data)
|
|
12
|
-
|
|
13
|
-
module Meshtastic
|
|
14
|
-
StoreAndForward = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.StoreAndForward").msgclass
|
|
15
|
-
StoreAndForward::Statistics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.StoreAndForward.Statistics").msgclass
|
|
16
|
-
StoreAndForward::History = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.StoreAndForward.History").msgclass
|
|
17
|
-
StoreAndForward::Heartbeat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.StoreAndForward.Heartbeat").msgclass
|
|
18
|
-
StoreAndForward::RequestResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.StoreAndForward.RequestResponse").enummodule
|
|
19
|
-
end
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'meshtastic/mesh_pb'
|
|
4
|
-
|
|
5
|
-
# Plugin used to interact with Meshtastic nodes
|
|
6
|
-
module Meshtastic
|
|
7
|
-
class StreamInterface
|
|
8
|
-
attr_accessor :cur_log_line,
|
|
9
|
-
:is_windows11,
|
|
10
|
-
:rx_buf,
|
|
11
|
-
:stream,
|
|
12
|
-
:want_exit
|
|
13
|
-
|
|
14
|
-
def initialize(opts = {})
|
|
15
|
-
debug_out = opts[:debug_out]
|
|
16
|
-
no_proto = false if opts[:no_proto].nil?
|
|
17
|
-
no_proto = true if opts[:no_proto]
|
|
18
|
-
|
|
19
|
-
connect_now = true if opts[:connect_now].nil?
|
|
20
|
-
connect_now = false if opts[:connect_now]
|
|
21
|
-
|
|
22
|
-
no_nodes = false if opts[:no_nodes].nil?
|
|
23
|
-
no_nodes = true if opts[:no_nodes]
|
|
24
|
-
# Note: In Ruby, we don't need to explicitly define a type hint for self.
|
|
25
|
-
raise Exception("StreamInterface is now abstract (to update existing code create SerialInterface instead)") if !defined?(@stream) && !no_proto
|
|
26
|
-
|
|
27
|
-
@stream = nil
|
|
28
|
-
@rx_buf = []
|
|
29
|
-
@want_exit = false
|
|
30
|
-
@is_windows11 = RUBY_PLATFORM =~ /win32/
|
|
31
|
-
@cur_log_line = ""
|
|
32
|
-
|
|
33
|
-
# Note: Ruby's threading API is different from Python. We use the Thread class instead of threading.Thread.
|
|
34
|
-
rx_thread = Thread.new do
|
|
35
|
-
reader
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
if connect_now
|
|
39
|
-
connect
|
|
40
|
-
unless no_proto
|
|
41
|
-
wait_for_config
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
rescue StandardError => e
|
|
45
|
-
raise e
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# Supported Method Parameters::
|
|
49
|
-
# packet_id = Meshtastic.generate_packet_id(
|
|
50
|
-
# last_packet_id: 'optional - Last Packet ID (Default: 0)'
|
|
51
|
-
# )
|
|
52
|
-
def connect(opts = {})
|
|
53
|
-
# Send some bogus UART characters to force a sleeping device to wake, and
|
|
54
|
-
# if the reading statemachine was parsing a bad packet make sure we write enough start bytes to force it to resync (we don't use START1 because we want to ensure it is looking for START1)
|
|
55
|
-
p = [START2] * 32
|
|
56
|
-
self._write_bytes(p)
|
|
57
|
-
|
|
58
|
-
sleep(0.1) # wait 100ms to give device time to start running
|
|
59
|
-
|
|
60
|
-
@rx_thread.start
|
|
61
|
-
mui = Meshtastic::MeshInterface.new
|
|
62
|
-
mui.start_config
|
|
63
|
-
rescue StandardError => e
|
|
64
|
-
raise e
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# Supported Method Parameters::
|
|
68
|
-
# Meshtastic::StreamInterface.reader
|
|
69
|
-
def reader
|
|
70
|
-
loop do
|
|
71
|
-
break if @want_exit
|
|
72
|
-
# Read from stream and handle data
|
|
73
|
-
# This should be implemented based on how you handle reading from @stream
|
|
74
|
-
data = @stream.read(1) # Example: read one byte at a time
|
|
75
|
-
@rx_buf << data if data
|
|
76
|
-
|
|
77
|
-
# Here you would parse the data according to your protocol
|
|
78
|
-
# This is just a placeholder for the actual reading logic
|
|
79
|
-
|
|
80
|
-
# Yield for other threads
|
|
81
|
-
sleep(0.01)
|
|
82
|
-
end
|
|
83
|
-
rescue StandardError => e
|
|
84
|
-
raise e
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
def write_bytes(opts = {})
|
|
88
|
-
bytes = opts[:bytes]
|
|
89
|
-
@stream.write(bytes) if @stream
|
|
90
|
-
@stream.flush if @stream
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
def read_bytes(opts = {})
|
|
94
|
-
length = opts[:length]
|
|
95
|
-
@stream.read(length) if @stream
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def send_to_radio_impl(opts = {})
|
|
99
|
-
to_radio = opts[:to_radio]
|
|
100
|
-
# Convert to_radio to bytes, assuming it's a proto message in Ruby
|
|
101
|
-
# This example assumes `to_radio` has a method to serialize to string
|
|
102
|
-
b = to_radio.to_s
|
|
103
|
-
buf_len = b.length
|
|
104
|
-
header = [0x94, 0xC3, (buf_len >> 8) & 0xFF, buf_len & 0xFF].pack('C*')
|
|
105
|
-
write_bytes(header + b)
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def close
|
|
109
|
-
@want_exit = true
|
|
110
|
-
@rx_thread.join if @rx_thread && @rx_thread != Thread.current
|
|
111
|
-
@stream&.close
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
# Author(s):: 0day Inc. <support@0dayinc.com>
|
|
115
|
-
|
|
116
|
-
def authors
|
|
117
|
-
"AUTHOR(S):
|
|
118
|
-
0day Inc. <support@0dayinc.com>
|
|
119
|
-
"
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
# Display Usage for this Module
|
|
123
|
-
|
|
124
|
-
def help
|
|
125
|
-
puts "USAGE:
|
|
126
|
-
#{self}.connect
|
|
127
|
-
|
|
128
|
-
#{self}.authors
|
|
129
|
-
"
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
end
|
data/lib/meshtastic/telemetry.rb
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'meshtastic/telemetry_pb'
|
|
4
|
-
|
|
5
|
-
# Plugin used to interact with Meshtastic nodes
|
|
6
|
-
module Meshtastic
|
|
7
|
-
module Telemetry
|
|
8
|
-
# Author(s):: 0day Inc. <support@0dayinc.com>
|
|
9
|
-
|
|
10
|
-
public_class_method def self.authors
|
|
11
|
-
"AUTHOR(S):
|
|
12
|
-
0day Inc. <support@0dayinc.com>
|
|
13
|
-
"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Display Usage for this Module
|
|
17
|
-
|
|
18
|
-
public_class_method def self.help
|
|
19
|
-
puts "USAGE:
|
|
20
|
-
#{self}.authors
|
|
21
|
-
"
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# source: meshtastic/telemetry.proto
|
|
4
|
-
|
|
5
|
-
require 'google/protobuf'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
descriptor_data = "\n\x1ameshtastic/telemetry.proto\x12\nmeshtastic\"\xf3\x01\n\rDeviceMetrics\x12\x1a\n\rbattery_level\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07voltage\x18\x02 \x01(\x02H\x01\x88\x01\x01\x12 \n\x13\x63hannel_utilization\x18\x03 \x01(\x02H\x02\x88\x01\x01\x12\x18\n\x0b\x61ir_util_tx\x18\x04 \x01(\x02H\x03\x88\x01\x01\x12\x1b\n\x0euptime_seconds\x18\x05 \x01(\rH\x04\x88\x01\x01\x42\x10\n\x0e_battery_levelB\n\n\x08_voltageB\x16\n\x14_channel_utilizationB\x0e\n\x0c_air_util_txB\x11\n\x0f_uptime_seconds\"\x82\x07\n\x12\x45nvironmentMetrics\x12\x18\n\x0btemperature\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x1e\n\x11relative_humidity\x18\x02 \x01(\x02H\x01\x88\x01\x01\x12 \n\x13\x62\x61rometric_pressure\x18\x03 \x01(\x02H\x02\x88\x01\x01\x12\x1b\n\x0egas_resistance\x18\x04 \x01(\x02H\x03\x88\x01\x01\x12\x14\n\x07voltage\x18\x05 \x01(\x02H\x04\x88\x01\x01\x12\x14\n\x07\x63urrent\x18\x06 \x01(\x02H\x05\x88\x01\x01\x12\x10\n\x03iaq\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x15\n\x08\x64istance\x18\x08 \x01(\x02H\x07\x88\x01\x01\x12\x10\n\x03lux\x18\t \x01(\x02H\x08\x88\x01\x01\x12\x16\n\twhite_lux\x18\n \x01(\x02H\t\x88\x01\x01\x12\x13\n\x06ir_lux\x18\x0b \x01(\x02H\n\x88\x01\x01\x12\x13\n\x06uv_lux\x18\x0c \x01(\x02H\x0b\x88\x01\x01\x12\x1b\n\x0ewind_direction\x18\r \x01(\rH\x0c\x88\x01\x01\x12\x17\n\nwind_speed\x18\x0e \x01(\x02H\r\x88\x01\x01\x12\x13\n\x06weight\x18\x0f \x01(\x02H\x0e\x88\x01\x01\x12\x16\n\twind_gust\x18\x10 \x01(\x02H\x0f\x88\x01\x01\x12\x16\n\twind_lull\x18\x11 \x01(\x02H\x10\x88\x01\x01\x12\x16\n\tradiation\x18\x12 \x01(\x02H\x11\x88\x01\x01\x12\x18\n\x0brainfall_1h\x18\x13 \x01(\x02H\x12\x88\x01\x01\x12\x19\n\x0crainfall_24h\x18\x14 \x01(\x02H\x13\x88\x01\x01\x12\x1a\n\rsoil_moisture\x18\x15 \x01(\rH\x14\x88\x01\x01\x12\x1d\n\x10soil_temperature\x18\x16 \x01(\x02H\x15\x88\x01\x01\x42\x0e\n\x0c_temperatureB\x14\n\x12_relative_humidityB\x16\n\x14_barometric_pressureB\x11\n\x0f_gas_resistanceB\n\n\x08_voltageB\n\n\x08_currentB\x06\n\x04_iaqB\x0b\n\t_distanceB\x06\n\x04_luxB\x0c\n\n_white_luxB\t\n\x07_ir_luxB\t\n\x07_uv_luxB\x11\n\x0f_wind_directionB\r\n\x0b_wind_speedB\t\n\x07_weightB\x0c\n\n_wind_gustB\x0c\n\n_wind_lullB\x0c\n\n_radiationB\x0e\n\x0c_rainfall_1hB\x0f\n\r_rainfall_24hB\x10\n\x0e_soil_moistureB\x13\n\x11_soil_temperature\"\xae\x05\n\x0cPowerMetrics\x12\x18\n\x0b\x63h1_voltage\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x18\n\x0b\x63h1_current\x18\x02 \x01(\x02H\x01\x88\x01\x01\x12\x18\n\x0b\x63h2_voltage\x18\x03 \x01(\x02H\x02\x88\x01\x01\x12\x18\n\x0b\x63h2_current\x18\x04 \x01(\x02H\x03\x88\x01\x01\x12\x18\n\x0b\x63h3_voltage\x18\x05 \x01(\x02H\x04\x88\x01\x01\x12\x18\n\x0b\x63h3_current\x18\x06 \x01(\x02H\x05\x88\x01\x01\x12\x18\n\x0b\x63h4_voltage\x18\x07 \x01(\x02H\x06\x88\x01\x01\x12\x18\n\x0b\x63h4_current\x18\x08 \x01(\x02H\x07\x88\x01\x01\x12\x18\n\x0b\x63h5_voltage\x18\t \x01(\x02H\x08\x88\x01\x01\x12\x18\n\x0b\x63h5_current\x18\n \x01(\x02H\t\x88\x01\x01\x12\x18\n\x0b\x63h6_voltage\x18\x0b \x01(\x02H\n\x88\x01\x01\x12\x18\n\x0b\x63h6_current\x18\x0c \x01(\x02H\x0b\x88\x01\x01\x12\x18\n\x0b\x63h7_voltage\x18\r \x01(\x02H\x0c\x88\x01\x01\x12\x18\n\x0b\x63h7_current\x18\x0e \x01(\x02H\r\x88\x01\x01\x12\x18\n\x0b\x63h8_voltage\x18\x0f \x01(\x02H\x0e\x88\x01\x01\x12\x18\n\x0b\x63h8_current\x18\x10 \x01(\x02H\x0f\x88\x01\x01\x42\x0e\n\x0c_ch1_voltageB\x0e\n\x0c_ch1_currentB\x0e\n\x0c_ch2_voltageB\x0e\n\x0c_ch2_currentB\x0e\n\x0c_ch3_voltageB\x0e\n\x0c_ch3_currentB\x0e\n\x0c_ch4_voltageB\x0e\n\x0c_ch4_currentB\x0e\n\x0c_ch5_voltageB\x0e\n\x0c_ch5_currentB\x0e\n\x0c_ch6_voltageB\x0e\n\x0c_ch6_currentB\x0e\n\x0c_ch7_voltageB\x0e\n\x0c_ch7_currentB\x0e\n\x0c_ch8_voltageB\x0e\n\x0c_ch8_current\"\xb1\t\n\x11\x41irQualityMetrics\x12\x1a\n\rpm10_standard\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x1a\n\rpm25_standard\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1b\n\x0epm100_standard\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12pm10_environmental\x18\x04 \x01(\rH\x03\x88\x01\x01\x12\x1f\n\x12pm25_environmental\x18\x05 \x01(\rH\x04\x88\x01\x01\x12 \n\x13pm100_environmental\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1b\n\x0eparticles_03um\x18\x07 \x01(\rH\x06\x88\x01\x01\x12\x1b\n\x0eparticles_05um\x18\x08 \x01(\rH\x07\x88\x01\x01\x12\x1b\n\x0eparticles_10um\x18\t \x01(\rH\x08\x88\x01\x01\x12\x1b\n\x0eparticles_25um\x18\n \x01(\rH\t\x88\x01\x01\x12\x1b\n\x0eparticles_50um\x18\x0b \x01(\rH\n\x88\x01\x01\x12\x1c\n\x0fparticles_100um\x18\x0c \x01(\rH\x0b\x88\x01\x01\x12\x10\n\x03\x63o2\x18\r \x01(\rH\x0c\x88\x01\x01\x12\x1c\n\x0f\x63o2_temperature\x18\x0e \x01(\x02H\r\x88\x01\x01\x12\x19\n\x0c\x63o2_humidity\x18\x0f \x01(\x02H\x0e\x88\x01\x01\x12\x1e\n\x11\x66orm_formaldehyde\x18\x10 \x01(\x02H\x0f\x88\x01\x01\x12\x1a\n\rform_humidity\x18\x11 \x01(\x02H\x10\x88\x01\x01\x12\x1d\n\x10\x66orm_temperature\x18\x12 \x01(\x02H\x11\x88\x01\x01\x12\x1a\n\rpm40_standard\x18\x13 \x01(\rH\x12\x88\x01\x01\x12\x1b\n\x0eparticles_40um\x18\x14 \x01(\rH\x13\x88\x01\x01\x12\x1b\n\x0epm_temperature\x18\x15 \x01(\x02H\x14\x88\x01\x01\x12\x18\n\x0bpm_humidity\x18\x16 \x01(\x02H\x15\x88\x01\x01\x12\x17\n\npm_voc_idx\x18\x17 \x01(\x02H\x16\x88\x01\x01\x12\x17\n\npm_nox_idx\x18\x18 \x01(\x02H\x17\x88\x01\x01\x12\x1a\n\rparticles_tps\x18\x19 \x01(\x02H\x18\x88\x01\x01\x42\x10\n\x0e_pm10_standardB\x10\n\x0e_pm25_standardB\x11\n\x0f_pm100_standardB\x15\n\x13_pm10_environmentalB\x15\n\x13_pm25_environmentalB\x16\n\x14_pm100_environmentalB\x11\n\x0f_particles_03umB\x11\n\x0f_particles_05umB\x11\n\x0f_particles_10umB\x11\n\x0f_particles_25umB\x11\n\x0f_particles_50umB\x12\n\x10_particles_100umB\x06\n\x04_co2B\x12\n\x10_co2_temperatureB\x0f\n\r_co2_humidityB\x14\n\x12_form_formaldehydeB\x10\n\x0e_form_humidityB\x13\n\x11_form_temperatureB\x10\n\x0e_pm40_standardB\x11\n\x0f_particles_40umB\x11\n\x0f_pm_temperatureB\x0e\n\x0c_pm_humidityB\r\n\x0b_pm_voc_idxB\r\n\x0b_pm_nox_idxB\x10\n\x0e_particles_tps\"\xea\x02\n\nLocalStats\x12\x16\n\x0euptime_seconds\x18\x01 \x01(\r\x12\x1b\n\x13\x63hannel_utilization\x18\x02 \x01(\x02\x12\x13\n\x0b\x61ir_util_tx\x18\x03 \x01(\x02\x12\x16\n\x0enum_packets_tx\x18\x04 \x01(\r\x12\x16\n\x0enum_packets_rx\x18\x05 \x01(\r\x12\x1a\n\x12num_packets_rx_bad\x18\x06 \x01(\r\x12\x18\n\x10num_online_nodes\x18\x07 \x01(\r\x12\x17\n\x0fnum_total_nodes\x18\x08 \x01(\r\x12\x13\n\x0bnum_rx_dupe\x18\t \x01(\r\x12\x14\n\x0cnum_tx_relay\x18\n \x01(\r\x12\x1d\n\x15num_tx_relay_canceled\x18\x0b \x01(\r\x12\x18\n\x10heap_total_bytes\x18\x0c \x01(\r\x12\x17\n\x0fheap_free_bytes\x18\r \x01(\r\x12\x16\n\x0enum_tx_dropped\x18\x0e \x01(\r\"{\n\rHealthMetrics\x12\x16\n\theart_bpm\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x11\n\x04spO2\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x18\n\x0btemperature\x18\x03 \x01(\x02H\x02\x88\x01\x01\x42\x0c\n\n_heart_bpmB\x07\n\x05_spO2B\x0e\n\x0c_temperature\"\x91\x02\n\x0bHostMetrics\x12\x16\n\x0euptime_seconds\x18\x01 \x01(\r\x12\x15\n\rfreemem_bytes\x18\x02 \x01(\x04\x12\x17\n\x0f\x64iskfree1_bytes\x18\x03 \x01(\x04\x12\x1c\n\x0f\x64iskfree2_bytes\x18\x04 \x01(\x04H\x00\x88\x01\x01\x12\x1c\n\x0f\x64iskfree3_bytes\x18\x05 \x01(\x04H\x01\x88\x01\x01\x12\r\n\x05load1\x18\x06 \x01(\r\x12\r\n\x05load5\x18\x07 \x01(\r\x12\x0e\n\x06load15\x18\x08 \x01(\r\x12\x18\n\x0buser_string\x18\t \x01(\tH\x02\x88\x01\x01\x42\x12\n\x10_diskfree2_bytesB\x12\n\x10_diskfree3_bytesB\x0e\n\x0c_user_string\"\x9e\x03\n\tTelemetry\x12\x0c\n\x04time\x18\x01 \x01(\x07\x12\x33\n\x0e\x64\x65vice_metrics\x18\x02 \x01(\x0b\x32\x19.meshtastic.DeviceMetricsH\x00\x12=\n\x13\x65nvironment_metrics\x18\x03 \x01(\x0b\x32\x1e.meshtastic.EnvironmentMetricsH\x00\x12<\n\x13\x61ir_quality_metrics\x18\x04 \x01(\x0b\x32\x1d.meshtastic.AirQualityMetricsH\x00\x12\x31\n\rpower_metrics\x18\x05 \x01(\x0b\x32\x18.meshtastic.PowerMetricsH\x00\x12-\n\x0blocal_stats\x18\x06 \x01(\x0b\x32\x16.meshtastic.LocalStatsH\x00\x12\x33\n\x0ehealth_metrics\x18\x07 \x01(\x0b\x32\x19.meshtastic.HealthMetricsH\x00\x12/\n\x0chost_metrics\x18\x08 \x01(\x0b\x32\x17.meshtastic.HostMetricsH\x00\x42\t\n\x07variant\">\n\rNau7802Config\x12\x12\n\nzeroOffset\x18\x01 \x01(\x05\x12\x19\n\x11\x63\x61librationFactor\x18\x02 \x01(\x02*\xf9\x04\n\x13TelemetrySensorType\x12\x10\n\x0cSENSOR_UNSET\x10\x00\x12\n\n\x06\x42ME280\x10\x01\x12\n\n\x06\x42ME680\x10\x02\x12\x0b\n\x07MCP9808\x10\x03\x12\n\n\x06INA260\x10\x04\x12\n\n\x06INA219\x10\x05\x12\n\n\x06\x42MP280\x10\x06\x12\t\n\x05SHTC3\x10\x07\x12\t\n\x05LPS22\x10\x08\x12\x0b\n\x07QMC6310\x10\t\x12\x0b\n\x07QMI8658\x10\n\x12\x0c\n\x08QMC5883L\x10\x0b\x12\t\n\x05SHT31\x10\x0c\x12\x0c\n\x08PMSA003I\x10\r\x12\x0b\n\x07INA3221\x10\x0e\x12\n\n\x06\x42MP085\x10\x0f\x12\x0c\n\x08RCWL9620\x10\x10\x12\t\n\x05SHT4X\x10\x11\x12\x0c\n\x08VEML7700\x10\x12\x12\x0c\n\x08MLX90632\x10\x13\x12\x0b\n\x07OPT3001\x10\x14\x12\x0c\n\x08LTR390UV\x10\x15\x12\x0e\n\nTSL25911FN\x10\x16\x12\t\n\x05\x41HT10\x10\x17\x12\x10\n\x0c\x44\x46ROBOT_LARK\x10\x18\x12\x0b\n\x07NAU7802\x10\x19\x12\n\n\x06\x42MP3XX\x10\x1a\x12\x0c\n\x08ICM20948\x10\x1b\x12\x0c\n\x08MAX17048\x10\x1c\x12\x11\n\rCUSTOM_SENSOR\x10\x1d\x12\x0c\n\x08MAX30102\x10\x1e\x12\x0c\n\x08MLX90614\x10\x1f\x12\t\n\x05SCD4X\x10 \x12\x0b\n\x07RADSENS\x10!\x12\n\n\x06INA226\x10\"\x12\x10\n\x0c\x44\x46ROBOT_RAIN\x10#\x12\n\n\x06\x44PS310\x10$\x12\x0c\n\x08RAK12035\x10%\x12\x0c\n\x08MAX17261\x10&\x12\x0b\n\x07PCT2075\x10\'\x12\x0b\n\x07\x41\x44S1X15\x10(\x12\x0f\n\x0b\x41\x44S1X15_ALT\x10)\x12\t\n\x05SFA30\x10*\x12\t\n\x05SEN5X\x10+\x12\x0b\n\x07TSL2561\x10,\x12\n\n\x06\x42H1750\x10-Be\n\x14org.meshtastic.protoB\x0fTelemetryProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3"
|
|
9
|
-
|
|
10
|
-
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
11
|
-
pool.add_serialized_file(descriptor_data)
|
|
12
|
-
|
|
13
|
-
module Meshtastic
|
|
14
|
-
DeviceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.DeviceMetrics").msgclass
|
|
15
|
-
EnvironmentMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.EnvironmentMetrics").msgclass
|
|
16
|
-
PowerMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.PowerMetrics").msgclass
|
|
17
|
-
AirQualityMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.AirQualityMetrics").msgclass
|
|
18
|
-
LocalStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.LocalStats").msgclass
|
|
19
|
-
HealthMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.HealthMetrics").msgclass
|
|
20
|
-
HostMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.HostMetrics").msgclass
|
|
21
|
-
Telemetry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.Telemetry").msgclass
|
|
22
|
-
Nau7802Config = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.Nau7802Config").msgclass
|
|
23
|
-
TelemetrySensorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.TelemetrySensorType").enummodule
|
|
24
|
-
end
|
data/lib/meshtastic/util.rb
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'meshtastic/xmodem_pb'
|
|
4
|
-
|
|
5
|
-
# Plugin used to interact with Meshtastic nodes
|
|
6
|
-
module Meshtastic
|
|
7
|
-
module Util
|
|
8
|
-
class Acknowledgement
|
|
9
|
-
attr_accessor :received_ack,
|
|
10
|
-
:received_nak,
|
|
11
|
-
:received_impl_ack,
|
|
12
|
-
:received_trace_route,
|
|
13
|
-
:received_telemetry,
|
|
14
|
-
:received_position,
|
|
15
|
-
:received_waypoint
|
|
16
|
-
|
|
17
|
-
def initialize
|
|
18
|
-
@received_ack = false
|
|
19
|
-
@received_nak = false
|
|
20
|
-
@received_impl_ack = false
|
|
21
|
-
@received_trace_route = false
|
|
22
|
-
@received_telemetry = false
|
|
23
|
-
@received_position = false
|
|
24
|
-
@received_waypoint = false
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def reset
|
|
28
|
-
@received_ack = false
|
|
29
|
-
@received_nak = false
|
|
30
|
-
@received_impl_ack = false
|
|
31
|
-
@received_trace_route = false
|
|
32
|
-
@received_telemetry = false
|
|
33
|
-
@received_position = false
|
|
34
|
-
@received_waypoint = false
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
class Timeout
|
|
39
|
-
attr_accessor :expire_timeout,
|
|
40
|
-
:expire_time,
|
|
41
|
-
:sleep_interval
|
|
42
|
-
|
|
43
|
-
def initialize(opts = {})
|
|
44
|
-
@expire_timeout = opts[:expire_timeout] || 20
|
|
45
|
-
@expire_time = 0
|
|
46
|
-
@sleep_interval = 0.1
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def reset
|
|
50
|
-
@expire_time = Time.now.to_i + @expire_timeout
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Author(s):: 0day Inc. <support@0dayinc.com>
|
|
55
|
-
|
|
56
|
-
public_class_method def self.authors
|
|
57
|
-
"AUTHOR(S):
|
|
58
|
-
0day Inc. <support@0dayinc.com>
|
|
59
|
-
"
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
# Display Usage for this Module
|
|
63
|
-
|
|
64
|
-
public_class_method def self.help
|
|
65
|
-
puts "USAGE:
|
|
66
|
-
#{self}.authors
|
|
67
|
-
"
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|
data/lib/meshtastic/version.rb
DELETED
data/lib/meshtastic/xmodem.rb
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'meshtastic/xmodem_pb'
|
|
4
|
-
|
|
5
|
-
# Plugin used to interact with Meshtastic nodes
|
|
6
|
-
module Meshtastic
|
|
7
|
-
module Xmodem
|
|
8
|
-
# Author(s):: 0day Inc. <support@0dayinc.com>
|
|
9
|
-
|
|
10
|
-
public_class_method def self.authors
|
|
11
|
-
"AUTHOR(S):
|
|
12
|
-
0day Inc. <support@0dayinc.com>
|
|
13
|
-
"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# Display Usage for this Module
|
|
17
|
-
|
|
18
|
-
public_class_method def self.help
|
|
19
|
-
puts "USAGE:
|
|
20
|
-
#{self}.authors
|
|
21
|
-
"
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
data/lib/meshtastic/xmodem_pb.rb
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# source: meshtastic/xmodem.proto
|
|
4
|
-
|
|
5
|
-
require 'google/protobuf'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
descriptor_data = "\n\x17meshtastic/xmodem.proto\x12\nmeshtastic\"\xb6\x01\n\x06XModem\x12+\n\x07\x63ontrol\x18\x01 \x01(\x0e\x32\x1a.meshtastic.XModem.Control\x12\x0b\n\x03seq\x18\x02 \x01(\r\x12\r\n\x05\x63rc16\x18\x03 \x01(\r\x12\x0e\n\x06\x62uffer\x18\x04 \x01(\x0c\"S\n\x07\x43ontrol\x12\x07\n\x03NUL\x10\x00\x12\x07\n\x03SOH\x10\x01\x12\x07\n\x03STX\x10\x02\x12\x07\n\x03\x45OT\x10\x04\x12\x07\n\x03\x41\x43K\x10\x06\x12\x07\n\x03NAK\x10\x15\x12\x07\n\x03\x43\x41N\x10\x18\x12\t\n\x05\x43TRLZ\x10\x1a\x42\x62\n\x14org.meshtastic.protoB\x0cXmodemProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00\x62\x06proto3"
|
|
9
|
-
|
|
10
|
-
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
11
|
-
pool.add_serialized_file(descriptor_data)
|
|
12
|
-
|
|
13
|
-
module Meshtastic
|
|
14
|
-
XModem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.XModem").msgclass
|
|
15
|
-
XModem::Control = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("meshtastic.XModem.Control").enummodule
|
|
16
|
-
end
|
data/lib/meshtastic.rb
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Plugin used to interact with Meshtastic nodes
|
|
4
|
-
module Meshtastic
|
|
5
|
-
require 'base64'
|
|
6
|
-
# Protocol Buffers for Meshtastic
|
|
7
|
-
require 'meshtastic/admin_pb'
|
|
8
|
-
require 'meshtastic/apponly_pb'
|
|
9
|
-
require 'meshtastic/atak_pb'
|
|
10
|
-
require 'meshtastic/cannedmessages_pb'
|
|
11
|
-
require 'meshtastic/channel_pb'
|
|
12
|
-
require 'meshtastic/clientonly_pb'
|
|
13
|
-
require 'meshtastic/config_pb'
|
|
14
|
-
require 'meshtastic/connection_status_pb'
|
|
15
|
-
require 'meshtastic/deviceonly_pb'
|
|
16
|
-
require 'meshtastic/device_ui_pb'
|
|
17
|
-
require 'meshtastic/interdevice_pb'
|
|
18
|
-
require 'meshtastic/localonly_pb'
|
|
19
|
-
require 'meshtastic/mesh_pb'
|
|
20
|
-
require 'meshtastic/module_config_pb'
|
|
21
|
-
require 'meshtastic/mqtt_pb'
|
|
22
|
-
require 'meshtastic/paxcount_pb'
|
|
23
|
-
require 'meshtastic/portnums_pb'
|
|
24
|
-
require 'meshtastic/powermon_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
|
-
|
|
32
|
-
require 'nanopb_pb'
|
|
33
|
-
require 'openssl'
|
|
34
|
-
|
|
35
|
-
autoload :Admin, 'meshtastic/admin'
|
|
36
|
-
autoload :Apponly, 'meshtastic/apponly'
|
|
37
|
-
autoload :ATAK, 'meshtastic/atak'
|
|
38
|
-
autoload :Cannedmessages, 'meshtastic/cannedmessages'
|
|
39
|
-
autoload :Channel, 'meshtastic/channel'
|
|
40
|
-
autoload :Clientonly, 'meshtastic/clientonly'
|
|
41
|
-
autoload :Config, 'meshtastic/config'
|
|
42
|
-
autoload :ConnectionStatus, 'meshtastic/connection_status'
|
|
43
|
-
autoload :Deviceonly, 'meshtastic/deviceonly'
|
|
44
|
-
autoload :Localonly, 'meshtastic/localonly'
|
|
45
|
-
autoload :MeshInterface, 'meshtastic/mesh_interface'
|
|
46
|
-
autoload :ModuleConfig, 'meshtastic/module_config'
|
|
47
|
-
autoload :MQTT, 'meshtastic/mqtt'
|
|
48
|
-
autoload :Paxcount, 'meshtastic/paxcount'
|
|
49
|
-
autoload :Portnums, 'meshtastic/portnums'
|
|
50
|
-
autoload :RemoteHardware, 'meshtastic/remote_hardware'
|
|
51
|
-
autoload :RTTTL, 'meshtastic/rtttl'
|
|
52
|
-
autoload :SerialInterface, 'meshtastic/serial_interface'
|
|
53
|
-
autoload :Storeforward, 'meshtastic/storeforward'
|
|
54
|
-
autoload :StreamInterface, 'meshtastic/stream_interface'
|
|
55
|
-
autoload :Telemetry, 'meshtastic/telemetry'
|
|
56
|
-
autoload :Util, 'meshtastic/util'
|
|
57
|
-
autoload :Xmodem, 'meshtastic/xmodem'
|
|
58
|
-
|
|
59
|
-
# Constants
|
|
60
|
-
NODELESS_WANT_CONFIG_ID = 69_420
|
|
61
|
-
START1 = 0x94
|
|
62
|
-
START2 = 0xC3
|
|
63
|
-
HEADER_LEN = 4
|
|
64
|
-
MAX_TO_FROM_RADIO_SIZE = 512
|
|
65
|
-
|
|
66
|
-
# Display a List of Every Meshtastic Module
|
|
67
|
-
|
|
68
|
-
public_class_method def self.help
|
|
69
|
-
constants.sort
|
|
70
|
-
end
|
|
71
|
-
end
|
data/lib/nanopb_pb.rb
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# source: nanopb.proto
|
|
4
|
-
|
|
5
|
-
require 'google/protobuf'
|
|
6
|
-
|
|
7
|
-
require 'google/protobuf/descriptor_pb'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
descriptor_data = "\n\x0cnanopb.proto\x1a google/protobuf/descriptor.proto\"\xa4\x07\n\rNanoPBOptions\x12\x10\n\x08max_size\x18\x01 \x01(\x05\x12\x12\n\nmax_length\x18\x0e \x01(\x05\x12\x11\n\tmax_count\x18\x02 \x01(\x05\x12&\n\x08int_size\x18\x07 \x01(\x0e\x32\x08.IntSize:\nIS_DEFAULT\x12$\n\x04type\x18\x03 \x01(\x0e\x32\n.FieldType:\nFT_DEFAULT\x12\x18\n\nlong_names\x18\x04 \x01(\x08:\x04true\x12\x1c\n\rpacked_struct\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0bpacked_enum\x18\n \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0cskip_message\x18\x06 \x01(\x08:\x05\x66\x61lse\x12\x18\n\tno_unions\x18\x08 \x01(\x08:\x05\x66\x61lse\x12\r\n\x05msgid\x18\t \x01(\r\x12\x1e\n\x0f\x61nonymous_oneof\x18\x0b \x01(\x08:\x05\x66\x61lse\x12\x15\n\x06proto3\x18\x0c \x01(\x08:\x05\x66\x61lse\x12#\n\x14proto3_singular_msgs\x18\x15 \x01(\x08:\x05\x66\x61lse\x12\x1d\n\x0e\x65num_to_string\x18\r \x01(\x08:\x05\x66\x61lse\x12\x1b\n\x0c\x66ixed_length\x18\x0f \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0b\x66ixed_count\x18\x10 \x01(\x08:\x05\x66\x61lse\x12\x1e\n\x0fsubmsg_callback\x18\x16 \x01(\x08:\x05\x66\x61lse\x12/\n\x0cmangle_names\x18\x11 \x01(\x0e\x32\x11.TypenameMangling:\x06M_NONE\x12(\n\x11\x63\x61llback_datatype\x18\x12 \x01(\t:\rpb_callback_t\x12\x34\n\x11\x63\x61llback_function\x18\x13 \x01(\t:\x19pb_default_field_callback\x12\x30\n\x0e\x64\x65scriptorsize\x18\x14 \x01(\x0e\x32\x0f.DescriptorSize:\x07\x44S_AUTO\x12\x1a\n\x0b\x64\x65\x66\x61ult_has\x18\x17 \x01(\x08:\x05\x66\x61lse\x12\x0f\n\x07include\x18\x18 \x03(\t\x12\x0f\n\x07\x65xclude\x18\x1a \x03(\t\x12\x0f\n\x07package\x18\x19 \x01(\t\x12\x41\n\rtype_override\x18\x1b \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.Type\x12\x19\n\x0bsort_by_tag\x18\x1c \x01(\x08:\x04true\x12.\n\rfallback_type\x18\x1d \x01(\x0e\x32\n.FieldType:\x0b\x46T_CALLBACK*i\n\tFieldType\x12\x0e\n\nFT_DEFAULT\x10\x00\x12\x0f\n\x0b\x46T_CALLBACK\x10\x01\x12\x0e\n\nFT_POINTER\x10\x04\x12\r\n\tFT_STATIC\x10\x02\x12\r\n\tFT_IGNORE\x10\x03\x12\r\n\tFT_INLINE\x10\x05*D\n\x07IntSize\x12\x0e\n\nIS_DEFAULT\x10\x00\x12\x08\n\x04IS_8\x10\x08\x12\t\n\x05IS_16\x10\x10\x12\t\n\x05IS_32\x10 \x12\t\n\x05IS_64\x10@*Z\n\x10TypenameMangling\x12\n\n\x06M_NONE\x10\x00\x12\x13\n\x0fM_STRIP_PACKAGE\x10\x01\x12\r\n\tM_FLATTEN\x10\x02\x12\x16\n\x12M_PACKAGE_INITIALS\x10\x03*E\n\x0e\x44\x65scriptorSize\x12\x0b\n\x07\x44S_AUTO\x10\x00\x12\x08\n\x04\x44S_1\x10\x01\x12\x08\n\x04\x44S_2\x10\x02\x12\x08\n\x04\x44S_4\x10\x04\x12\x08\n\x04\x44S_8\x10\x08:E\n\x0enanopb_fileopt\x12\x1c.google.protobuf.FileOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:G\n\rnanopb_msgopt\x12\x1f.google.protobuf.MessageOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:E\n\x0enanopb_enumopt\x12\x1c.google.protobuf.EnumOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptions:>\n\x06nanopb\x12\x1d.google.protobuf.FieldOptions\x18\xf2\x07 \x01(\x0b\x32\x0e.NanoPBOptionsB>\n\x18\x66i.kapsi.koti.jpa.nanopbZ\"github.com/meshtastic/go/generated"
|
|
11
|
-
|
|
12
|
-
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
13
|
-
pool.add_serialized_file(descriptor_data)
|
|
14
|
-
|
|
15
|
-
NanoPBOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("NanoPBOptions").msgclass
|
|
16
|
-
FieldType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("FieldType").enummodule
|
|
17
|
-
IntSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("IntSize").enummodule
|
|
18
|
-
TypenameMangling = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("TypenameMangling").enummodule
|
|
19
|
-
DescriptorSize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("DescriptorSize").enummodule
|
data/meshtastic.gemspec
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
lib = File.expand_path('lib', __dir__)
|
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
-
|
|
6
|
-
require 'meshtastic/version'
|
|
7
|
-
|
|
8
|
-
Gem::Specification.new do |spec|
|
|
9
|
-
ruby_version = ">= #{File.read('.ruby-version').split('-').last.chomp}".freeze
|
|
10
|
-
# spec.required_ruby_version = ruby_version
|
|
11
|
-
spec.required_ruby_version = '>= 3.3.0'
|
|
12
|
-
spec.name = 'meshtastic'
|
|
13
|
-
spec.version = Meshtastic::VERSION
|
|
14
|
-
spec.authors = ['0day Inc.']
|
|
15
|
-
spec.email = ['support@0dayinc.com']
|
|
16
|
-
spec.summary = 'Ruby gem for Meshtastic'
|
|
17
|
-
spec.description = 'https://github.com/0dayinc/meshtastic/README.md'
|
|
18
|
-
spec.homepage = 'https://github.com/0dayinc/meshtastic'
|
|
19
|
-
spec.license = 'MIT'
|
|
20
|
-
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
21
|
-
|
|
22
|
-
spec.files = `git ls-files -z`.split("\x00")
|
|
23
|
-
spec.executables = spec.files.grep(%r{^bin/}) do |f|
|
|
24
|
-
File.basename(f)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
spec_tests = spec.files.grep(%r{^spec/})
|
|
28
|
-
meshtastic_modules = spec.files.grep(%r{^lib/})
|
|
29
|
-
|
|
30
|
-
missing_rspec = false
|
|
31
|
-
meshtastic_modules.each do |mod_path|
|
|
32
|
-
spec_dirname_for_mod = "spec/#{File.dirname(mod_path)}"
|
|
33
|
-
spec_test_for_mod = "#{File.basename(mod_path).split('.').first}_spec.rb"
|
|
34
|
-
spec_path_for_mod = "#{spec_dirname_for_mod}/#{spec_test_for_mod}"
|
|
35
|
-
next unless spec_tests.grep(/#{spec_path_for_mod}/).empty?
|
|
36
|
-
|
|
37
|
-
missing_rspec = true
|
|
38
|
-
error_msg = "ERROR: No RSpec: #{spec_path_for_mod} for Meshtastic Module: #{mod_path}"
|
|
39
|
-
# Display error message in red (octal encoded ansi sequence)
|
|
40
|
-
puts "\001\e[1m\002\001\e[31m\002#{error_msg}\001\e[0m\002"
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
raise if missing_rspec
|
|
44
|
-
|
|
45
|
-
spec.require_paths = ['lib']
|
|
46
|
-
|
|
47
|
-
dev_dependency_arr = %i[
|
|
48
|
-
bundler
|
|
49
|
-
rake
|
|
50
|
-
rdoc
|
|
51
|
-
rspec
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
File.readlines('./Gemfile').each do |line|
|
|
55
|
-
columns = line.chomp.split
|
|
56
|
-
next unless columns.first == 'gem'
|
|
57
|
-
|
|
58
|
-
gem_name = columns[1].delete("'").delete(',')
|
|
59
|
-
gem_version = columns.last.delete("'")
|
|
60
|
-
|
|
61
|
-
if dev_dependency_arr.include?(gem_name.to_sym)
|
|
62
|
-
spec.add_development_dependency(
|
|
63
|
-
gem_name,
|
|
64
|
-
gem_version
|
|
65
|
-
)
|
|
66
|
-
else
|
|
67
|
-
spec.add_dependency(
|
|
68
|
-
gem_name,
|
|
69
|
-
gem_version
|
|
70
|
-
)
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/bin/bash --login
|
|
2
|
-
# USE THIS SCRIPT WHEN UPGRADING VERSIONS IN Gemfile
|
|
3
|
-
if [[ $MESHTASTIC_ROOT == '' ]]; then
|
|
4
|
-
if [[ ! -d '/opt/meshtastic' ]]; then
|
|
5
|
-
mesh_root=$(pwd)
|
|
6
|
-
else
|
|
7
|
-
mesh_root='/opt/meshtastic'
|
|
8
|
-
fi
|
|
9
|
-
else
|
|
10
|
-
mesh_root="${MESHTASTIC_ROOT}"
|
|
11
|
-
fi
|
|
12
|
-
|
|
13
|
-
if [[ -f '/etc/profile.d/rvm.sh' ]]; then
|
|
14
|
-
source /etc/profile.d/rvm.sh
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
ruby_version=`cat ${mesh_root}/.ruby-version`
|
|
18
|
-
ruby_gemset=`cat ${mesh_root}/.ruby-gemset`
|
|
19
|
-
rvm use ruby-$ruby_version@global
|
|
20
|
-
rvm gemset --force delete $ruby_gemset
|
|
21
|
-
if [[ -f "${mesh_root}/Gemfile.lock" ]]; then
|
|
22
|
-
rvmsudo rm $mesh_root/Gemfile.lock
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
rvm use ruby-$ruby_version@$ruby_gemset --create
|
|
26
|
-
export rvmsudo_secure_path=1
|
|
27
|
-
rvmsudo gem install bundler
|
|
28
|
-
rvmsudo bundle install
|
|
29
|
-
rvm --default ruby-$ruby_version@$ruby_gemset
|
data/sig/meshtastic.rbs
DELETED