Skip to content
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

Android error handling fix #4032

Merged
merged 4 commits into from May 28, 2019

Conversation

matkatz
Copy link
Contributor

@matkatz matkatz commented May 21, 2019

  • reset the streaming endpoint in case of overflow.
  • fix wrong error handling on android usb transfer commands
  • release device/sensor instances that kept alive in the camera app

messenger->reset_endpoint(read_ep, reset_ep_timeout);
break;
case librealsense::platform::RS2_USB_STATUS_SUCCESS:
strctx->stream->got_bytes = transferred;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gottransferred_bytes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the name in all of our UVC implementations, we can change it when moving to rsuvc

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using libuvc under Android, how can I handle the error?

@@ -938,19 +938,27 @@ void stream_thread(usbhost_uvc_stream_context *strctx) {
}
});
LOG_DEBUG("Transfer thread started for endpoint address: " << strctx->endpoint);
bool disconnect = false;
do {
auto i = strctx->stream->stream_if->interface;
uint32_t transferred = 0;
auto sts = messenger->bulk_transfer(read_ep, strctx->stream->outbuf, LIBUVC_XFER_BUF_SIZE, transferred, 1000);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use hard-coded timeouts ? (1000, 50)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will create a define, it is not accessible to the app level

src/usbhost/messenger-usbhost.cpp Outdated Show resolved Hide resolved
@ev-mp ev-mp merged commit 0e19e4d into IntelRealSense:development May 28, 2019
@matkatz matkatz deleted the android-error-handling-fix branch July 9, 2019 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants