Version 11 (modified by 4 years ago) ( diff ) | ,
---|
Site Navigation
Service: RF Switch
This service is used to configure the RF switch boxes attached to certain nodes in sb1.cosmos-lab.org and sb2.cosmos-lab.org allowing the experimenter to select how nodes and antennas are connected.
RF Switch Boxes:
Name Location Connected Nodes/Devices rfsw1.sb1.cosmos-lab.org COSMOS Sandbox 1 rfdev3-1, rfdev3-2, rfdev3-5 rfsw2.sb1.cosmos-lab.org COSMOS Sandbox 1 rfdev3-2, rfdev3-4, rfdev3-6 rfsw3.sb1.cosmos-lab.org COSMOS Sandbox 1 … rfsw4.sb1.cosmos-lab.org COSMOS Sandbox 1 … rfsw-s1-lg1.sb2.cosmos-lab.org COSMOS Sandbox 2 sdr1-s1-lg1, sdr2-s1-lg1 rfsw-md1.sb2.cosmos-lab.org COSMOS Sandbox 2 sdr1-md1, sdr2-md1
Please visit the individual sandbox specific pages in the wiki for detailed block diagrams of the possible RF connections that can be made.
Usage
All the available methods are accessible from the a testbed console via an HTTP API located at am1.cosmos-lab.org:5054/rf_switch
. This API can be interacted with via a command line tool such as "curl" or any script using a "REST client" library.
Get the current configuration
This API call is used to get the current configuration of the RF switch box(es). The response will specify the switch/port configurations of the RF switch box(es) in question.
HTTP API Path: am1.cosmos-lab.org:5054/rf_switch/status
Parameters:
Name Decription Required Acceptable Input name Comma separated list of RF switch box FQDNs Y (list of RF switch boxes)
Example 1
HTTP Request:
am1.cosmos-lab.org:5054/rf_switch/status?name=rfsw1.sb1.cosmos-lab.org
Response:
<response status="OK"> <rf_switch name="rfsw1.sb1.cosmos-lab.org" num_of_switches="4"> <switch number="1" port="1"/> <switch number="2" port="1"/> <switch number="3" port="1"/> <switch number="4" port="1"/> </rf_switch> </response>
Example 2
HTTP Request:
am1.cosmos-lab.org:5054/rf_switch/status?name=rfsw1.sb1.cosmos-lab.org,rfsw2.sb1.cosmos-lab.org
Response:
<response status="OK"> <rf_switch name="rfsw1.sb1.cosmos-lab.org" num_of_switches="4"> <switch number="1" port="1"/> <switch number="2" port="1"/> <switch number="3" port="1"/> <switch number="4" port="1"/> </rf_switch> <rf_switch name="rfsw2.sb1.cosmos-lab.org" num_of_switches="4"> <switch number="1" port="1"/> <switch number="2" port="1"/> <switch number="3" port="1"/> <switch number="4" port="1"/> </rf_switch> </response>
Configure the RF switch
HTTP API Path: am1.cosmos-lab.org:5054/rf_switch/set
Parameters:
Name Decription Required Acceptable Input name Comma separated list of RF switch box FQDNs Y (list of RF switch boxes) switch Comma separated list of switch(es) to configure Y (list of switch numbers) port Port to select on RF switch Y 1, 2
Example 1
For rfsw1.sb1.cosmos-lab.org
and rfsw2.sb1.cosmos-lab.org
, configure switches 2
and 3
to the second port.
HTTP Request:
am1.cosmos-lab.org:5054/rf_switch/set?name=rfsw1.sb1.cosmos-lab.org,rfsw2.sb1.cosmos-lab.org&switch=2,3&port=2
Response:
<response status="OK"> <message>OK</message> </response>