Module: Meshtastic::RTTTL

Defined in:
lib/meshtastic/rtttl.rb

Class Method Summary collapse

Class Method Details

.authorsObject



35
36
37
# File 'lib/meshtastic/rtttl.rb', line 35

public_class_method def self.authors
  "AUTHOR(S):\n        0day Inc. <[email protected]>\n      "
end

.encode(opts = {}) ⇒ Object



7
8
9
10
11
# File 'lib/meshtastic/rtttl.rb', line 7

public_class_method def self.encode(opts = {})
  config = Meshtastic::RTTTLConfig.new
  config.ringtone = opts.fetch(:ringtone, '')
  config
end

.get(opts = {}) ⇒ Object



17
18
19
# File 'lib/meshtastic/rtttl.rb', line 17

public_class_method def self.get(opts = {})
  Admin.send(admin_options(opts).merge(get_ringtone_request: true))
end

.helpObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/meshtastic/rtttl.rb', line 39

public_class_method def self.help
  puts "        USAGE:
    # Run the encode class method for this module.
    #{self}.encode

    # Run the set class method for this module.
    #{self}.set(transport_obj: connection, ringtone: ringtone)

    # Run the get class method for this module.
    #{self}.get(transport_obj: connection)

    # Legacy serial_obj:, bluetooth_obj:, tcp_obj:, mqtt_obj: remain accepted.
    # Supply one non-nil connection only; mixed connection options are rejected.
    # Remote setters inherit Admin automatic sessions, not persistence readback.

    # Run the authors class method for this module.
    #{self}.authors

  "
end

.set(opts = {}) ⇒ Object



13
14
15
# File 'lib/meshtastic/rtttl.rb', line 13

public_class_method def self.set(opts = {})
  Admin.send(admin_options(opts).merge(set_ringtone_message: opts.fetch(:ringtone)))
end