meshtastic 0.0.182 → 0.0.184
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/documentation/README.md +5 -0
- data/documentation/admin-backup.md +369 -0
- data/documentation/admin-channel.md +6 -6
- data/documentation/admin-config.md +5 -5
- data/documentation/admin-firmware-hex.md +57 -0
- data/documentation/admin-firmware-serial.md +1 -1
- data/documentation/admin-firmware-uf2.md +94 -0
- data/documentation/admin-firmware.md +52 -10
- data/documentation/admin.md +12 -2
- data/documentation/module-config.md +8 -4
- data/documentation/rtttl.md +8 -4
- data/lib/meshtastic/admin/backup.rb +560 -0
- data/lib/meshtastic/admin/channel.rb +6 -3
- data/lib/meshtastic/admin/config.rb +14 -14
- data/lib/meshtastic/admin/firmware/hex.rb +209 -0
- data/lib/meshtastic/admin/firmware/uf2.rb +166 -0
- data/lib/meshtastic/admin/firmware.rb +55 -13
- data/lib/meshtastic/admin.rb +60 -23
- data/lib/meshtastic/config_pb.rb +1 -1
- data/lib/meshtastic/mesh_pb.rb +1 -1
- data/lib/meshtastic/module_config.rb +22 -4
- data/lib/meshtastic/module_config_pb.rb +2 -1
- data/lib/meshtastic/rtttl.rb +22 -4
- data/lib/meshtastic/version.rb +1 -1
- data/spec/lib/meshtastic/admin/backup_spec.rb +704 -0
- data/spec/lib/meshtastic/admin/channel_spec.rb +23 -9
- data/spec/lib/meshtastic/admin/config_spec.rb +28 -12
- data/spec/lib/meshtastic/admin/firmware/hex_spec.rb +160 -0
- data/spec/lib/meshtastic/admin/firmware/uf2_spec.rb +234 -0
- data/spec/lib/meshtastic/admin/firmware_spec.rb +106 -3
- data/spec/lib/meshtastic/admin_spec.rb +106 -40
- data/spec/lib/meshtastic/module_config_spec.rb +47 -0
- data/spec/lib/meshtastic/rtttl_spec.rb +47 -0
- metadata +10 -1
data/lib/meshtastic/rtttl.rb
CHANGED
|
@@ -11,11 +11,25 @@ module Meshtastic
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
public_class_method def self.set(opts = {})
|
|
14
|
-
Admin.send(opts.merge(set_ringtone_message: opts.fetch(:ringtone)))
|
|
14
|
+
Admin.send(admin_options(opts).merge(set_ringtone_message: opts.fetch(:ringtone)))
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
public_class_method def self.get(opts = {})
|
|
18
|
-
Admin.send(opts.merge(get_ringtone_request: true))
|
|
18
|
+
Admin.send(admin_options(opts).merge(get_ringtone_request: true))
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Keep the external transport aliases out of the Admin API.
|
|
22
|
+
private_class_method def self.admin_options(opts = {})
|
|
23
|
+
options = opts.merge({})
|
|
24
|
+
keys = %i[transport_obj serial_obj bluetooth_obj tcp_obj mqtt_obj]
|
|
25
|
+
selected = keys.reject { |name| options[name].nil? }
|
|
26
|
+
raise ArgumentError, 'provide exactly one transport connection' if selected.length > 1
|
|
27
|
+
|
|
28
|
+
key = selected.first
|
|
29
|
+
connection = options[key] if key
|
|
30
|
+
keys.each { |name| options.delete(name) }
|
|
31
|
+
options[:transport_obj] = connection if key
|
|
32
|
+
options
|
|
19
33
|
end
|
|
20
34
|
|
|
21
35
|
public_class_method def self.authors
|
|
@@ -28,10 +42,14 @@ module Meshtastic
|
|
|
28
42
|
#{self}.encode
|
|
29
43
|
|
|
30
44
|
# Run the set class method for this module.
|
|
31
|
-
#{self}.set
|
|
45
|
+
#{self}.set(transport_obj: connection, ringtone: ringtone)
|
|
32
46
|
|
|
33
47
|
# Run the get class method for this module.
|
|
34
|
-
#{self}.get
|
|
48
|
+
#{self}.get(transport_obj: connection)
|
|
49
|
+
|
|
50
|
+
# Legacy serial_obj:, bluetooth_obj:, tcp_obj:, mqtt_obj: remain accepted.
|
|
51
|
+
# Supply one non-nil connection only; mixed connection options are rejected.
|
|
52
|
+
# Remote setters inherit Admin automatic sessions, not persistence readback.
|
|
35
53
|
|
|
36
54
|
# Run the authors class method for this module.
|
|
37
55
|
#{self}.authors
|
data/lib/meshtastic/version.rb
CHANGED