dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::usb::pipe< device_t > Class Template Reference

#include <dx_usb_device.h>

Inheritance diagram for dx::usb::pipe< device_t >:
Collaboration diagram for dx::usb::pipe< device_t >:

Public Types

typedef device<> device_t
typedef device<> device_t
enum  type

Public Member Functions

pipe & abort ()
virtual void callback ()
 catch (const std::out_of_range &exception)
pipe & clear (bool force=false)
void conclude () noexcept override
 conclude notification: object will be removed. If you overwrite conclude() you also need to overwrite destructor and check if its needed to be called from there. Called only through try_conclude() - never call this directly from outside the class hierarchy.
pipe & drain (std::chrono::milliseconds timeout=std::chrono::milliseconds(250)) noexcept
 waits for already-submitted requests to complete on their own, without cancelling them
void exception (const dx::exception &exception, bool filtered=false) const noexcept override
 notification exception handler
void exception (const dx::exception &exception, bool filtered=false) const noexcept override
 notification exception handler
uint64_t frame (int64_t *timestamp=nullptr)
 current bus frame number; timestamp: dx::timestamp() of the readout
virtual void free () noexcept
void info (std::ostream &os) noexcept override
 log object class information
super & initialize (bool signalled=false) override
super & initialize (const std::string &name, bool signalled=false) override
pipe & max_frame_size (uint32_t frame_size)
 operator const os_event () const noexcept
 operator os_event () noexcept
 operator::HANDLE () const noexcept
template<typename data_t>
pipe & operator<< (const data_t &data)
 synchronous USB write request
template<typename data_t>
pipe & operator>> (data_t &data)
 synchronous USB read request
bool outstanding () const noexcept
 pipe (device_t &device, const usb::endpoint &endpoint)
bool poll (usb::isoc::result &result) noexcept
 pulls the oldest completed isoc request's result
pipe & read (void *data, size_t &size)
 synchronous USB read request
virtual pipe & receive (void *data, size_t size)
 asynchronous USB read request
super & reset (uint64_t=0) override
super & signal (uint64_t=1) override
uint64_t signalled () const
uint64_t signalled () const
os_result status () const noexcept
pipe & submit (const request< data_t > &request) const
 standard request to pipe
virtual pipe & transmit (const void *data, size_t &size)
 asynchronous USB write request
bool try_conclude () noexcept
 atomically conclude()s if currently launched; returns whether this call did it
bool try_conclude () noexcept
 atomically conclude()s if currently launched; returns whether this call did it
bool try_launch ()
 atomically launch()es if not already launched; returns whether this call did it
bool try_launch ()
 atomically launch()es if not already launched; returns whether this call did it
super & wait (bool reset=false) override
template<typename rep_t, typename period_t>
bool wait (const std::chrono::duration< rep_t, period_t > &timeout, bool reset=false)
template<typename rep_t, typename period_t>
bool wait (const std::chrono::duration< rep_t, period_t > &timeout, bool reset=false)
pipe & write (const void *data, size_t size)
 synchronous USB write request
 ~pipe () override

Static Public Member Functions

static unsigned int micro_frames (const device_t &device, uint8_t bInterval)
 an endpoint's requests per frame: its interval at high speed, one below
static void wait (::HANDLE handle, int64_t timeout=0)

Public Attributes

const usb::endpoint::attributesattributes {reinterpret_cast<const struct usb::endpoint::attributes&>(bmAttributes)}
std::deque< union audio::descriptor::endpointaudio
uint8_t bRefresh {}
 audio class endpoint: 2^bRefresh frames between two feedback values
uint8_t bSynchAddress {}
 audio class endpoint: the isoc sync endpoint pacing this one, 0: none
class buffer
buffer
::WINUSB_INTERFACE_HANDLE handle
interface & interface
std::atomic< bool > launched
std::atomic< bool > launched
unsigned int micro_frames
promoted< uint32_tstart
promoted< uint32_tstart
promoted< bool > started
promoted< bool > started

Static Public Attributes

static constexpr auto max
static constexpr auto scope = kernel

Protected Member Functions

virtual void launch ()
 launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.
virtual void received (os_result, size_t)
 virtual async callbacks
virtual void transmitted (os_result, size_t)

Protected Attributes

struct { 
address
usb::isoc::result completed [max]
 isoc completions in callback order, filled by the runloop, drained by poll()
device<> & device
device<> & device
std::function< void()> flush_hook
std::function< void()> flush_hook
std::function< void()> halt_hook
std::function< void()> halt_hook
uint8_t idx
struct { 
   class buffer
   }   buffer
   unsigned int   micro_frames = 0 
isoc
::HANDLE process {::GetCurrentProcess()}
std::function< void()> run_hook
std::function< void()> run_hook
volatile unsigned int rx
volatile unsigned int tx
struct { 
   ::WINUSB_INTERFACE_HANDLE   handle 
winusb

Member Typedef Documentation

◆ device_t [1/2]

typedef device<> dx::stream::object< device<> >::device_t
inherited

◆ device_t [2/2]

typedef device<> dx::stream::object< device<> >::device_t
inherited

Member Enumeration Documentation

◆ type

Constructor & Destructor Documentation

◆ pipe()

template<typename device_t = device<>>
dx::usb::pipe< device_t >::pipe ( device_t & device,
const usb::endpoint & endpoint )
inline
Here is the call graph for this function:

◆ ~pipe()

template<typename device_t = device<>>
dx::usb::pipe< device_t >::~pipe ( )
inlineoverride
Here is the call graph for this function:

Member Function Documentation

◆ abort()

pipe & dx::usb::platform::pipe< device<>, interface >::abort ( )
inlineinherited
Here is the caller graph for this function:

◆ callback()

virtual void dx::event< kernel >::callback ( )
inlinevirtualinherited

The default implementation is based on event<user> which is signalled when triggered via callback() from kernel. This is to achieve compatibility with Windows events. Its probably more adequate to overwrite callback() and do the work here if feasible.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ catch()

template<typename device_t = device<>>
dx::usb::pipe< device_t >::catch ( const std::out_of_range & exception)
inline

◆ clear()

pipe & dx::usb::platform::pipe< device<>, interface >::clear ( bool force = false)
inlineinherited

◆ conclude()

template<typename device_t = device<>>
void dx::usb::pipe< device_t >::conclude ( )
inlineoverridevirtualnoexcept

conclude notification: object will be removed. If you overwrite conclude() you also need to overwrite destructor and check if its needed to be called from there. Called only through try_conclude() - never call this directly from outside the class hierarchy.

Reimplemented from dx::stream::control< stream::object< device<> > >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drain()

pipe & dx::usb::platform::pipe< device<>, interface >::drain ( std::chrono::milliseconds timeout = std::chrono::milliseconds(250))
inlinenoexceptinherited

waits for already-submitted requests to complete on their own, without cancelling them

Here is the caller graph for this function:

◆ exception() [1/2]

void dx::stream::object< device<> >::exception ( const dx::exception & exception,
bool filtered = false ) const
inlineoverridevirtualnoexceptinherited

notification exception handler

Implements dx::object.

◆ exception() [2/2]

void dx::stream::object< device<> >::exception ( const dx::exception & exception,
bool filtered = false ) const
inlineoverridevirtualnoexceptinherited

notification exception handler

Implements dx::object.

◆ frame()

uint64_t dx::usb::platform::pipe< device<>, interface >::frame ( int64_t * timestamp = nullptr)
inlineinherited

current bus frame number; timestamp: dx::timestamp() of the readout

◆ free()

◆ info()

template<typename device_t = device<>>
void dx::usb::pipe< device_t >::info ( std::ostream & os)
inlineoverridevirtualnoexcept

log object class information

< Bit D7 indicates a requirement for wMaxPacketSize packets.; D7: MaxPacketsOnly

< D1..0: Pitch Control; D3..2: Data Overrun Control; D5..4: Data Underrun Control; D7..6: Reserved. Must be set to 0.

< Indicates the units used for the wLockDelay field: 0: Undefined; 1: Milliseconds; 2: Decoded PCM samples; 3..255: Reserved

< Indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry. Units used depend on the value of the bLockDelayUnits field.

< Number of Embedded MIDI Jacks: n.

< ID of the n-th Embedded Jack that is associated with this endpoint.

Reimplemented from dx::stream::control< stream::object< device<> > >.

Reimplemented in dx::usb::stream::pipe< device_t, circular_t, stream_t >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize() [1/2]

super & dx::event< kernel >::initialize ( bool signalled = false)
inlineoverridevirtualinherited

Reimplemented from dx::abstract::event.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize() [2/2]

super & dx::event< kernel >::initialize ( const std::string & name,
bool signalled = false )
inlineoverridevirtualinherited

Reimplemented from dx::abstract::event.

Here is the call graph for this function:

◆ launch()

virtual void dx::object::launch ( )
inlineprotectedvirtualinherited

launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.

◆ max_frame_size()

template<typename device_t = device<>>
pipe & dx::usb::pipe< device_t >::max_frame_size ( uint32_t frame_size)
inline

◆ micro_frames()

template<typename device_t = device<>>
unsigned int dx::usb::pipe< device_t >::micro_frames ( const device_t & device,
uint8_t bInterval )
inlinestatic

an endpoint's requests per frame: its interval at high speed, one below

Here is the caller graph for this function:

◆ operator const os_event()

template<::HANDLE invalid_t = INVALID_HANDLE_VALUE>
dx::resource< invalid_t >::operator const os_event ( ) const
inlinenoexceptinherited

◆ operator os_event()

dx::event< kernel >::operator os_event ( )
inlinenoexceptinherited

◆ operator::HANDLE()

template<::HANDLE invalid_t = INVALID_HANDLE_VALUE>
dx::resource< invalid_t >::operator::HANDLE ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator<<()

template<typename device_t = device<>>
template<typename data_t>
pipe & dx::usb::pipe< device_t >::operator<< ( const data_t & data)
inline

synchronous USB write request

Here is the call graph for this function:

◆ operator>>()

template<typename device_t = device<>>
template<typename data_t>
pipe & dx::usb::pipe< device_t >::operator>> ( data_t & data)
inline

synchronous USB read request

Here is the call graph for this function:

◆ outstanding()

bool dx::usb::platform::pipe< device<>, interface >::outstanding ( ) const
inlinenoexceptinherited

asynchronous requests in flight

◆ poll()

bool dx::usb::platform::pipe< device<>, interface >::poll ( usb::isoc::result & result)
inlinenoexceptinherited

pulls the oldest completed isoc request's result

◆ read()

pipe & dx::usb::platform::pipe< device<>, interface >::read ( void * data,
size_t & size )
inlineinherited

synchronous USB read request

Here is the caller graph for this function:

◆ receive()

virtual pipe & dx::usb::platform::pipe< device<>, interface >::receive ( void * data,
size_t size )
inlinevirtualinherited

asynchronous USB read request

◆ received()

virtual void dx::usb::platform::pipe< device<>, interface >::received ( os_result ,
size_t  )
inlineprotectedvirtualinherited

virtual async callbacks

◆ reset()

super & dx::event< kernel >::reset ( uint64_t = 0)
inlineoverridevirtualinherited

Implements dx::abstract::event.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ signal()

super & dx::event< kernel >::signal ( uint64_t = 1)
inlineoverridevirtualinherited

Implements dx::abstract::event.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ signalled() [1/2]

uint64_t dx::event< user >::signalled ( ) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ signalled() [2/2]

uint64_t dx::event< user >::signalled ( ) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ status()

os_result dx::usb::platform::pipe< device<>, interface >::status ( ) const
inlinenoexceptinherited

◆ submit()

pipe & dx::usb::platform::pipe< device<>, interface >::submit ( const request< data_t > & request) const
inlineinherited

standard request to pipe

◆ transmit()

virtual pipe & dx::usb::platform::pipe< device<>, interface >::transmit ( const void * data,
size_t & size )
inlinevirtualinherited

asynchronous USB write request

◆ transmitted()

virtual void dx::usb::platform::pipe< device<>, interface >::transmitted ( os_result ,
size_t  )
inlineprotectedvirtualinherited

◆ try_conclude() [1/2]

bool dx::object::try_conclude ( )
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

◆ try_conclude() [2/2]

bool dx::object::try_conclude ( )
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

◆ try_launch() [1/2]

bool dx::object::try_launch ( )
inlineinherited

atomically launch()es if not already launched; returns whether this call did it

◆ try_launch() [2/2]

bool dx::object::try_launch ( )
inlineinherited

atomically launch()es if not already launched; returns whether this call did it

◆ wait() [1/4]

void dx::event< kernel >::wait ( ::HANDLE handle,
int64_t timeout = 0 )
inlinestaticinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait() [2/4]

super & dx::event< kernel >::wait ( bool reset = false)
inlineoverridevirtualinherited

Implements dx::abstract::event.

Here is the call graph for this function:

◆ wait() [3/4]

template<typename rep_t, typename period_t>
bool dx::event< user >::wait ( const std::chrono::duration< rep_t, period_t > & timeout,
bool reset = false )
inlineinherited

wait with duration timeout returns true: signalled false: timed out

Here is the call graph for this function:

◆ wait() [4/4]

template<typename rep_t, typename period_t>
bool dx::event< user >::wait ( const std::chrono::duration< rep_t, period_t > & timeout,
bool reset = false )
inlineinherited

wait with duration timeout returns true: signalled false: timed out

Here is the call graph for this function:

◆ write()

pipe & dx::usb::platform::pipe< device<>, interface >::write ( const void * data,
size_t size )
inlineinherited

synchronous USB write request

Here is the caller graph for this function:

Member Data Documentation

◆ [struct]

struct { ... } dx::usb::platform::pipe< device<>, interface >::address

◆ attributes

template<typename device_t = device<>>
const usb::endpoint::attributes& dx::usb::pipe< device_t >::attributes {reinterpret_cast<const struct usb::endpoint::attributes&>(bmAttributes)}

◆ audio

std::deque<union audio::descriptor::endpoint> dx::usb::__::endpoint::audio
inherited

◆ bRefresh

uint8_t dx::usb::__::endpoint::bRefresh {}
inherited

audio class endpoint: 2^bRefresh frames between two feedback values

◆ bSynchAddress

uint8_t dx::usb::__::endpoint::bSynchAddress {}
inherited

audio class endpoint: the isoc sync endpoint pacing this one, 0: none

◆ [class]

class { ... } ::buffer dx::usb::platform::pipe< device<>, interface >::buffer

◆ completed

usb::isoc::result dx::usb::platform::pipe< device<>, interface >::completed[max]
protectedinherited

isoc completions in callback order, filled by the runloop, drained by poll()

◆ device [1/2]

device<>& dx::stream::object< device<> >::device
protectedinherited

◆ device [2/2]

device<>& dx::stream::object< device<> >::device
protectedinherited

◆ flush_hook [1/2]

std::function<void()> dx::stream::control< dx::stream::object< device<> > >::flush_hook
protectedinherited

◆ flush_hook [2/2]

std::function<void()> dx::stream::control< stream::object< device<> > >::flush_hook
protectedinherited

◆ halt_hook [1/2]

std::function<void()> dx::stream::control< dx::stream::object< device<> > >::halt_hook
protectedinherited

◆ halt_hook [2/2]

std::function<void()> dx::stream::control< stream::object< device<> > >::halt_hook
protectedinherited

◆ handle

::WINUSB_INTERFACE_HANDLE dx::usb::platform::pipe< device<>, interface >::handle
inherited

◆ idx

uint8_t dx::usb::platform::pipe< device<>, interface >::idx
protectedinherited

◆ interface

interface & dx::usb::platform::pipe< device<>, interface >::interface
inherited

◆ [struct]

struct { ... } dx::usb::platform::pipe< device<>, interface >::isoc

◆ launched [1/2]

std::atomic<bool> dx::object::launched
inherited

◆ launched [2/2]

std::atomic<bool> dx::object::launched
inherited

◆ max

constexpr auto dx::usb::platform::pipe< device<>, interface >::max
staticconstexprinherited

◆ micro_frames

◆ process

template<::HANDLE invalid_t = INVALID_HANDLE_VALUE>
::HANDLE dx::resource< invalid_t >::process {::GetCurrentProcess()}
protectedinherited

◆ run_hook [1/2]

std::function<void()> dx::stream::control< dx::stream::object< device<> > >::run_hook
protectedinherited

◆ run_hook [2/2]

std::function<void()> dx::stream::control< stream::object< device<> > >::run_hook
protectedinherited

◆ rx

volatile unsigned int dx::usb::platform::pipe< device<>, interface >::rx
protectedinherited

◆ scope

constexpr auto dx::event< kernel >::scope = kernel
staticconstexprinherited

◆ start [1/2]

◆ start [2/2]

◆ started [1/2]

◆ started [2/2]

◆ tx

volatile unsigned int dx::usb::platform::pipe< device<>, interface >::tx
protectedinherited

◆ [struct]

struct { ... } dx::usb::platform::pipe< device<>, interface >::winusb

The documentation for this class was generated from the following file:

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.