UHD  003.004.002-0-unknown
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Static Public Member Functions
uhd::transport::usb_zero_copy Class Reference

#include <usb_zero_copy.hpp>

Inheritance diagram for uhd::transport::usb_zero_copy:
uhd::transport::zero_copy_if

List of all members.

Public Types

typedef boost::shared_ptr
< usb_zero_copy
sptr
- Public Types inherited from uhd::transport::zero_copy_if

Static Public Member Functions

static sptr make (usb_device_handle::sptr handle, const size_t recv_interface, const size_t recv_endpoint, const size_t send_interface, const size_t send_endpoint, const device_addr_t &hints=device_addr_t())
static sptr make_wrapper (sptr usb_zc, size_t usb_frame_boundary=512)

Additional Inherited Members

- Public Member Functions inherited from uhd::transport::zero_copy_if
virtual managed_recv_buffer::sptr get_recv_buff (double timeout=0.1)=0
virtual size_t get_num_recv_frames (void) const =0
virtual size_t get_recv_frame_size (void) const =0
virtual managed_send_buffer::sptr get_send_buff (double timeout=0.1)=0
virtual size_t get_num_send_frames (void) const =0
virtual size_t get_send_frame_size (void) const =0

Detailed Description

A zero copy usb transport provides an efficient way to handle data. by avoiding the extra copy when recv() or send() is called on the handle. Rather, the zero copy transport gives the caller memory references. The caller informs the transport when it is finished with the reference.

On linux systems, the zero copy transport can use a kernel packet ring. If no platform specific solution is available, make returns a boost asio implementation that wraps functionality around standard send/recv calls.


Member Typedef Documentation

Reimplemented from uhd::transport::zero_copy_if.


Member Function Documentation

static sptr uhd::transport::usb_zero_copy::make ( usb_device_handle::sptr  handle,
const size_t  recv_interface,
const size_t  recv_endpoint,
const size_t  send_interface,
const size_t  send_endpoint,
const device_addr_t hints = device_addr_t() 
)
static

Make a new zero copy usb transport: This transport is for sending and receiving between the host and a pair of USB bulk transfer endpoints. The primary usage for this transport is data transactions. The underlying implementation may be platform specific.

Parameters:
handlea device handle that uniquely identifying the device
recv_interfacean integer specifiying an IN interface number
recv_endpointan integer specifiying an IN endpoint number
send_interfacean integer specifiying an OUT interface number
send_endpointan integer specifiying an OUT endpoint number
hintsoptional parameters to pass to the underlying transport
Returns:
a new zero copy usb object
static sptr uhd::transport::usb_zero_copy::make_wrapper ( sptr  usb_zc,
size_t  usb_frame_boundary = 512 
)
static

Make a wrapper around a zero copy implementation. The wrapper performs the following functions:

  • Pad commits to the frame boundary
  • Extract multiple packets on recv

When enable multiple receive packets is set to true, the implementation inspects the vita length on transfers, and may split a single transfer into multiple managed buffers.

Parameters:
usb_zca usb zero copy interface object
usb_frame_boundarybytes per frame
Returns:
a new zero copy wrapper object

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