LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp_deviceinfo.cpp
Go to the documentation of this file.
1#include <pybind11/stl.h>
2#include <stdint.h>
3#include <iostream>
4#include "lasp_deviceinfo.h"
5
6using std::cerr;
7namespace py = pybind11;
8
9void init_deviceinfo(py::module& m) {
10
12 py::class_<DeviceInfo> devinfo(m, "DeviceInfo");
13 devinfo.def("__str__", [](const DeviceInfo& d) {return d.device_name;});
14 devinfo.def_readonly("api", &DeviceInfo::api);
15 devinfo.def_readonly("device_name", &DeviceInfo::device_name);
16
17 devinfo.def_readonly("availableDataTypes", &DeviceInfo::availableDataTypes);
18 devinfo.def_readonly("prefDataTypeIndex", &DeviceInfo::prefDataTypeIndex);
19
20 devinfo.def_readonly("availableSampleRates",
22 devinfo.def_readonly("prefSampleRateIndex", &DeviceInfo::prefSampleRateIndex);
23
24 devinfo.def_readonly("availableFramesPerBlock",
26 devinfo.def_readonly("prefFramesPerBlockIndex",
28
29 devinfo.def_readonly("availableInputRanges",
31 devinfo.def_readonly("prefInputRangeIndex", &DeviceInfo::prefInputRangeIndex);
32
33 devinfo.def_readonly("ninchannels", &DeviceInfo::ninchannels);
34 devinfo.def_readonly("noutchannels", &DeviceInfo::noutchannels);
35 devinfo.def_readonly("hasInputIEPE", &DeviceInfo::hasInputIEPE);
36 devinfo.def_readonly("hasInputACCouplingSwitch",
38
39 devinfo.def_readonly("physicalOutputQty", &DeviceInfo::physicalOutputQty);
40
41}
42
Structure containing device info parameters.
unsigned ninchannels
The number of input channels available for the device.
unsigned noutchannels
The number of output channels available for the device.
dvec availableSampleRates
Available sample rates the device can run on.
string device_name
The name of the device.
std::vector< DataTypeDescriptor::DataType > availableDataTypes
The available data types the device can output.
DaqChannel::Qty physicalOutputQty
The physical quantity of the output signal. For 'normal' audio devices, this is typically a 'number' ...
int prefDataTypeIndex
The device's prefferd data type.
bool hasInputACCouplingSwitch
Whether the device is capable of enabling a hardware AC-coupling.
usvec availableFramesPerBlock
Available latency-setting (number of frames passed in each callback).
int prefInputRangeIndex
Its preffered range.
DaqApi api
Backend API corresponding to device.
us prefFramesPerBlockIndex
Preffered number of frames per callback.
dvec availableInputRanges
Available ranges for the input, i.e. +/- 1V and/or +/- 10 V etc.
int prefSampleRateIndex
Preferred setting for the sample rate.
bool hasInputIEPE
Whether the device is capable to provide IEPE constant current power supply.
void init_deviceinfo(py::module &m)