diff --git a/pyproject.toml b/pyproject.toml index 85ff8e8..173e588 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "limedriver" -version = "0.3.0" +version = "0.4.0" description = "Python bindings for limedriver" authors = [{name = "Kumi", email = "limedriver@kumi.email"}] license = {file = "LICENSE"} diff --git a/src/limedriver/limedriver.pyx b/src/limedriver/limedriver.pyx index 4bd4a5e..63bc855 100644 --- a/src/limedriver/limedriver.pyx +++ b/src/limedriver/limedriver.pyx @@ -5,13 +5,15 @@ from cpython.mem cimport PyMem_Malloc, PyMem_Free from libc.stdlib cimport malloc, free from libc.string cimport memcpy, strcpy - +from libcpp.vector cimport vector from libcpp.string cimport string import pathlib cdef extern from "limedriver.h": cdef struct LimeConfig_t: + string device + float srate int channel int TX_matching @@ -92,6 +94,8 @@ cdef extern from "limedriver.h": cdef LimeConfig_t initializeLimeConfig(int Npulses) cdef int run_experiment_from_LimeCfg(LimeConfig_t config) + + cdef vector[string] getDeviceList() cdef class PyLimeConfig: @@ -703,4 +707,7 @@ cdef class PyLimeConfig: path = self.save_path + self.file_stamp + '_' + self.file_pattern + '.h5' path = pathlib.Path(path).absolute() return path - \ No newline at end of file + +def get_device_list(): + cdef vector[string] devices = getDeviceList() + return [device.decode('utf-8') for device in devices] \ No newline at end of file