mirror of
https://github.com/nqrduck/LimeDriverBindings.git
synced 2024-11-10 12:40:04 +00:00
Enhance device channel handling
Introduced a new utility function to extract and return the number of channels associated with a given device, improving the driver's ability to handle device-specific configurations. Also expanded the C++ bindings by importing the pair class, which is pivotal for representing the channel information. This enhancement facilitates more granular control and paves the way for future features that may require detailed channel info.
This commit is contained in:
parent
0696cc3b20
commit
ce89c445d7
1 changed files with 8 additions and 1 deletions
|
@ -7,6 +7,7 @@ from libc.string cimport memcpy, strcpy
|
|||
|
||||
from libcpp.vector cimport vector
|
||||
from libcpp.string cimport string
|
||||
from libcpp.pair cimport pair
|
||||
|
||||
import pathlib
|
||||
|
||||
|
@ -95,6 +96,8 @@ cdef extern from "limedriver.h":
|
|||
|
||||
cdef int run_experiment_from_LimeCfg(LimeConfig_t config)
|
||||
|
||||
cdef pair[int, int] getChannelsFromInfo(string device)
|
||||
|
||||
cdef vector[string] getDeviceList()
|
||||
|
||||
|
||||
|
@ -718,4 +721,8 @@ cdef class PyLimeConfig:
|
|||
|
||||
def get_device_list():
|
||||
cdef vector[string] devices = getDeviceList()
|
||||
return [device.decode('utf-8') for device in devices]
|
||||
return [device.decode('utf-8') for device in devices]
|
||||
|
||||
def get_channels_for_device(device):
|
||||
cdef pair[int, int] channels = getChannelsFromInfo(device)
|
||||
return channels.first, channels.second
|
||||
|
|
Loading…
Reference in a new issue