Home > other >  Android permission problems dev/bus/usb/seems to have no right to access, and through the libusb lib
Android permission problems dev/bus/usb/seems to have no right to access, and through the libusb lib

Time:09-24

1, I use the development the IDE is android studio APP_PLATFORM android - 23 compile, company for industrial camera, want to pass the uvc agreement for PC and communications equipment,
2, various libraries
[armeabi - v7a] Install: libGPCamera. So=& gt; Libs/armeabi v7a/libGPCamera. So
[armeabi - v7a] Install: libjpeg - turbo1500. So=& gt; Libs/armeabi v7a/libjpeg - turbo1500. So
[armeabi - v7a] Install: libusb100. So=& gt; Libs/armeabi v7a/libusb100. So
[armeabi - v7a] Install: libuvc. So=& gt; Libs/armeabi v7a/libuvc. So
3, called when I perform the debug libusb libusb_get_device_list take less than the equipment, the log is as follows:

4, my code below

UINT CGsUvcDeviceSearch: : LibUsbInit ()
{
LOGI (" CGsUvcDeviceSearch: : LibUsbInit m_nStatus=[% d] ", m_nStatus);
Int ret=LIBUSB_SUCCESS;

//open session
Ret=libusb_init (& amp; M_pUsbCtx);
If (LIBUSB_SUCCESS!=(ret)
{
LOGI (" failed to initialise libusb: % s \ n ", libusb_error_name (ret));
Return EXIT_FAILURE;
}

//non-zero support, 0 does not support the
Ret=libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG);
If (LIBUSB_SUCCESS==ret)
{
LOGI (" Hotplug capabilites are not supported on this platform \ n ");
LOGI (" this version 's libusb doesn' t support hotplug \ n ");
Libusb_exit (m_pUsbCtx);
Return EXIT_FAILURE;
}

Int devIdx=1;
Struct libusb_device * pUsbDev=NULL;
Ret= libusb_get_device_list (m_pUsbCtx, & amp; M_ppUsbDevs);
If (LIBUSB_SUCCESS!=(ret)
{
LOGI (" Failed to get the device list on iteration % d % (p) ", m_nTotalDeviceSum, m_ppUsbDevs);
Return EXIT_FAILURE;
}
while ((pUsbDev=m_ppUsbDevs [+ + devIdx])!=NULL) //don't come in here, inserted into the device, and then start the debug mode,
{
//printdev (pUsbDev);
M_nTotalDeviceSum + +;
LOGI (" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # libusb_get_device_list Find Device ~ ~ ~ m_nTotalDeviceSum=[% d] m_ppUsbDevs=[p] % \ n ", m_nTotalDeviceSum, m_ppUsbDevs);
}

//m_nStatus=UVC_DEVICE_STATUS_START;
LOGI (" LibUsbInit is suc... M_nStatus=UVC_DEVICE_STATUS_START \ n \ n ");
Return EXIT_SUCCESS;
}
Didn't do it before, the android development, hope for help under the higher-ups need how to solve???????

CodePudding user response:

A large coffee to help look at the question

CodePudding user response:

Help take a look at it
  • Related