Module: Meshtastic::Traceroute
- Defined in:
- lib/meshtastic/traceroute.rb
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
22 23 24 |
# File 'lib/meshtastic/traceroute.rb', line 22 public_class_method def self. "AUTHOR(S):\n 0day Inc. <[email protected]>\n " end |
.encode(opts = {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/meshtastic/traceroute.rb', line 7 public_class_method def self.encode(opts = {}) discovery = Meshtastic::RouteDiscovery.new Array(opts[:route]).each { |hop| discovery.route << hop } discovery end |
.help ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/meshtastic/traceroute.rb', line 26 public_class_method def self.help puts " USAGE: # Run the encode class method for this module. #{self}.encode( route: 'optional - value for route passed into 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 20 |
# File 'lib/meshtastic/traceroute.rb', line 13 public_class_method def self.send(opts = {}) data = Meshtastic::Data.new( portnum: :TRACEROUTE_APP, payload: encode(opts).to_proto, want_response: true ) Meshtastic.deliver_data(opts.merge(data: data, port_num: Meshtastic::PortNum::TRACEROUTE_APP, want_response: true)) end |