Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | List of all members
ola::plugin::usbpro::WidgetDetectorThread Class Reference
Inheritance diagram for ola::plugin::usbpro::WidgetDetectorThread:
Inheritance graph
[legend]
Collaboration diagram for ola::plugin::usbpro::WidgetDetectorThread:
Collaboration graph
[legend]

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 std::string &directory)
 
void SetDevicePrefixes (const std::vector< std::string > &prefixes)
 
void SetIgnoredDevices (const std::vector< std::string > &devices)
 
void * Run ()
 
bool Join (void *ptr)
 
void FreeWidget (SerialWidgetInterface *widget)
 
void WaitUntilRunning ()
 
- Public Member Functions inherited from ola::thread::Thread
 Thread (const Options &options=Options())
 Create a new thread with the specified thread options. More...
 
virtual ~Thread ()
 Destructor.
 
virtual bool Start ()
 Start the thread and wait for the thread to be running. More...
 
virtual bool FastStart ()
 Start the thread and return immediately. More...
 
bool IsRunning ()
 Check if the thread is running. More...
 
ThreadId Id () const
 Return the thread id. More...
 
std::string Name () const
 Return the thread name. More...
 

Protected Member Functions

virtual bool RunScan ()
 
void PerformDiscovery (const std::string &path, ola::io::ConnectedDescriptor *descriptor)
 

Additional Inherited Members

- Static Public Member Functions inherited from ola::thread::Thread
static ThreadId Self ()
 Returns the current thread's id. More...
 

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.
usb_pro_timeoutthe time in ms between each USB Pro discovery message.
robe_timeoutthe time in ms between each Robe discovery message.

Member Function Documentation

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

Indicate that this widget is no longer is use and can be deleted.

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 std::string &  path,
ola::io::ConnectedDescriptor descriptor 
)
protected

Start the discovery sequence for a widget.

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 std::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 std::vector< std::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 std::vector< std::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: