Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mobile_robotics
ADC
external
libuvc_ros
Commits
30b3cfd1
Commit
30b3cfd1
authored
Jan 12, 2014
by
Ken Tossell
Browse files
Added more informative error messages in the case of uvc_open() failure
parent
24e3bdc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
libuvc_camera/src/camera_driver.cpp
View file @
30b3cfd1
...
...
@@ -271,7 +271,29 @@ void CameraDriver::OpenCamera(UVCCameraConfig &new_config) {
uvc_error_t
open_err
=
uvc_open
(
dev_
,
&
devh_
);
if
(
open_err
!=
UVC_SUCCESS
)
{
uvc_perror
(
open_err
,
"uvc_open"
);
switch
(
open_err
)
{
case
UVC_ERROR_ACCESS
:
#ifdef __linux__
ROS_ERROR
(
"Permission denied opening /dev/bus/usb/%03d/%03d"
,
uvc_get_bus_number
(
dev_
),
uvc_get_device_address
(
dev_
));
#else
ROS_ERROR
(
"Permission denied opening device %d on bus %d"
,
uvc_get_device_address
(
dev_
),
uvc_get_bus_number
(
dev_
));
#endif
break
;
default:
#ifdef __linux__
ROS_ERROR
(
"Can't open /dev/bus/usb/%03d/%03d: %s (%d)"
,
uvc_get_bus_number
(
dev_
),
uvc_get_device_address
(
dev_
),
uvc_strerror
(
open_err
),
open_err
);
#else
ROS_ERROR
(
"Can't open device %d on bus %d: %s (%d)"
,
uvc_get_device_address
(
dev_
),
uvc_get_bus_number
(
dev_
),
uvc_strerror
(
open_err
),
open_err
);
#endif
break
;
}
uvc_unref_device
(
dev_
);
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment