Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
ola::plugin::usbpro::WidgetDetectorThread Class Reference
Inheritance diagram for ola::plugin::usbpro::WidgetDetectorThread:
ola::thread::Thread

Public Member Functions

 WidgetDetectorThread (NewWidgetHandler *widget_handler, ola::io::SelectServerInterface *ss, unsigned int usb_pro_timeout=200, unsigned int robe_timeout=200)
void SetDeviceDirectory (const string &directory)
void SetDevicePrefixes (const vector< string > &prefixes)
void SetIgnoredDevices (const vector< string > &devices)
void * Run ()
bool Join (void *ptr)
void FreeWidget (SerialWidgetInterface *widget)
void WaitUntilRunning ()
- Public Member Functions inherited from ola::thread::Thread
virtual bool Start ()
virtual bool FastStart ()
bool IsRunning ()
ThreadId Id () const
void * _InternalRun ()

Protected Member Functions

virtual bool RunScan ()
void PerformDiscovery (const string &path, ConnectedDescriptor *descriptor)

Additional Inherited Members

- Static Public Member Functions inherited from ola::thread::Thread
static ThreadId Self ()

Constructor & Destructor Documentation

ola::plugin::usbpro::WidgetDetectorThread::WidgetDetectorThread ( NewWidgetHandler handler,
ola::io::SelectServerInterface ss,
unsigned int  usb_pro_timeout = 200,
unsigned int  robe_timeout = 200 
)
explicit

Constructor

Parameters
handlerthe NewWidgetHandler object to call when we find new widgets.
ssthe SelectServer to use when calling the handler object. This is also used by some of the widgets so it should be the same SelectServer that you intend to use the Widgets with.

Member Function Documentation

void ola::plugin::usbpro::WidgetDetectorThread::FreeWidget ( SerialWidgetInterface widget)

Indicate that this widget is no longer is use and can be deleted. This can be called from any thread.

bool ola::plugin::usbpro::WidgetDetectorThread::Join ( void *  ptr)
virtual

Stop the discovery thread.

Reimplemented from ola::thread::Thread.

void ola::plugin::usbpro::WidgetDetectorThread::PerformDiscovery ( const string &  path,
ConnectedDescriptor descriptor 
)
protected

Start the discovery sequence for a descriptor.

void * ola::plugin::usbpro::WidgetDetectorThread::Run ( )
virtual

Run the discovery thread.

Implements ola::thread::Thread.

bool ola::plugin::usbpro::WidgetDetectorThread::RunScan ( )
protectedvirtual

Scan for widgets, and launch the discovery process for any that we don't already know about.

void ola::plugin::usbpro::WidgetDetectorThread::SetDeviceDirectory ( const string &  directory)

Set the directory in which to look for usb widgets. This should be called before Run() since it doesn't do any locking.

Parameters
directorythe directory path e.g. /dev
void ola::plugin::usbpro::WidgetDetectorThread::SetDevicePrefixes ( const vector< string > &  prefixes)

Set the list of prefixes to consider as possible devices. This should be called before Run() since it doesn't do any locking.

Parameters
prefixesa vector of strings e.g. ["ttyUSB"]
void ola::plugin::usbpro::WidgetDetectorThread::SetIgnoredDevices ( const vector< string > &  devices)

Set the list of devices we wish to ignore

Parameters
devicesa list of devices paths, e.g. /dev/ttyUSB0.NNNNNN
void ola::plugin::usbpro::WidgetDetectorThread::WaitUntilRunning ( )

Block until the thread is up and running


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