dxd - dynax driver framework 3.0.2
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()
 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
pipe& max_frame_size(uint32_t frame_size)
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)
 the endpoint in the setting its stream's configuration selects - one the desc does not stream (a vendor bulk endpoint) in its interface's current setting
 pipe(device_t& device, const usb::endpoint& endpoint, uint8_t setting)
 the endpoint as the given setting of its interface states it
bool poll(usb::isoc::result& result) noexcept
 pulls the oldest completed 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
os_result status() const noexcept
pipe& submit(const request<data_t>& request) const
 standard request to pipe
pipe& transfer(bool in, void* data, size_t& size)
 a synchronous transfer: asynchronous underneath, past timeout the pipe aborted and the transfer failed as timed out - IOKit completes every request, an aborted one included
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. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish
bool try_launch()
 atomically launch()es if not already launched; returns whether this call did it. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish
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

Public Attributes

const usb::endpoint::attributes& attributes{reinterpret_cast<const struct usb::endpoint::attributes&>(bmAttributes)}
std::deque<union audio::descriptor::endpoint> audio
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
interface& interface
std::atomic<bool> launched
std::atomic<bool> launched
promoted<uint32_t> start
promoted<uint32_t> start
promoted<bool> started
promoted<bool> started
std::chrono::milliseconds timeout

Static Public Attributes

static constexpr auto max

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 dx::usb::platform::pipe:: { ... }  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 dx::usb::platform::pipe:: { ... }  isoc
std::function<void()> run_hook
std::function<void()> run_hook
volatile unsigned int rx
volatile unsigned int tx
struct dx::usb::platform::pipe:: { ... }  winusb

Friends

std::ostream& operator <<(std::ostream& os, pipe& pipe)

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() [1/2]

template<typename device_t= device<>>
dx::usb::pipe<device_t>::pipe(device_t& device, const usb::endpoint& endpoint)
inline

the endpoint in the setting its stream's configuration selects - one the desc does not stream (a vendor bulk endpoint) in its interface's current setting

Here is the call graph for this function:

◆ pipe() [2/2]

template<typename device_t= device<>>
dx::usb::pipe<device_t>::pipe(device_t& device, const usb::endpoint& endpoint, uint8_t setting)
inline

the endpoint as the given setting of its interface states it

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:

◆ 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

◆ 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 <<()

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 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

◆ 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

◆ transfer()

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

a synchronous transfer: asynchronous underneath, past timeout the pipe aborted and the transfer failed as timed out - IOKit completes every request, an aborted one included

◆ 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. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish

◆ try_launch() [2/2]

bool dx::object::try_launch()
inlineinherited

atomically launch()es if not already launched; returns whether this call did it. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish

◆ 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:

◆ operator <<

template<typename device_t= device<>>
std::ostream& operator <<(std::ostream& os, pipe<device_t>& pipe)
friend

< 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.

Member Data Documentation

◆ address

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

◆ 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

◆ idx

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

◆ interface

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

◆ isoc

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

◆ 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

◆ start [1/2]

◆ start [2/2]

◆ started [1/2]

◆ started [2/2]

◆ timeout

std::chrono::milliseconds dx::usb::platform::pipe<device<>, interface>::timeout
inherited

a synchronous transfer's bound, 0: none

◆ tx

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

◆ winusb

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

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