Old/Documentation/OTG/ScriptsRepository: caliberexp.rb

File caliberexp.rb, 1.6 KB (added by zhibinwu, 14 years ago)
Line 
1Experiment.name = "caliber-1b"
2Experiment.project = "orbit:tutorial"
3
4#define variables used in experimennt
5
6txPowerLevel = [ 1, 10, 50, 100]
7channelSetting = [1,2,3,4,5,6,7,8,9,10,11]
8
9#
10# Define nodes used in experiment
11#
12#defNodes('otgSender', [1,2]) {|node|
13#  node.image = nil  # assume the right image to be on disk
14#  node.prototype("test:proto:sender", {
15#    'destinationHost' => '192.168.1.1',
16#    'packetSize' => 1024,
17#    'rate' => 300,
18#    'protocol' => 'udp'
19#  })
20#  node.net.w0.mode = "master"
21#}
22
23defNodes('rssiMonitorCard0', [1,1]) {|node|
24  node.image = nil  # assume the right image to be on disk
25  node.prototype("test:proto:rssimonitor" , {
26    'interface' => 'ath0',
27    'txpowerSetting' => 1,
28  })
29  node.net.w0.mode = "monitor"
30  node.net.w0.type = 'b'
31  node.net.w0.channel = 6
32  node.net.w0.essid = "helloworld"
33  node.net.w0.ip = "%192.168.%x.%y"
34}
35
36#defNodes('rssiMonitorCard1', [1,1]) {|node|
37#  node.image = nil  # assume the right image to be on disk
38#  node.prototype("test:proto:rssimonitor" , {
39#    'interface' => 'ath1',
40#    'txpowerSetting' => 1,
41#  })
42#  node.net.w1.mode = "monitor"
43#}
44
45#allNodes.net.w0 { |w|
46#  w.type = 'b'
47#  w.channel = 6
48#  w.essid = "helloworld"
49#  w.ip = "%192.168.%x.%y"
50#}
51
52whenAllInstalled() {|node|
53
54  nodes('rssiMonitorCard0').startApplications
55 
56  channelnumber.each {|channelSetting|
57   nodes('sender').net.w0.channel = channelnumber
58   wait 30
59 }
60
61#
62# Now, start the application
63#
64whenAllInstalled() {|node|
65  wait 30
66  #nodes('otgSender').startApplications
67  #wait 10
68  #nodes('otgSender').stopApplications
69  nodes('rssiMonitor').startApplications
70  #allNodes.startApplications
71  wait 10
72
73  Experiment.done
74}