Code example for UsbDeviceConnection

Methods: close

0
 
    public boolean close(int devNum) {
        UsbDeviceConnection con = connection(devNum);
        if(con == null) return false;
        mConnection.remove(devNum);
        con.close();
        if(DEBUG_SHOW){ Log.d(TAG, "Close("+devNum+")"); }
        return true; 
    } 
 
    public boolean closeAll() { 
        boolean ret = false;
        UsbDeviceConnection con;
        for(int i=0; i < mConnection.size(); i++) {
            con = mConnection.valueAt(i);
            if(con == null) continue;
            if(DEBUG_SHOW){ Log.d(TAG, "Close("+mConnection.keyAt(i)+")"); }
            con.close();
            ret = true;
        } 
        mConnection.clear();