Commit d37b878c authored by Leigh Stoller's avatar Leigh Stoller

Update profile.py

parent c311967e
......@@ -2,7 +2,7 @@
"""
# Disable spectrum requests while debugging
Debugging = 1
Debugging = 0;
# Import the Portal object.
import geni.portal as portal
......@@ -27,6 +27,14 @@ pc.defineParameter("node_id", "Node ID",
pc.defineParameter("iface", "Interface",
portal.ParameterType.STRING, "rf0")
# Lower bound on a single frequency.
pc.defineParameter("lower", "Frequency Low",
portal.ParameterType.STRING, "")
# Upper bound on a single frequency.
pc.defineParameter("upper", "Frequency High",
portal.ParameterType.STRING, "")
# Retrieve the values the user specifies during instantiation.
params = pc.bindParameters()
......@@ -35,6 +43,10 @@ if params.node_id.strip() == "":
pc.reportError(portal.ParameterError("You must specify a node.", ["node_id"]))
if params.iface.strip() == "":
pc.reportError(portal.ParameterError("You must specify an interface.", ["iface"]))
if params.lower.strip() == "":
pc.reportError(portal.ParameterError("You must specify lower frequency", ["lower"]))
if params.upper.strip() == "":
pc.reportError(portal.ParameterError("You must specify an upper frequency", ["upper"]))
# Throw the errors back to the user.
pc.verifyParameters()
......@@ -52,14 +64,14 @@ if Debugging == 0:
iface = node.addInterface("rf")
iface.component_id = params.iface
# First arg is frequency low bound, second is high bound, third is max power.
iface.requestSpectrum(910, 920, -10)
iface.requestSpectrum(params.lower, params.upper, 0)
# Request to use spectrum on any TX devices attached to the node.
node.requestSpectrum(1710, 1720, 5.5)
node.requestSpectrum(1730, 1740, -30)
node.requestSpectrum(params.lower, params.upper, 0)
node.requestSpectrum(params.lower, params.upper, 0)
# Request spectrum to use across the all nodes in the experiment.
request.requestSpectrum(1750, 1775.5, -20)
request.requestSpectrum(params.lower, params.upper, 0)
pass
# Print the RSpec to the enclosing page.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment