@SuppressWarnings("unchecked")
    void addDriver(Class<? extends UsbSerialDriver> driverClass) {
        Method method;

        try {
            method = driverClass.getMethod("getSupportedDevices");
        } catch (SecurityException | NoSuchMethodException e) {
            throw new RuntimeException(e);
        }

        final Map<Integer, int[]> devices;
        try {
            devices = (Map<Integer, int[]>) method.invoke(null);
        } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e);
        }

        for (Map.Entry<Integer, int[]> entry : devices.entrySet()) {
            final int vendorId = entry.getKey();
            for (int productId : entry.getValue()) {
                addProduct(vendorId, productId, driverClass);
            }
        }

        try {
            method = driverClass.getMethod("probe", UsbDevice.class);
            mMethodProbeTable.put(method, driverClass);
        } catch (SecurityException | NoSuchMethodException ignored) {
        }
    }
Internal method to add all supported products from
{@code getSupportedProducts} static method.

@param driverClass to be added
usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver/ProbeTable.java