Module: Meshtastic::Apponly

Defined in:
lib/meshtastic/apponly.rb

Class Method Summary collapse

Class Method Details

.authorsObject



19
20
21
# File 'lib/meshtastic/apponly.rb', line 19

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

.decode(opts = {}) ⇒ Object



14
15
16
17
# File 'lib/meshtastic/apponly.rb', line 14

public_class_method def self.decode(opts = {})
  bytes = opts[:bytes]
  Meshtastic::ChannelSet.decode(bytes)
end

.encode(opts = {}) ⇒ Object



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

public_class_method def self.encode(opts = {})
  set = Meshtastic::ChannelSet.new
  Array(opts[:settings]).each { |channel| set.settings << channel }
  set.lora_config = opts[:lora_config] if opts[:lora_config]
  set
end

.helpObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/meshtastic/apponly.rb', line 23

public_class_method def self.help
  puts "        USAGE:
    # Run the encode class method for this module.
    #{self}.encode(
      settings: 'optional - value for settings passed into encode',
      lora_config: 'optional - value for lora_config passed into encode'
    )

    # Run the decode class method for this module.
    #{self}.decode(
      bytes: 'optional - value for bytes passed into decode'
    )

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

  "
end