Example: DeviceChange

This example illustrates how to use FrontPanelManager to detect when USB devices are attached or unattached to the system. It is the application’s responsibility to detect these events and properly manage instances of the okCFrontPanel class. Each operating system (Windows, Linux, macOS) has a slightly different approach to notifying an application of USB events. The FrontPanelManager class abstracts these approaches into a consistent interface for cross-platform handling of FrontPanel devices.

Command Line C++ Application

This example shows how to setup a thread to handle device add/remove events in the background allowing the main thread to perform other work. This is a simple example that prints a message to the console when a device is added or removed.

WxWidgets Application

  • This example requires the wxWidgets GUI library to build it.
  • A device is only accessible in one application at a time. Ensure the FrontPanel application is closed before running the example.