#include <device_hub.h>
device_hub class - encapsulate the handling of connect and disconnect events
Definition at line 15 of file device_hub.h.
librealsense::device_hub::~device_hub |
( |
| ) |
|
std::shared_ptr< device_interface > librealsense::device_hub::wait_for_device |
( |
const std::chrono::milliseconds & |
timeout = std::chrono::milliseconds(std::chrono::hours(1)) , |
|
|
bool |
loop_through_devices = true , |
|
|
const std::string & |
serial = "" |
|
) |
| |
The function implements both blocking and non-blocking device generation functionality based on the input parameters: Calling the function with zero timeout results in searching and fetching the device specified by the serial
parameter from a list of connected devices. Calling the function with a valid timeout will block till the resulted device is found or the timeout expires.
- Parameters
-
[in] | timeout_ms | The waiting period for the requested device to be reconnected (milliseconds). Due to an implementation issue both in MSVC and GCC the timeout equals to 1 hour to avoid generation of negative durations. . |
[in] | loop_through_devices | - promote internal index to the next available device that will be retrieved on successive call Note that selection of the next device is deterministic but not predictable, and therefore is recommended for specific use-cases only , such as tutorials or unit-tests where no assumptions as to the device ordering are made. |
[in] | serial | The serial number of the requested device. Use empty pattern ("") to request for "any RealSense" device. |
- Returns
- a shared pointer to the device_interface that satisfies the search criteria. In case the request was not resloved the call will throw an exception
If any device is connected return it, otherwise wait until next RealSense device connects. Calling this method multiple times will cycle through connected devices
Definition at line 120 of file device_hub.cpp.
int librealsense::device_hub::_camera_index = 0 |
|
private |
std::condition_variable librealsense::device_hub::_cv |
|
private |
uint64_t librealsense::device_hub::_device_changes_callback_id |
|
private |
std::vector<std::shared_ptr<device_info> > librealsense::device_hub::_device_list |
|
private |
std::mutex librealsense::device_hub::_mutex |
|
private |
bool librealsense::device_hub::_register_device_notifications |
|
private |
int librealsense::device_hub::_vid = 0 |
|
private |
The documentation for this class was generated from the following files: