-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rs usb api and implementations added #3828
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,8 @@ | |
#include "android-uvc.h" | ||
#include "android-hid.h" | ||
#include "../types.h" | ||
#include "usb_host/device_watcher.h" | ||
#include "device_watcher.h" | ||
#include "../usb/usb-enumerator.h" | ||
#include <chrono> | ||
#include <cctype> // std::tolower | ||
|
||
|
@@ -38,18 +39,18 @@ namespace librealsense { | |
} | ||
|
||
std::vector<uvc_device_info> android_backend::query_uvc_devices() const { | ||
return usb_host::device_watcher::query_uvc_devices(); | ||
return device_watcher_usbhost::instance()->query_uvc_devices(); | ||
} | ||
|
||
std::shared_ptr<usb_device> android_backend::create_usb_device(usb_device_info info) const { | ||
throw std::runtime_error("create_usb_device Not supported"); | ||
std::shared_ptr<command_transfer> android_backend::create_usb_device(usb_device_info info) const { | ||
auto dev = usb_enumerator::create_usb_device(info); | ||
if(dev != nullptr) | ||
return std::make_shared<platform::command_transfer_usb>(dev); | ||
return nullptr; | ||
} | ||
|
||
std::vector<usb_device_info> android_backend::query_usb_devices() const { | ||
|
||
std::vector<usb_device_info> result; | ||
// Not supported | ||
return result; | ||
return usb_enumerator::query_devices_info(); | ||
} | ||
|
||
std::shared_ptr<hid_device> android_backend::create_hid_device(hid_device_info info) const { | ||
|
@@ -68,7 +69,7 @@ namespace librealsense { | |
|
||
|
||
std::shared_ptr<device_watcher> android_backend::create_device_watcher() const { | ||
return std::make_shared<usb_host::device_watcher>(); | ||
return device_watcher_usbhost::instance(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There should be no need to wrap a singleton with shared_ptr. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need to implement the backend API: |
||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method
create_usb_device
returnscommand_transfer
?If so - please use "_dev" suffix as
command_transfer
is too vagueAlso is this intended to work with non-Realsense devices, such as platform cam ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original
usb_device
was an empty class which inheritedcommand_transfer
, since I removedusb_device
I needed to replace it withcommand_transfer
but I don't want to make more changes to the backend API in this PR unless it is necessary .