code: public static String[] getPortIdentifiers()
  	{
  		String ports = null;
  		try {
  			ports = System.getProperty("microedition.commports");
  		}
  		catch (final SecurityException e) {}
  		if (ports != null) {
  			final StringTokenizer st = new StringTokenizer(ports, ",");
  			final String[] portIds = new String[st.countTokens()];
  			for (int i = 0; i < portIds.length; ++i)
  				portIds[i] = st.nextToken();
  			return portIds;
  		}
  		if (SerialComAdapter.isAvailable()) {
  			final String[] prefixes = defaultPortPrefixes();
  			final List<String> l = new ArrayList<>(10);
  			for (int k = 0; k < prefixes.length; k++) {
  				final String prefix = prefixes[k];
  				for (int i = 0; i < 10; ++i)
  					if (SerialComAdapter.portExists(prefix + i))
  						l.add(prefix + i);
  			}
  			return l.toArray(new String[l.size()]);
  		}
  		// skip other possible adapters for now, and return empty list...
  		return new String[0];
  	}
docs: Attempts to gets the available serial communication ports on the host.
  <p>
  At first, the Java system property "microedition.commports" is queried. If there is no
  property with that key, and the Calimero library has access to serial ports, the lowest 10
  port numbers of each of the default system name prefixes are checked if present.<br>
  The empty array is returned if no ports are discovered.
  
  @return array of strings with found port identifiers