XML-RPC Tools
Tools for connecting to running flowgraphs via XML-RPC and controlling variables.
connect
Connect to a GNU Radio XML-RPC endpoint by URL.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
url | str | - | XML-RPC URL (e.g., http://localhost:8080) |
Returns
Type: ConnectionInfoModel
Connection details including URL and port.
Example
connect(url="http://localhost:8080")# Returns: ConnectionInfoModel(# url="http://localhost:8080",# xmlrpc_port=8080,# container_name=None# )connect_to_container
Connect to a flowgraph by container name (resolves port automatically).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | Container name |
Returns
Type: ConnectionInfoModel
Connection details.
Example
connect_to_container(name="fm-radio")# Returns: ConnectionInfoModel(# url="http://localhost:32768",# xmlrpc_port=32768,# container_name="fm-radio"# )disconnect
Disconnect from the current XML-RPC (and ControlPort) endpoint.
Returns
Type: bool
True if successful.
Example
disconnect()# Returns: Trueget_status
Get runtime status including connection and container info.
Returns
Type: RuntimeStatusModel
Current runtime state.
Example
status = get_status()# Returns: RuntimeStatusModel(# connected=True,# connection=ConnectionInfoModel(...),# containers=[ContainerModel(...), ...]# )list_variables
List all XML-RPC-exposed variables.
Returns
Type: list[VariableModel]
List of variables with name, value, and type.
Example
vars = list_variables()# Returns: [# VariableModel(name="freq", value=101100000.0, type="float"),# VariableModel(name="gain", value=40, type="int"),# VariableModel(name="samp_rate", value=2000000.0, type="float"),# ]get_variable
Get a variable value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | Variable name |
Returns
Type: Any
Current variable value.
Example
freq = get_variable(name="freq")set_variable
Set a variable value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | - | Variable name |
value | Any | - | New value |
Returns
Type: bool
True if successful.
Example
set_variable(name="freq", value=98.5e6)# Returns: Truestart
Start the connected flowgraph.
Returns
Type: bool
True if successful.
Example
start()# Returns: Truestop
Stop the connected flowgraph.
Returns
Type: bool
True if successful.
Example
stop()# Returns: Truelock
Lock the flowgraph for thread-safe parameter updates.
Returns
Type: bool
True if successful.
Example
lock()set_variable(name="freq", value=102.7e6)set_variable(name="gain", value=35)unlock()unlock
Unlock the flowgraph after parameter updates.
Returns
Type: bool
True if successful.
Example
unlock()# Returns: True