Skip to content

Commit 4ea7abb

Browse files
committed
changed device_identifier to serial number
1 parent 1114bbb commit 4ea7abb

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

python_bladerf/pybladerf_tools/pybladerf_sweep.pyx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ cdef void process_data(object device):
188188

189189
cpdef void pybladerf_sweep(frequencies: list = None, sample_rate: int = 61_000_000, baseband_filter_bandwidth: int = None,
190190
gain: int = 20, bin_width: int = 100_000, channel: int = 0, oversample: bool = False, antenna_enable: bool = False,
191-
sweep_style: pybladerf.pybladerf_sweep_style = pybladerf.pybladerf_sweep_style.PYBLADERF_SWEEP_STYLE_INTERLEAVED, device_identifier: str = None,
191+
sweep_style: pybladerf.pybladerf_sweep_style = pybladerf.pybladerf_sweep_style.PYBLADERF_SWEEP_STYLE_INTERLEAVED, serial_number: str = None,
192192
binary_output: bool = False, one_shot: bool = False, num_sweeps: int = None,
193193
filename: str = None, queue: object = None,
194194
print_to_console: bool = True,
@@ -199,7 +199,10 @@ cpdef void pybladerf_sweep(frequencies: list = None, sample_rate: int = 61_000_0
199199

200200
channel = pybladerf.PYBLADERF_CHANNEL_RX(channel)
201201

202-
device = pybladerf.pybladerf_open(device_identifier)
202+
if serial_number is None:
203+
device = pybladerf.pybladerf_open()
204+
else:
205+
device = pybladerf.pybladerf_open_by_serial(serial_number)
203206
run_available[device.serialno] = True
204207

205208
if oversample:

python_bladerf/pybladerf_tools/pybladerf_transfer.pyx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,19 @@ cpdef void tx_process(object device):
237237

238238
cpdef void pybladerf_transfer(frequency: int = None, sample_rate: int = 10_000_000, baseband_filter_bandwidth: int = None,
239239
gain: int = 0, channel: int = 0, oversample: bool = False, antenna_enable: bool = False,
240-
repeat_tx: bool = False, synchronize: bool = False, num_samples: int = None, device_identifier: str = None,
240+
repeat_tx: bool = False, synchronize: bool = False, num_samples: int = None, serial_number: str = None,
241241
rx_filename: str = None, tx_filename: str = None, rx_buffer: object = None, tx_buffer: object = None,
242242
print_to_console: bool = True):
243243

244244
global run_available, device_data
245245

246246
init_signals()
247247

248-
device = pybladerf.pybladerf_open(device_identifier)
248+
if serial_number is None:
249+
device = pybladerf.pybladerf_open()
250+
else:
251+
device = pybladerf.pybladerf_open_by_serial(serial_number)
252+
249253
run_available[device.serialno] = True
250254

251255
if oversample:

0 commit comments

Comments
 (0)