Code example for UsbManager

Methods: openDevice

0
 
        m_listener.onNewDevice(dev);
    } 
     
    public UsbDeviceConnection openDevConnection(UsbDevice dev) {
        return m_usbManager.openDevice(dev);
    } 
 
    private final BroadcastReceiver m_usbReceiver = new BroadcastReceiver() {
 
        public void onReceive(Context context, Intent intent) { 
            String action = intent.getAction(); 
            if (ACTION_USB_PERMISSION.equals(action)) { 
                synchronized (this) { 
                    UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); 
                    if (device != null && intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) { 
                        processRawDevice(device); 
                    } 
                } 
            } 
        }