LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
Device interfacing

Callback of DAQ for input data. Callback should return false for a stop request. More...

Collaboration diagram for Device interfacing:

Modules

 RtAudio backend
 
 PortAudio backend
 
 UlDAQ specific code
 

Classes

class  Daq
 Base cass for all DAQ (Data Acquisition) interfaces. A DAQ can be a custom device, or for example a sound card. More...
 
class  DataTypeDescriptor
 Descriptor for data types containing more detailed information. More...
 
class  DaqApi
 Class that specifies API related information. An API configuration is part of the DAQConfiguration and used to address a certain physical device. For that, a specific backend needs to be compiled in. Examples of API's are RtAudio and UlDaq. More...
 
class  DaqChannel
 Stores channel configuration data for each channel. I.e. the physical quantity measured, sensitivity, device-specific channel settings, a channel name and others. More...
 
class  DaqConfiguration
 Configuration of a DAQ device. More...
 
class  DaqData
 Data coming from / going to DAQ. Non-interleaved format, which means data in buffer is ordered by channel: _ptr[frame+channel*nframes]. More...
 
class  DeviceInfo
 Structure containing device info parameters. More...
 
class  InDataHandler
 
class  StreamMgr
 Stream manager. Used to manage the input and output streams. Implemented as a singleton: only one stream manager can be in existance for a given program. The thread that instantiates a stream manager is the only thread that should interact with the stream manager. If this is not true, undefined behavior can be expected. If LASP is compiled in debug mode, this fact is asserted. More...
 
class  BufHandler
 
class  InBufHandler
 Specific helper for the input buffer. More...
 
class  OutBufHandler
 
class  UlDaqDeviceInfo
 UlDaq-specific device information. Adds a copy of the underlying DaqDeDaqDeviceDescriptor. More...
 
class  DT9837A
 Data translation DT9837A Daq device. More...
 

Typedefs

using InDaqCallback = std::function< void(const DaqData &)>
 
using OutDaqCallback = std::function< void(DaqData &)>
 
using boolvec = std::vector< bool >
 
using dvec = std::vector< double >
 
using usvec = std::vector< us >
 
using byte_t = char
 
using DeviceInfoList = std::vector< std::unique_ptr< DeviceInfo > >
 
using InCallbackType = std::function< void(const DaqData &)>
 The function definition of callbacks with incoming DAQ data.
 
using InResetType = std::function< void(const Daq *)>
 Function definition for the reset callback.
 

Functions

void throwOnPossibleUlException (UlError err)
 Throws an appropriate stream exception based on the UlError number. The mapping is based on the error numbers as given in uldaq.h. There are a log of errors definded here (109 in total). Except for some, we will map most of them to a driver error.
 
string getErrMsg (UlError err)
 Return a string corresponding to the UlDaq API error.
 
void showErr (UlError err)
 Print error message to stderr.
 
void showErr (std::string errstr)
 Get a string representation of the error.
 

Variables

const DataTypeDescriptor dtype_desc_fl32
 
const DataTypeDescriptor dtype_desc_fl64
 
const DataTypeDescriptor dtype_desc_int8
 
const DataTypeDescriptor dtype_desc_int16
 
const DataTypeDescriptor dtype_desc_int32
 
const std::map< DataTypeDescriptor::DataType, const DataTypeDescriptordtype_map
 
const std::vector< d > ULDAQ_SAMPLERATES
 List of available sampling frequencies for DT9837A.
 

Detailed Description

Callback of DAQ for input data. Callback should return false for a stop request.

Typedef Documentation

◆ boolvec

using boolvec = std::vector<bool>

Definition at line 14 of file lasp_daqconfig.h.

◆ byte_t

using byte_t = char

Definition at line 16 of file lasp_daqdata.h.

◆ DeviceInfoList

using DeviceInfoList = std::vector<std::unique_ptr<DeviceInfo> >

Definition at line 11 of file lasp_deviceinfo.h.

◆ dvec

using dvec = std::vector<double>

Definition at line 15 of file lasp_daqconfig.h.

◆ InCallbackType

using InCallbackType = std::function<void(const DaqData &)>

The function definition of callbacks with incoming DAQ data.

Definition at line 21 of file lasp_indatahandler.h.

◆ InDaqCallback

using InDaqCallback = std::function<void(const DaqData &)>

Definition at line 18 of file lasp_daq.h.

◆ InResetType

using InResetType = std::function<void(const Daq *)>

Function definition for the reset callback.

Definition at line 25 of file lasp_indatahandler.h.

◆ OutDaqCallback

using OutDaqCallback = std::function<void(DaqData &)>

Definition at line 23 of file lasp_daq.h.

◆ usvec

using usvec = std::vector<us>

Definition at line 16 of file lasp_daqconfig.h.

Function Documentation

◆ getErrMsg()

string getErrMsg ( UlError  err)

Return a string corresponding to the UlDaq API error.

Parameters
errerror code
Returns
Error string

◆ showErr() [1/2]

void showErr ( std::string  errstr)

Get a string representation of the error.

Parameters
errstr

◆ showErr() [2/2]

void showErr ( UlError  err)

Print error message to stderr.

Parameters
errstrThe string to print

◆ throwOnPossibleUlException()

void throwOnPossibleUlException ( UlError  err)

Throws an appropriate stream exception based on the UlError number. The mapping is based on the error numbers as given in uldaq.h. There are a log of errors definded here (109 in total). Except for some, we will map most of them to a driver error.

Parameters
eThe backend error code.

Variable Documentation

◆ dtype_desc_fl32

const DataTypeDescriptor dtype_desc_fl32
Initial value:
= {
.name = "32-bits floating point",
.sw = 4,
.is_floating = true,

Definition at line 73 of file lasp_daqconfig.h.

◆ dtype_desc_fl64

const DataTypeDescriptor dtype_desc_fl64
Initial value:
= {
.name = "64-bits floating point",
.sw = 8,
.is_floating = true,

Definition at line 78 of file lasp_daqconfig.h.

◆ dtype_desc_int16

const DataTypeDescriptor dtype_desc_int16
Initial value:
= {
.name = "16-bits integer",
.sw = 2,
.is_floating = false,

Definition at line 88 of file lasp_daqconfig.h.

◆ dtype_desc_int32

const DataTypeDescriptor dtype_desc_int32
Initial value:
= {
.name = "32-bits integer",
.sw = 4,
.is_floating = false,

Definition at line 93 of file lasp_daqconfig.h.

◆ dtype_desc_int8

const DataTypeDescriptor dtype_desc_int8
Initial value:
= {
.name = "8-bits integer",
.sw = 1,
.is_floating = false,

Definition at line 83 of file lasp_daqconfig.h.

◆ dtype_map

const std::map<DataTypeDescriptor::DataType, const DataTypeDescriptor> dtype_map
Initial value:

Definition at line 100 of file lasp_daqconfig.h.

◆ ULDAQ_SAMPLERATES

const std::vector<d> ULDAQ_SAMPLERATES
Initial value:
= {8000, 10000, 11025, 16000, 20000,
22050, 24000, 32000, 44056, 44100,
47250, 48000, 50000, 50400, 51000}

List of available sampling frequencies for DT9837A.

Definition at line 60 of file lasp_uldaq_common.h.