|
dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
|
the platform half of a pipe: the transfers over the interface's endpoint and their completions - a group pipe's and an isochronous one's queue their result for the group's poll, since a completion counts and never schedules More...
#include <dx_usb_platform_pipe.h>
Classes | |
| struct | isoc |
| what an isochronous pipe needs beside its requests: the micro frames a packet is spread over and the registered buffer they are served from More... | |
Public Types | |
| typedef _device_t | device_t |
| typedef _device_t | device_t |
| 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 } |
| the transfer type of this pipe, as its endpoint declared it More... | |
Public Member Functions | |
| pipe& | abort() |
| pipe& | abort() |
| pipe& | clear() |
| pipe& | clear(bool force= false) |
| void | conclude() noexcept |
| void | conclude() noexcept |
| pipe& | drain(std::chrono::milliseconds timeout= std::chrono::milliseconds(250)) noexcept |
| waits for already-submitted requests to complete on their own, without cancelling them | |
| pipe& | drain(std::chrono::milliseconds timeout= std::chrono::milliseconds(250)) noexcept |
| waits for already-submitted requests to complete on their own, without cancelling them; consumes the isoc completions itself when no completion thread does - its caller then holds the device lock the group's tick would need, so nobody else polls | |
| 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) |
| pipe& | max_frame_size(unsigned int frame_size) |
| template<typename data_t> | |
| pipe& | operator <<(const data_t& data) |
| template<typename data_t> | |
| pipe& | operator >>(data_t& data) |
| bool | outstanding() const noexcept |
| bool | outstanding() const noexcept |
| pipe(device_t& device, const endpoint& endpoint) | |
| the runloop queues every isoc and every group pipe's completion for poll() | |
| pipe(device_t& device, const endpoint& endpoint) | |
| completion: the pipe's own thread delivers the completions via received()/transmitted(); a pipe of a streaming group (desc.group) leaves them to its group's tick (poll()) | |
| bool | poll(usb::isoc::result& result) |
| pulls the oldest outstanding request's result once it has completed | |
| 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 | |
| pipe& | read(void* data, size_t size) |
| synchronous USB read request | |
| virtual pipe& | receive(void* data, size_t size) |
| asynchronous USB read request | |
| pipe& | receive(void* data, size_t size) |
| asynchronous USB read request | |
| virtual pipe& | receive(void* data, uint64_t& sequence, ::IOUSBIsocFrame* frame, int32_t frames= 1) |
| asynchronous USB isoc read request | |
| pipe& | receive(void* data, uint64_t& sequence, ::USBD_ISO_PACKET_DESCRIPTOR* frame, unsigned int frames= 1) |
| asynchronous USB isoc read request WinUSB limitation no microframe support only multiple of max package size requests allowed, even if only submiting a single package https://docs.microsoft.com/en-us/windows/win32/api/winusb/nf-winusb-winusb_readisochpipe is wrong! | |
| os_result | status() const noexcept |
| os_result | status() const noexcept |
| template<typename data_t> | |
| data_t | submit(const control& control) const |
| control request to pipe | |
| template<typename data_t> | |
| data_t | submit(const control& control) const |
| control request to pipe | |
| template<typename data_t> | |
| pipe& | submit(const request<data_t>& request) const |
| standard request to pipe | |
| template<typename data_t> | |
| 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 | |
| pipe& | transfer(bool in, void* data, size_t size) |
| a synchronous transfer: overlapped underneath, past timeout the pipe aborted and the transfer failed as timed out | |
| virtual pipe& | transmit(const void* data, size_t& size) |
| asynchronous USB write request | |
| pipe& | transmit(const void* data, size_t size) |
| asynchronous USB write request | |
| virtual pipe& | transmit(const void* data, uint64_t& sequence, ::IOUSBIsocFrame* frame, int32_t frames= 1) |
| asynchronous USB isoc write request | |
| pipe& | transmit(const void* data, uint64_t& sequence, ::USBD_ISO_PACKET_DESCRIPTOR* frame, unsigned int frames= 1) |
| asynchronous USB isoc 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& | write(const void* data, size_t size) |
| synchronous USB write request | |
| ~pipe() noexcept override | |
Public Attributes | |
| interface_t& | 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{} |
| enum dx::usb::platform::pipe::type | type |
Static Public Attributes | |
| static constexpr auto | max{usb::isoc::max_requests} |
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 | 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 | 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() override | |
Protected Attributes | |
| struct dx::usb::platform::pipe:: { ... } | address |
| uint8_t | address{} |
| usb::isoc::result | completed [max] |
| isoc completions in callback order, filled by the runloop, drained by poll() | |
| _device_t& | device |
| _device_t& | device |
| std::function<void()> | flush_hook |
| std::function<void()> | flush_hook |
| std::function<void()> | halt_hook |
| std::function<void()> | halt_hook |
| uint8_t | idx= 0 |
| struct dx::usb::platform::pipe:: { ... } | isoc |
| struct dx::usb::platform::pipe::isoc | isoc |
| std::function<void()> | run_hook |
| std::function<void()> | run_hook |
| volatile unsigned int | rx= 0 |
| volatile unsigned int | tx= 0 |
| struct dx::usb::platform::pipe:: { ... } | winusb |
the platform half of a pipe: the transfers over the interface's endpoint and their completions - a group pipe's and an isochronous one's queue their result for the group's poll, since a completion counts and never schedules
the platform half of a pipe: up to max outstanding overlapped requests over WinUSB, their completions taken in submission order - the order the controller serves a pipe in
|
inherited |
|
inherited |
|
strong |
|
strong |
|
inlineoverrideprotected |
|
inline |
the runloop queues every isoc and every group pipe's completion for poll()
async IO thread control (required for Windows compatibility)
|
inline |
completion: the pipe's own thread delivers the completions via received()/transmitted(); a pipe of a streaming group (desc.group) leaves them to its group's tick (poll())
async IO thread control
joins the completion thread once this pipe's last start/stop reference is gone
|
inlineoverridenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtualnoexceptinherited |
Reimplemented from dx::object.
Reimplemented in dx::usb::pipe< device_t >.
|
inlinevirtualnoexceptinherited |
Reimplemented from dx::object.
Reimplemented in dx::usb::pipe< device_t >.
|
inlinenoexcept |
waits for already-submitted requests to complete on their own, without cancelling them
|
inlinenoexcept |
waits for already-submitted requests to complete on their own, without cancelling them; consumes the isoc completions itself when no completion thread does - its caller then holds the device lock the group's tick would need, so nobody else polls
|
inlineoverridevirtualnoexceptinherited |
notification exception handler
Implements dx::object.
Reimplemented in dx::stream::pin< device_t, _circular_t >, and dx::usb::stream::pipe< device_t, circular_t, stream_t >.
|
inlineoverridevirtualnoexceptinherited |
notification exception handler
Implements dx::object.
Reimplemented in dx::stream::pin< device_t, _circular_t >, and dx::usb::stream::pipe< device_t, circular_t, stream_t >.
|
inline |
current bus frame number; timestamp: dx::timestamp() of the readout
|
inlineprotectedvirtualinherited |
launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.
Reimplemented in dx::asio::client::driver< device_t, devices >, dx::coreaudio::driver< device_t >, dx::coremidi::driver< device_t >, dx::map::driver< _device_t, holder_t >, dx::map::driver< device<> >, dx::map::driver< device_t >, dx::map::driver< device_t, dx::apartment< device_t > >, dx::midi::services::driver< device_t >, dx::proxy::device< preference_t >, dx::proxy::device< preference_t >, dx::proxy::device< dx::preference >, dx::proxy::device<>, dx::proxy::driver< device_t >, dx::proxy::driver< device_t >, dx::service::app, dx::service::app, dx::service::client::_device< desc_t, preference_t, stream_t, group_t >, dx::service::client::_device< desc, preference, stream< device< desc, preference, stream, group > >, group< device< desc, preference, stream, group > > >, dx::service::client::_device< desc_t, preference_t, stream_t< device< desc_t, preference_t, stream_t, group_t > >, group_t< device< desc_t, preference_t, stream_t, group_t > > >, dx::service::client::driver< device_t >, dx::stream::stream< device_t, dx::circular, usb::pipe< device_t > >, dx::usb::stream::_device< desc_t, preference_t, stream_t, group_t >, dx::usb::stream::_device< desc_t, dx::preference, pipe< device< desc_t, dx::preference, pipe, group > >, group< device< desc_t, dx::preference, pipe, group > > >, dx::usb::stream::_device< desc_t, preference_t, stream_t< device< desc_t, preference_t, stream_t, group_t > >, group_t< device< desc_t, preference_t, stream_t, group_t > > >, dx::virtuel::driver< device_t >, and dx::wasapi::client::driver< device_t >.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
asynchronous requests in flight
|
inlinenoexcept |
asynchronous requests in flight
|
inline |
pulls the oldest outstanding request's result once it has completed
|
inlinenoexcept |
pulls the oldest completed request's result
|
inline |
synchronous USB read request
|
inline |
synchronous USB read request
|
inlinevirtual |
asynchronous USB read request
|
inline |
asynchronous USB read request
|
inlinevirtual |
asynchronous USB isoc read request
|
inline |
asynchronous USB isoc read request WinUSB limitation no microframe support only multiple of max package size requests allowed, even if only submiting a single package https://docs.microsoft.com/en-us/windows/win32/api/winusb/nf-winusb-winusb_readisochpipe is wrong!
|
inlineprotectedvirtual |
virtual async callbacks
Reimplemented in dx::usb::stream::pipe< device_t, circular_t, stream_t >.
|
inlineprotectedvirtual |
virtual async callbacks
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
control request to pipe
|
inline |
control request to pipe
|
inline |
standard request to pipe
|
inline |
standard request to pipe
|
inline |
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
|
inline |
a synchronous transfer: overlapped underneath, past timeout the pipe aborted and the transfer failed as timed out
|
inlinevirtual |
asynchronous USB write request
|
inline |
asynchronous USB write request
|
inlinevirtual |
asynchronous USB isoc write request
|
inline |
asynchronous USB isoc write request
|
inlineprotectedvirtual |
Reimplemented in dx::usb::stream::pipe< device_t, circular_t, stream_t >.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlinenoexceptinherited |
atomically conclude()s if currently launched; returns whether this call did it
|
inlinenoexceptinherited |
atomically conclude()s if currently launched; returns whether this call did it
|
inlineinherited |
|
inlineinherited |
|
inline |
synchronous USB write request
|
inline |
synchronous USB write request
| struct { ... } dx::usb::platform::pipe<device_t, interface_t>::address |
|
protected |
|
protected |
isoc completions in callback order, filled by the runloop, drained by poll()
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
| interface_t & dx::usb::platform::pipe<device_t, interface_t>::interface |
| struct { ... } dx::usb::platform::pipe<device_t, interface_t>::isoc |
|
protected |
|
inherited |
|
inherited |
|
staticconstexpr |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
| std::chrono::milliseconds dx::usb::platform::pipe<device_t, interface_t>::timeout{} |
a synchronous transfer's bound, 0: none
|
protected |
| enum dx::usb::platform::pipe::type dx::usb::platform::pipe<device_t, interface_t>::type |
| struct { ... } dx::usb::platform::pipe<device_t, interface_t>::winusb |