device_watcher.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3 #include "device_watcher.h"
4 #include <vector>
5 #include <sstream>
6 #include <jni.h>
7 #include "../usb/usb-device.h"
8 #include "../usbhost/device-usbhost.h"
9 #include "../backend.h"
10 #include "../usb/usb-enumerator.h"
11 #include "../hid/hid-device.h"
12 #include "../uvc/uvc-device.h"
13 
14 using namespace std;
15 using namespace librealsense;
16 using namespace librealsense::platform;
17 
18 std::shared_ptr<device_watcher_usbhost> device_watcher_usbhost::instance()
19 {
20  static std::shared_ptr<device_watcher_usbhost> instance = std::make_shared<device_watcher_usbhost>();
21  return instance;
22 }
23 
24 void device_watcher_usbhost::notify()
25 {
29 
32 
33  {
34  std::lock_guard<std::mutex> lk(_mutex);
35  prev = _prev_group;
36  _prev_group = curr;
37  callback = _callback;
38  }
39 
40  if(callback)
41  callback(prev, curr);
42 }
43 
45 {
46  std::lock_guard<std::mutex> lk(_mutex);
47  _callback = callback;
48 }
49 
51 {
52  std::lock_guard<std::mutex> lk(_mutex);
53  _callback = nullptr;
54 }
std::vector< uvc_device_info > query_uvc_devices_info()
Definition: uvc-device.cpp:40
static const textual_icon stop
Definition: model-views.h:225
std::vector< hid_device_info > hid_devices
Definition: backend.h:527
std::vector< hid_device_info > query_hid_devices_info()
Definition: hid-device.cpp:13
std::function< void(backend_device_group old, backend_device_group curr)> device_changed_callback
Definition: backend.h:574
def callback(frame)
Definition: t265_stereo.py:91
GLuint start
std::vector< uvc_device_info > uvc_devices
Definition: backend.h:525


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:12