Class: Geppeto::Commands::Mesh

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/mesh.rb

Instance Method Summary collapse

Constructor Details

#initialize(scout) ⇒ Mesh

Returns a new instance of Mesh.



4
5
6
# File 'lib/commands/mesh.rb', line 4

def initialize(scout)
  @scout = scout
end

Instance Method Details

#config(scout_id, troop_id, channel = 20) ⇒ Object



8
9
10
# File 'lib/commands/mesh.rb', line 8

def config(scout_id, troop_id, channel=20)
  @scout.request("mesh.config", scout_id, troop_id, channel)
end

#ingroup?(group) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/commands/mesh.rb', line 36

def ingroup?(group)
  @scout.request("mesh.ingroup").to_i == 1
end

#joingroup(group) ⇒ Object



28
29
30
# File 'lib/commands/mesh.rb', line 28

def joingroup(group)
  @scout.request("mesh.joingroup", group.to_i)
end

#leavegroup(group) ⇒ Object



32
33
34
# File 'lib/commands/mesh.rb', line 32

def leavegroup(group)
  @scout.request("mesh.leavegroup", group.to_i)
end

#reportObject



40
41
42
# File 'lib/commands/mesh.rb', line 40

def report
  @scout.request("mesh.report")
end

#resetkeyObject



24
25
26
# File 'lib/commands/mesh.rb', line 24

def resetkey
  @scout.request("mesh.resetkey")
end

#routingObject



44
45
46
# File 'lib/commands/mesh.rb', line 44

def routing
  @scout.request("mesh.routing")
end

#setdatarate(rate) ⇒ Object



16
17
18
# File 'lib/commands/mesh.rb', line 16

def setdatarate(rate)
  @scout.request("mesh.setdatarate", rate.to_i)
end

#setkey(key) ⇒ Object



20
21
22
# File 'lib/commands/mesh.rb', line 20

def setkey(key)
  @scout.request("mesh.setkey", key)
end

#setpowerlevel(level) ⇒ Object



12
13
14
# File 'lib/commands/mesh.rb', line 12

def setpowerlevel(level)
  @scout.request("mesh.setpowerlevel", level.to_i)
end