Open Lighting Architecture: ola::plugin::usbpro::WidgetDetectorThread Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
ola::plugin::usbpro::WidgetDetectorThread Class Reference
Inheritance diagram for ola::plugin::usbpro::WidgetDetectorThread:

## 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.
virtual | ~Thread ()
| Destructor.
virtual bool | Start ()
| Start the thread and wait for the thread to be running.
virtual bool | FastStart ()
| Start the thread and return immediately.
bool | IsRunning ()
| Check if the thread is running.
ThreadId | Id () const
| Return the thread id.
std::string | Name () const
| Return the thread name.

## 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.

## Constructor & Destructor Documentation

## ◆ WidgetDetectorThread()

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

  handler | the NewWidgetHandler object to call when we find new widgets.
  ss | the 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_timeout | the time in ms between each USB Pro discovery message.
  robe_timeout | the time in ms between each Robe discovery message.

## Member Function Documentation

## ◆ FreeWidget()

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

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

## ◆ Join()

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

Stop the discovery thread.

Reimplemented from ola::thread::Thread.

## ◆ PerformDiscovery()

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

Start the discovery sequence for a widget.

## ◆ Run()

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

Run the discovery thread.

Implements ola::thread::Thread.

## ◆ RunScan()

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

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

## ◆ SetDeviceDirectory()

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

  directory | the directory path e.g. /dev

## ◆ SetDevicePrefixes()

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

  prefixes | a vector of strings e.g. ["ttyUSB"]

## ◆ SetIgnoredDevices()

void ola::plugin::usbpro::WidgetDetectorThread::SetIgnoredDevices | ( | const std::vector< std::string > & | devices | ) |

Set the list of devices we wish to ignore

Parameters

  devices | a list of devices paths, e.g. /dev/ttyUSB0.NNNNNN

## ◆ WaitUntilRunning()

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:

- plugins/usbpro/WidgetDetectorThread.h
- plugins/usbpro/WidgetDetectorThread.cpp