Universal Software Radio Peripheral
Public Member Functions | Public Attributes
fusb_ephandle_darwin Class Reference

darwin implementation of fusb_ephandle More...

#include <fusb_darwin.h>

Inheritance diagram for fusb_ephandle_darwin:
Inheritance graph
[legend]
Collaboration diagram for fusb_ephandle_darwin:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 fusb_ephandle_darwin (fusb_devhandle_darwin *dh, int endpoint, bool input_p, int block_size=0, int nblocks=0)
virtual ~fusb_ephandle_darwin ()
virtual bool start ()
 begin streaming i/o
virtual bool stop ()
 stop streaming i/o
virtual int write (const void *buffer, int nbytes)
virtual int read (void *buffer, int nbytes)
void abort ()
virtual void wait_for_completion ()

Public Attributes

UInt8 d_pipeRef
UInt8 d_transferType
usb_interface_t ** d_interfaceRef
usb_interface_t * d_interface
s_queue_ptr d_queue
circular_buffer< char > * d_buffer
size_t d_bufLenBytes
gruel::mutex * d_readRunning
gruel::mutex * d_runBlock_mutex
gruel::mutex * d_readBlock_mutex
gruel::condition_variable * d_runBlock
gruel::condition_variable * d_readBlock

Detailed Description

darwin implementation of fusb_ephandle

This is currently identical to the generic implementation and is intended as a starting point for whatever magic is required to make usb fly.


Constructor & Destructor Documentation

fusb_ephandle_darwin::fusb_ephandle_darwin ( fusb_devhandle_darwin dh,
int  endpoint,
bool  input_p,
int  block_size = 0,
int  nblocks = 0 
)
fusb_ephandle_darwin::~fusb_ephandle_darwin ( ) [virtual]

Member Function Documentation

void fusb_ephandle_darwin::abort ( )
int fusb_ephandle_darwin::read ( void *  buffer,
int  nbytes 
) [virtual]
Returns:
number of bytes read or -1 if error. number of bytes read will be <= nbytes. Will block if no input available.

Implements fusb_ephandle.

References d_buffer, circular_buffer::dequeue(), and usb_debug.

bool fusb_ephandle_darwin::start ( ) [virtual]
bool fusb_ephandle_darwin::stop ( ) [virtual]
void fusb_ephandle_darwin::wait_for_completion ( ) [virtual]

Implements fusb_ephandle.

References d_queue, and circular_linked_list::in_use().

Referenced by stop().

int fusb_ephandle_darwin::write ( const void *  buffer,
int  nbytes 
) [virtual]
Returns:
nbytes if write was successfully enqueued, else -1. Will block if no free buffers available.

Implements fusb_ephandle.

References fusb_ephandle::d_started, usb_debug, d_bufLenBytes, d_queue, circular_linked_list::find_next_available_node(), s_node::object(), s_buffer::buffer(), s_node::both(), d_transferType, d_interface, d_interfaceRef, d_pipeRef, and USB_ERROR_STR.


Member Data Documentation

Referenced by fusb_ephandle_darwin(), and write().

Referenced by start(), write(), and abort().

Referenced by start(), write(), and abort().

Referenced by start(), write(), and abort().

gruel::condition_variable* fusb_ephandle_darwin::d_readBlock
gruel::condition_variable* fusb_ephandle_darwin::d_runBlock

Referenced by start(), and write().


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