context-libusb.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "usb/usb-types.h"
7 
8 #include <memory>
9 #include <thread>
10 #include <mutex>
11 #include "libusb.h"
12 
13 namespace librealsense
14 {
15  namespace platform
16  {
18  {
19  public:
20  usb_context();
21  ~usb_context();
22 
23  libusb_context* get();
24 
25  void start_event_handler();
26  void stop_event_handler();
27 
28  size_t device_count();
29  libusb_device* get_device(uint8_t index);
30 
31  private:
32  std::mutex _mutex;
33  libusb_device **_list;
34  size_t _count;
36  struct libusb_context* _ctx;
38  std::thread _event_handler;
39  };
40  }
41 }
librealsense
Definition: algo.h:18
uint8_t
unsigned char uint8_t
Definition: stdint.h:78
librealsense::platform::usb_context::_mutex
std::mutex _mutex
Definition: context-libusb.h:32
librealsense::platform::usb_context::start_event_handler
void start_event_handler()
Definition: context-libusb.cpp:35
librealsense::platform::usb_context::_ctx
struct libusb_context * _ctx
Definition: context-libusb.h:36
usb-types.h
index
GLuint index
Definition: glad/glad/glad.h:2777
librealsense::platform::usb_context::get_device
libusb_device * get_device(uint8_t index)
Definition: context-libusb.cpp:61
librealsense::platform::usb_context::device_count
size_t device_count()
Definition: context-libusb.cpp:66
librealsense::platform::usb_context::usb_context
usb_context()
Definition: context-libusb.cpp:11
libusb.h
librealsense::platform::usb_context::~usb_context
~usb_context()
Definition: context-libusb.cpp:21
librealsense::platform::usb_context::get
libusb_context * get()
Definition: context-libusb.cpp:30
librealsense::platform::usb_context::_count
size_t _count
Definition: context-libusb.h:34
librealsense::platform::usb_context::stop_event_handler
void stop_event_handler()
Definition: context-libusb.cpp:52
librealsense::platform::usb_context::_event_handler
std::thread _event_handler
Definition: context-libusb.h:38
librealsense::platform::usb_context::_kill_handler_thread
int _kill_handler_thread
Definition: context-libusb.h:37
librealsense::platform::usb_context
Definition: context-libusb.h:17
librealsense::platform::usb_context::_list
libusb_device ** _list
Definition: context-libusb.h:33
librealsense::platform::usb_context::_handler_requests
int _handler_requests
Definition: context-libusb.h:35


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01