mirror of
https://github.com/nqrduck/LimeDriverBindings.git
synced 2024-06-30 01:09:09 +00:00
Bump version and add device listing
Updated the project version reflecting new features. Extended the LimeConfig_t struct to include a device string supporting device specification. Introduced a new function `get_device_list` in the Python binding, allowing users to retrieve a list of available devices, enhancing usability. This change improves user interactions with the hardware, making device management more intuitive.
This commit is contained in:
parent
a47961e311
commit
f48c034011
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "limedriver"
|
name = "limedriver"
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
description = "Python bindings for limedriver"
|
description = "Python bindings for limedriver"
|
||||||
authors = [{name = "Kumi", email = "limedriver@kumi.email"}]
|
authors = [{name = "Kumi", email = "limedriver@kumi.email"}]
|
||||||
license = {file = "LICENSE"}
|
license = {file = "LICENSE"}
|
||||||
|
|
|
@ -5,13 +5,15 @@ from cpython.mem cimport PyMem_Malloc, PyMem_Free
|
||||||
from libc.stdlib cimport malloc, free
|
from libc.stdlib cimport malloc, free
|
||||||
from libc.string cimport memcpy, strcpy
|
from libc.string cimport memcpy, strcpy
|
||||||
|
|
||||||
|
from libcpp.vector cimport vector
|
||||||
from libcpp.string cimport string
|
from libcpp.string cimport string
|
||||||
|
|
||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
cdef extern from "limedriver.h":
|
cdef extern from "limedriver.h":
|
||||||
cdef struct LimeConfig_t:
|
cdef struct LimeConfig_t:
|
||||||
|
string device
|
||||||
|
|
||||||
float srate
|
float srate
|
||||||
int channel
|
int channel
|
||||||
int TX_matching
|
int TX_matching
|
||||||
|
@ -93,6 +95,8 @@ cdef extern from "limedriver.h":
|
||||||
|
|
||||||
cdef int run_experiment_from_LimeCfg(LimeConfig_t config)
|
cdef int run_experiment_from_LimeCfg(LimeConfig_t config)
|
||||||
|
|
||||||
|
cdef vector[string] getDeviceList()
|
||||||
|
|
||||||
|
|
||||||
cdef class PyLimeConfig:
|
cdef class PyLimeConfig:
|
||||||
cdef LimeConfig_t _config
|
cdef LimeConfig_t _config
|
||||||
|
@ -704,3 +708,6 @@ cdef class PyLimeConfig:
|
||||||
path = pathlib.Path(path).absolute()
|
path = pathlib.Path(path).absolute()
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
def get_device_list():
|
||||||
|
cdef vector[string] devices = getDeviceList()
|
||||||
|
return [device.decode('utf-8') for device in devices]
|
Loading…
Reference in a new issue