Code example for UsbManager

Methods: openAccessory

0
        } 
    } 
     
    private void openAccessory(UsbAccessory accessory)
    { 
        mFileDescriptor = mUsbManager.openAccessory(accessory);
        if (mFileDescriptor != null)
        { 
            mAccessory = accessory;
            FileDescriptor fd = mFileDescriptor.getFileDescriptor();
            mInputStream = new FileInputStream(fd);
            new Thread(null, this, "AOATempSensor").start();
            Log.d(TAG, "accessory opened");
            showTemp(); 
        } 
        else 
        { 
            Log.d(TAG, "accessory open fail");
        } 
    }