Module: Meshtastic::Storeforward

Defined in:
lib/meshtastic/storeforward.rb

Class Method Summary collapse

Class Method Details

.authorsObject



21
22
23
# File 'lib/meshtastic/storeforward.rb', line 21

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/storeforward.rb', line 7

public_class_method def self.encode(opts = {})
  message = Meshtastic::StoreAndForward.new
  message.rr = opts.fetch(:rr, :ROUTER_HEARTBEAT)
  message
end

.helpObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/meshtastic/storeforward.rb', line 25

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

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

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

  "
end

.send(opts = {}) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/meshtastic/storeforward.rb', line 13

public_class_method def self.send(opts = {})
  data = Meshtastic::Data.new(
    portnum: :STORE_FORWARD_APP,
    payload: encode(opts).to_proto
  )
  Meshtastic.deliver_data(opts.merge(data: data, port_num: Meshtastic::PortNum::STORE_FORWARD_APP))
end