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

#include <dx_usb_device.h>

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

Classes

struct  attributes
 

Public Types

enum class  type : uint8_t {
  control =::kUSBControl , isoc = ::kUSBIsoc , bulk = ::kUSBBulk , irq = ::kUSBInterrupt ,
  control =::UsbdPipeTypeControl , isoc = ::UsbdPipeTypeIsochronous , bulk = ::UsbdPipeTypeBulk , irq = ::UsbdPipeTypeInterrupt
}
 
enum class  type : unsigned char {
  control =::kUSBControl , isoc = ::kUSBIsoc , bulk = ::kUSBBulk , irq = ::kUSBInterrupt ,
  control =::UsbdPipeTypeControl , isoc = ::UsbdPipeTypeIsochronous , bulk = ::UsbdPipeTypeBulk , irq = ::UsbdPipeTypeInterrupt
}
 

Public Member Functions

pipeabort () try
 
pipeabort () try
 
 dx_catchall_rethrow () os_result status() const noexcept
 
 dx_catchall_rethrow () uint64_t frame()
 
 dx_catchall_rethrow (;,"endpoint:%x interface:%d setting:%d", endpoint.address, endpoint.interface, endpoint.setting) bool in() const noexcept
 
 dx_catchall_rethrow (try {clear();} dx_catchall(), "handle:%p idx:%d EP:%02x data:%p size:%lld", winusb.handle, idx, address, data, size) template< typename data_t > pipe &operator<<(const data_t &data)
 
 dx_catchall_rethrow (try {clear();} dx_catchall(), "handle:%p idx:%d EP:%02x data:%p size:%lld", winusb.handle, idx, address, data, size) template< typename data_t > pipe &operator>>(data_t &data)
 
 dx_catchall_rethrow (try {clear();} dx_catchall(), "idx:%d EP:%02x", idx, address) pipe &clear() try
 
 dx_catchall_rethrow (try {const_cast< pipe * >(this) ->clear();} dx_catchall_handler(this,), "idx:%d size:%lld", idx, sizeof request) template< typename data_t > data_t submit(const control &control) const
 control request to pipe
 
void free () noexcept
 
 if (tx==max) tx=0
 
bool in () const noexcept
 bus initializer (isoc, bulk, pci, etc.) compatibility
 
pipeinfo () noexcept
 
eventinitialize (::HKEY registry, ::DWORD filter=REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_ATTRIBUTES|REG_NOTIFY_CHANGE_LAST_SET|REG_NOTIFY_CHANGE_SECURITY, bool subtree=true)
 
eventinitialize (bool signalled)
 
pipemax_frame_size (uint32_t frame_size)
 
 operator const os_event () const noexcept
 
 operator os_event () noexcept
 
 operator::HANDLE () const noexcept
 
template<typename data_t >
pipeoperator<< (const data_t &data)
 synchronous USB write request
 
template<typename data_t >
pipeoperator>> (data_t &data)
 synchronous USB read request
 
 pipe (device_t &device, const usb::endpoint &endpoint)
 
piperead (void *data, size_t size) try
 synchronous USB read request
 
pipereceive (void *data, size_t size) try
 asynchronous USB read request
 
void reset ()
 
void signal ()
 
virtual void start (unsigned int=1)
 async IO thread control (required for Windows compatibility)
 
virtual unsigned int stop (bool=false) noexcept
 
template<typename data_t >
pipesubmit (const request< data_t > &request) const try
 standard request to pipe
 
void wait (int64_t timeout=0)
 
pipewrite (const void *data, size_t size) try
 synchronous USB write request
 

Static Public Member Functions

static void wait (::HANDLE handle, int64_t timeout=0)
 

Public Attributes

const struct dx::usb::pipe::attributes & attributes = reinterpret_cast<const struct attributes&>(bmAttributes)
 
std::deque< union audio::descriptor::endpointaudio
 
device_t & device
 
uint64_t ::USBD_ISO_PACKET_DESCRIPTOR * frame
 
uint64_tsequence
 
return * this
 
size_t size try
 
 tx
 
enum dx::usb::platform::pipe::type type
 

Protected Member Functions

virtual void exception (const dx::exception &exception, bool filtered=false) const noexcept
 
virtual void exception (const dx::exception &exception, bool filtered=false) const noexcept
 
virtual void received (os_result, size_t)
 virtual async callbacks
 
virtual void received (os_result, size_t)
 virtual async callbacks
 
virtual void received (os_result, size_t, int64_t, usb::isoc::frame *)
 
virtual void received (os_result, size_t, int64_t, usb::isoc::frame *)
 
virtual void start (unsigned int starting=1)
 async IO thread control
 
virtual unsigned int stop (bool=false) noexcept
 
virtual void transmitted (os_result, size_t)
 
virtual void transmitted (os_result, size_t)
 
virtual void transmitted (os_result, size_t, int64_t, usb::isoc::frame *)
 
virtual void transmitted (os_result, size_t, int64_t, usb::isoc::frame *)
 
 ~pipe () noexcept override
 

Protected Attributes

struct { 
 
address 
 
uint8_t address = 0
 
uint8_t idx = 0
 
interface_t & interface
 
struct { 
 
   class buffer
 
   }   buffer 
 
   unsigned int   micro_frames = 0 
 
isoc 
 
struct dx::usb::platform::pipe::isoc isoc
 
::HANDLE process = ::GetCurrentProcess()
 
struct { 
 
   ::WINUSB_INTERFACE_HANDLE   handle 
 
winusb 
 

Member Enumeration Documentation

◆ type [1/2]

template<typename device_t , typename interface_t >
enum class enum dx::usb::platform::pipe::type dx::usb::platform::pipe< device_t, interface_t >::type
stronginherited
Enumerator
control 
isoc 
bulk 
irq 
control 
isoc 
bulk 
irq 

◆ type [2/2]

template<typename device_t , typename interface_t >
enum class dx::usb::platform::pipe::type : unsigned char
stronginherited
Enumerator
control 
isoc 
bulk 
irq 
control 
isoc 
bulk 
irq 

Constructor & Destructor Documentation

◆ ~pipe()

template<typename device_t = device>
dx::usb::pipe< device_t >::~pipe ( )
inlineoverrideprotectedvirtualnoexcept

◆ pipe()

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

Member Function Documentation

◆ abort() [1/2]

template<typename device_t , typename interface_t >
pipe & dx::usb::platform::pipe< device_t, interface_t >::abort ( )
inlineinherited

◆ abort() [2/2]

template<typename device_t , typename interface_t >
pipe & dx::usb::platform::pipe< device_t, interface_t >::abort ( )
inlineinherited

◆ dx_catchall_rethrow() [1/7]

template<typename device_t , typename interface_t >
dx::usb::platform::pipe< device_t, interface_t >::dx_catchall_rethrow ( ) const
inlinenoexceptinherited

◆ dx_catchall_rethrow() [2/7]

template<typename device_t , typename interface_t >
dx::usb::platform::pipe< device_t, interface_t >::dx_catchall_rethrow ( )
inlineinherited

◆ dx_catchall_rethrow() [3/7]

template<typename device_t = device>
dx::usb::pipe< device_t >::dx_catchall_rethrow ( ; ,
"endpoint:%x interface:%d setting:%d" ,
endpoint. address,
endpoint. interface,
endpoint. setting ) const
inlinenoexcept

◆ dx_catchall_rethrow() [4/7]

template<typename device_t , typename interface_t >
dx::usb::platform::pipe< device_t, interface_t >::dx_catchall_rethrow ( try { clear);} dx_catchall(,
"handle:%p idx:%d EP:%02x data:%p size:%lld" ,
winusb. handle,
idx ,
address ,
data ,
size  ) const &
inlineinherited

◆ dx_catchall_rethrow() [5/7]

template<typename device_t , typename interface_t >
dx::usb::platform::pipe< device_t, interface_t >::dx_catchall_rethrow ( try { clear);} dx_catchall(,
"handle:%p idx:%d EP:%02x data:%p size:%lld" ,
winusb. handle,
idx ,
address ,
data ,
size  ) &
inlineinherited

◆ dx_catchall_rethrow() [6/7]

template<typename device_t , typename interface_t >
dx::usb::platform::pipe< device_t, interface_t >::dx_catchall_rethrow ( try { clear);} dx_catchall(,
"idx:%d EP:%02x" ,
idx ,
address  ) &
inlineinherited

◆ dx_catchall_rethrow() [7/7]

template<typename device_t , typename interface_t >
dx::usb::platform::pipe< device_t, interface_t >::dx_catchall_rethrow ( try {const_cast< pipe< device_t, interface_t > * > this) ->clear();} dx_catchall_handler(this,,
"idx:%d size:%lld" ,
idx ,
sizeof request ) const &
inlineinherited

control request to pipe

◆ exception() [1/2]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::exception ( const dx::exception & exception,
bool filtered = false ) const
inlineprotectedvirtualnoexceptinherited
+ Here is the call graph for this function:

◆ exception() [2/2]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::exception ( const dx::exception & exception,
bool filtered = false ) const
inlineprotectedvirtualnoexceptinherited
+ Here is the call graph for this function:

◆ free()

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

◆ if()

template<typename device_t , typename interface_t >
dx::usb::platform::pipe< device_t, interface_t >::if ( tx = =max)
pure virtualinherited

◆ in()

template<typename device_t , typename interface_t >
bool dx::usb::platform::pipe< device_t, interface_t >::in ( ) const
inlinenoexceptinherited

bus initializer (isoc, bulk, pci, etc.) compatibility

◆ info()

template<typename device_t = device>
pipe & dx::usb::pipe< device_t >::info ( )
inlinenoexcept

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

◆ initialize() [1/2]

event & dx::event< dx::kernel >::initialize ( ::HKEY registry,
::DWORD filter = REG_NOTIFY_CHANGE_NAME| REG_NOTIFY_CHANGE_ATTRIBUTES| REG_NOTIFY_CHANGE_LAST_SET| REG_NOTIFY_CHANGE_SECURITY,
bool subtree = true )
inlineinherited

◆ initialize() [2/2]

event & dx::event< dx::kernel >::initialize ( bool signalled)
inlineinherited

◆ max_frame_size()

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

◆ operator const os_event()

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

◆ operator os_event()

template<::HANDLE invalid_t = INVALID_HANDLE_VALUE>
dx::resource< invalid_t >::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

◆ 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

◆ read()

template<typename device_t , typename interface_t >
pipe & dx::usb::platform::pipe< device_t, interface_t >::read ( void * data,
size_t size )
inlineinherited

synchronous USB read request

◆ receive()

template<typename device_t , typename interface_t >
pipe & dx::usb::platform::pipe< device_t, interface_t >::receive ( void * data,
size_t size )
inlineinherited

asynchronous USB read request

◆ received() [1/4]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::received ( os_result ,
size_t  )
inlineprotectedvirtualinherited

◆ received() [2/4]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::received ( os_result ,
size_t  )
inlineprotectedvirtualinherited

◆ received() [3/4]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::received ( os_result ,
size_t ,
int64_t ,
usb::isoc::frame *  )
inlineprotectedvirtualinherited

◆ received() [4/4]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::received ( os_result ,
size_t ,
int64_t ,
usb::isoc::frame *  )
inlineprotectedvirtualinherited

◆ reset()

void dx::event< dx::kernel >::reset ( )
inlineinherited

◆ signal()

void dx::event< dx::kernel >::signal ( )
inlineinherited

◆ start() [1/2]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::start ( unsigned int starting = 1)
inlineprotectedvirtualinherited

◆ start() [2/2]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::start ( unsigned int = 1)
inlinevirtualinherited

async IO thread control (required for Windows compatibility)

Reimplemented in dx::usb::stream::pipe< desc_t, circular_t >, and dx::usb::stream::pipe< _desc_t, dx::circular >.

◆ stop() [1/2]

template<typename device_t , typename interface_t >
virtual unsigned int dx::usb::platform::pipe< device_t, interface_t >::stop ( bool = false)
inlinevirtualnoexceptinherited

◆ stop() [2/2]

template<typename device_t , typename interface_t >
virtual unsigned int dx::usb::platform::pipe< device_t, interface_t >::stop ( bool = false)
inlineprotectedvirtualnoexceptinherited

◆ submit()

template<typename device_t , typename interface_t >
template<typename data_t >
pipe & dx::usb::platform::pipe< device_t, interface_t >::submit ( const request< data_t > & request) const
inlineinherited

standard request to pipe

◆ transmitted() [1/4]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::transmitted ( os_result ,
size_t  )
inlineprotectedvirtualinherited

◆ transmitted() [2/4]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::transmitted ( os_result ,
size_t  )
inlineprotectedvirtualinherited

◆ transmitted() [3/4]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::transmitted ( os_result ,
size_t ,
int64_t ,
usb::isoc::frame *  )
inlineprotectedvirtualinherited

◆ transmitted() [4/4]

template<typename device_t , typename interface_t >
virtual void dx::usb::platform::pipe< device_t, interface_t >::transmitted ( os_result ,
size_t ,
int64_t ,
usb::isoc::frame *  )
inlineprotectedvirtualinherited

◆ wait() [1/2]

static void dx::event< dx::kernel >::wait ( ::HANDLE handle,
int64_t timeout = 0 )
inlinestaticinherited

◆ wait() [2/2]

void dx::event< dx::kernel >::wait ( int64_t timeout = 0)
inlineinherited
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write()

template<typename device_t , typename interface_t >
pipe & dx::usb::platform::pipe< device_t, interface_t >::write ( const void * data,
size_t size )
inlineinherited

synchronous USB write request

Member Data Documentation

◆ [struct] [1/2]

struct { ... } dx::usb::platform::pipe< device_t, interface_t >::address

◆ address [2/2]

template<typename device_t , typename interface_t >
uint8_t dx::usb::platform::pipe< device_t, interface_t >::address = 0
protectedinherited

◆ attributes

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

◆ audio

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

◆ [class]

class { ... } ::buffer dx::usb::platform::pipe< device_t, interface_t >::buffer

◆ device

template<typename device_t , typename interface_t >
device_t & dx::usb::platform::pipe< device_t, interface_t >::device
inherited

◆ frame

template<typename device_t , typename interface_t >
uint64_t ::USBD_ISO_PACKET_DESCRIPTOR* dx::usb::platform::pipe< device_t, interface_t >::frame
inherited

◆ handle

template<typename device_t , typename interface_t >
::WINUSB_INTERFACE_HANDLE dx::usb::platform::pipe< device_t, interface_t >::handle
inherited

◆ idx

template<typename device_t , typename interface_t >
uint8_t dx::usb::platform::pipe< device_t, interface_t >::idx = 0
protectedinherited

◆ interface

template<typename device_t , typename interface_t >
interface_t & dx::usb::platform::pipe< device_t, interface_t >::interface
protectedinherited

◆ [struct] [1/2]

struct { ... } dx::usb::platform::pipe< device_t, interface_t >::isoc

◆ isoc [2/2]

template<typename device_t , typename interface_t >
struct dx::usb::platform::pipe::isoc dx::usb::platform::pipe< device_t, interface_t >::isoc
protectedinherited

◆ micro_frames

template<typename device_t , typename interface_t >
unsigned int dx::usb::platform::pipe< device_t, interface_t >::micro_frames = 0
inherited

◆ process

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

◆ sequence

template<typename device_t , typename interface_t >
uint64_t& dx::usb::platform::pipe< device_t, interface_t >::sequence
inherited

◆ this

template<typename device_t , typename interface_t >
return* dx::usb::platform::pipe< device_t, interface_t >::this
inherited

◆ try

template<typename device_t , typename interface_t >
size_t size dx::usb::platform::pipe< device_t, interface_t >::try
inherited
Initial value:
{
if (this->device.driver.log.bus.setup>= log::level::debug||
this->device.driver.log.bus.operation>= log::level::debug||
this->device.driver.log.streaming.setup>= log::level::debug||
this->device.driver.log.streaming.operation>= log::level::debug){
std::lock_guard<std::recursive_mutex> lock(io_mutex);
std::clog<< __func__<<
" pipe:"<< std::hex<< static_cast<unsigned int>(address)<< std::dec<<
" rq idx:"<< tx<<
" size:"<< size<<
std::endl;
}
dx_pass(::WinUsb_WritePipe (winusb.handle, address,
reinterpret_cast<unsigned char*>(const_cast<void*>(data)),
static_cast<::ULONG>(size), nullptr, &overlapped[tx])? ok: ::GetLastError())
struct dx::usb::platform::pipe::@64 address
device_t & device
Definition macOS/dx_usb_device_platform.h:431
return * this
Definition windows/dx_usb_device_platform.h:536
struct dx::usb::platform::pipe::@69 winusb
#define dx_pass(test,...)
Definition dx_exception.h:35
@ ok
Definition macOS/dx_platform.h:161
std::recursive_mutex io_mutex
Definition dx_common.cpp:29

◆ tx

template<typename device_t , typename interface_t >
dx::usb::platform::pipe< device_t, interface_t >::tx
inherited

◆ type

template<typename device_t , typename interface_t >
enum dx::usb::platform::pipe::type dx::usb::platform::pipe< device_t, interface_t >::type
inherited

◆ [struct]

struct { ... } dx::usb::platform::pipe< device_t, interface_t >::winusb

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

(c) copyright 2009 dynamic acoustics e.U. generated on Wed Apr 24 2024

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.