Skip to content

Block Tools

Tools for managing block parameters and inspecting input/output ports.

get_block_params

Get all parameters for a block.

Parameters

NameTypeDefaultDescription
block_namestr-Name of the block

Returns

Type: list[ParamModel]

List of parameters with key, value, name, and type.

Example

params = get_block_params(block_name="osmosdr_source_0")
# Returns: [
# ParamModel(key="freq", value="101.1e6", name="Ch0: Frequency", dtype="real"),
# ParamModel(key="sample_rate", value="2e6", name="Sample Rate", dtype="real"),
# ...
# ]

set_block_params

Set parameters on a block.

Parameters

NameTypeDefaultDescription
block_namestr-Name of the block
paramsdict[str, Any]-Dict of parameter key → value

Returns

Type: bool

True if successful.

Example

set_block_params(block_name="osmosdr_source_0", params={
"freq": "101.1e6",
"sample_rate": "2e6",
"gain": "40"
})
# Returns: True

get_block_sources

Get output ports (sources) for a block.

Parameters

NameTypeDefaultDescription
block_namestr-Name of the block

Returns

Type: list[PortModel]

List of output ports with key, name, and data type.

Example

sources = get_block_sources(block_name="osmosdr_source_0")
# Returns: [
# PortModel(key="0", name="out", dtype="complex", direction="source")
# ]

get_block_sinks

Get input ports (sinks) for a block.

Parameters

NameTypeDefaultDescription
block_namestr-Name of the block

Returns

Type: list[PortModel]

List of input ports with key, name, and data type.

Example

sinks = get_block_sinks(block_name="low_pass_filter_0")
# Returns: [
# PortModel(key="0", name="in", dtype="complex", direction="sink")
# ]

bypass_block

Bypass a block (pass signal through without processing).

Parameters

NameTypeDefaultDescription
block_namestr-Name of the block to bypass

Returns

Type: bool

True if successful.

Example

bypass_block(block_name="low_pass_filter_0")
# Returns: True

unbypass_block

Re-enable a bypassed block.

Parameters

NameTypeDefaultDescription
block_namestr-Name of the block to unbypass

Returns

Type: bool

True if successful.

Example

unbypass_block(block_name="low_pass_filter_0")
# Returns: True