2#include "debugtrace.hpp"
3#include "lasp_config.h"
14const us MAX_ULDAQ_DEV_COUNT_PER_API = 100;
21 unsigned int numdevs = MAX_ULDAQ_DEV_COUNT_PER_API;
23 DaqDeviceDescriptor devdescriptors[MAX_ULDAQ_DEV_COUNT_PER_API];
24 DaqDeviceDescriptor descriptor;
25 DaqDeviceInterface interfaceType = ANY_IFC;
27 err = ulGetDaqDeviceInventory(interfaceType, devdescriptors, &numdevs);
29 if (err != ERR_NO_ERROR) {
30 throw rte(
"UlDaq device inventarization failed");
33 DEBUGTRACE_PRINT(
string(
"Number of devices: ") + std::to_string(numdevs));
34 for (
unsigned i = 0; i < numdevs; i++) {
36 descriptor = devdescriptors[i];
41 devinfo.
api = uldaqapi;
44 string productname = descriptor.productName;
45 if (productname !=
"DT9837A") {
46 throw rte(
"Unknown UlDAQ type: " + productname);
49 switch (descriptor.devInterface) {
55 name =
"Bluetooth - ";
63 name =
"Uknown interface = ";
66 name += productname +
" " + string(descriptor.uniqueId);
96 devinfolist.push_back(std::make_unique<UlDaqDeviceInfo>(devinfo));
104 if (_info ==
nullptr) {
105 throw rte(
"BUG: Could not cast DeviceInfo to UlDaqDeviceInfo");
107 return std::make_unique<DT9837A>(*_info, config);
Configuration of a DAQ device.
Structure containing device info parameters.
unsigned ninchannels
The number of input channels available for the device.
bool duplexModeForced
This flag is used to be able to indicate that the device cannot run input and output streams independ...
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.
bool hasInternalOutputMonitor
Whether the device has an internal monitor of the output signal. If true, the device is able to monit...
bool hasInputTrigger
Whether the device is able to trigger on input.
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.
UlDaq-specific device information. Adds a copy of the underlying DaqDeDaqDeviceDescriptor.
DaqDeviceDescriptor _uldaqDescriptor
std::vector< std::unique_ptr< DeviceInfo > > DeviceInfoList
const std::vector< d > ULDAQ_SAMPLERATES
List of available sampling frequencies for DT9837A.
std::unique_ptr< Daq > createUlDaqDevice(const DeviceInfo &devinfo, const DaqConfiguration &config)
void fillUlDaqDeviceInfo(DeviceInfoList &devinfolist)
Append device info list with UlDaq specific devices, if any.
size_t us
We often use boolean values.