# HG changeset patch # User chpeckha # Date 1268169871 21600 # Node ID 27160ce2811ff829ef920360b23614183036dc92 # Parent 846b99bbf2a17cf5f882cf0d8ba349ae71b8957c add some more heuristics for matching DMAPI and UPAPI devices - now works in mass storage mode when only VID/PID is present with no serial number and only one device is connected diff -r 846b99bbf2a1 -r 27160ce2811f connectivity/com.nokia.carbide.remoteConnections.discovery.pccs/src/com/nokia/carbide/remoteconnections/discovery/pccs/pccsnative/PCCSConnection.java --- a/connectivity/com.nokia.carbide.remoteConnections.discovery.pccs/src/com/nokia/carbide/remoteconnections/discovery/pccs/pccsnative/PCCSConnection.java Fri Mar 05 13:32:15 2010 -0600 +++ b/connectivity/com.nokia.carbide.remoteConnections.discovery.pccs/src/com/nokia/carbide/remoteconnections/discovery/pccs/pccsnative/PCCSConnection.java Tue Mar 09 15:24:31 2010 -0600 @@ -600,7 +600,7 @@ System.out.printf("getGoodConnectionList: name: %s media: %s\n", device.friendlyName, connInfo.media); //$NON-NLS-1$ } if (connInfo.media.equals("usb")) { //$NON-NLS-1$ - DeviceUSBPersonalityInfo personality = findPersonality(numUSBDevicesExpected, device.serialNumber, connInfo.address, personalityList); + DeviceUSBPersonalityInfo personality = findPersonality30(numUSBDevicesExpected, device.serialNumber, connInfo.address, personalityList); if (personality == null) { if (DEBUG) System.out.println("getGoodConnectionList: personality not found for device: " + device.friendlyName + "-- continue"); //$NON-NLS-1$ String msg = MessageFormat.format(Messages.PCCSConnection_Personality_Switch_Error, @@ -825,13 +825,13 @@ personality.matchedToDMDevice = true; return personality; } else { -// if (serialNumber.equals(NOT_KNOWN)) { -// if (personality.deviceID.contains(id)) { -// if (DEBUG) System.out.println("findPersonality: serial number not known, but VID/PID match\n"); //$NON-NLS-1$ -// personality.matchedToDMDevice = true; -// return personality; -// } -// } + if (serialNumber.equals(NOT_KNOWN)) { + if (personality.deviceID.contains(vidpid) && numUSBDevicesExpected == 1) { + if (DEBUG) System.out.println("findPersonality: serial number not known, but VID/PID match\n"); //$NON-NLS-1$ + personality.matchedToDMDevice = true; + return personality; + } + } String begin = personality.deviceID.substring(0, personality.deviceID.indexOf('\\')); if (begin.equals("0") || numUSBDevicesExpected == 1) { // no serial number at beginning