[[TOC(depth=3)]] = 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. [[BR]] == 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. [[BR]] === Get the current configuration === This API call is used to get the current configuration of the RF front end(s) with respect to a node or list of nodes. The response will specify the parameters of the TX chain for the node(s) in question. It will show for a given node's `rf_port`, what `antenna` would be used if it were `connected`, whether the power amplifier (`power_amp`) is on or off, and the lower frequency (`f_lower`) and upper frequency (`f_upper`) of the filters. HTTP API Path: `am1.cosmos-lab.org:5054/rf_swtich/status` Parameters: ||= '''Name''' =||= '''Decription''' =||= '''Required''' =||= '''Acceptable Input''' =|| || name || Comma separated list of RF switch box FQDNs || Y || (list of RF switch boxes) || [[BR]] ==== Example 1 ==== HTTP Request: {{{ am1.cosmos-lab.org:5054/rf_switch/status?name=rfsw1.sb1.cosmos-lab.org }}} Response: {{{ }}} [[BR]] ==== Example 2 ==== HTTP Request: {{{ am1.cosmos-lab.org:5054/rf_switch/status?name=rfsw1.sb1.cosmos-lab.org&rfsw2.sb1.cosmos-lab.org }}} Response: {{{ }}} [[BR]] === Configure the RF switch === HTTP API Path: `am1.cosmos-lab.org:5054/rf_control/set_tx_path` Parameters: ||= '''Name''' =||= '''Decription''' =||= '''Required''' =||= '''Acceptable Input''' =|| || name || Comma separated list of RF switch box FQDNs || Y || (list of RF switch boxes) || || switch || Switch(es) to configure on the RF switch box || Y || 1, 2, 3, 4 || || port || Port to select on RF switch || Y || 1, 2 || [[BR]] ==== Example 1 ==== For `sdr1-s1-lg1` in `bed` testbed, connect TX RF ports 0 and 1 to their respective antennas, turn on the power amplifier, and request a frequency of 2.4-2.5 GHz. HTTP Request: {{{ am1.cosmos-lab.org:5054/rf_control/set_tx_path?node=sdr1-s1-lg1.bed.cosmos-lab.org&rf_port=0,1&power_amp=on&f_lower=2400&f_upper=2500 }}} Response: {{{ OK }}}