## Port probing

Whenever a new device is detected by ModemManager, port probing process will get started, so that we can determine which kind of ports we have, and also which plugin we need to use for the specific device. Devices may expose one or more ports, and all of them will follow the same probing logic.

The whole probing process, including pre-probing and post-probing filters, is implemented in the core ModemManager daemon. Plugins will just configure their own special needs in the probing process, so that only the steps required by the given plugin are executed. For example, plugins which do not support RS232 devices will not need AT-based vendor or product filters.

## Pre-probing filters

Pre-probing filters are those which control whether the probing, as requested by the specific plugin, takes place.

- Allowed vendor IDs

  Plugins can provide a list of udev-reported vendor IDs to be used as pre-probing filters. If the vendor ID reported by the device via udev is found in the list provided by the plugin, port probing will be launched as requested by the given plugin.

  This filter is specified by the MM_PLUGIN_ALLOWED_VENDOR_IDS property in the MMPlugin object provided by the plugin.

- Product IDs

  Plugins can provide a list of udev-reported pairs of vendor and product IDs to be used as pre-probing filters.

  If the vendor ID and product ID pair reported by the device via udev is found in the list of 'allowed' pairs provided by the plugin, port probing will be launched as requested by the given plugin. This additional filter should be used when the plugin is expected to work only with a given specific product of a given vendor.

  If the vendor ID and product ID pair reported by the device via udev is found in the list of 'forbidden' pairs provided by the plugin, port probing will not be launched by this plugin. This additional filter should be used when the plugin supports all devices of a given vendor except for some specific ones.

  These filters are specified by the MM_PLUGIN_ALLOWED_PRODUCT_IDS and MM_PLUGIN_FORBIDDEN_PRODUCT_IDS properties in the MMPlugin object provided by the plugin.

- Subsystems

  Plugins can specify which subsystems they expect, so that we filter out any port detected with a subsystem not listed by the plugin.

  This filter is specified by the MM_PLUGIN_ALLOWED_SUBSYSTEMS property in the MMPlugin object provided by the plugin.

- Drivers

  Plugins can specify which drivers they expect, so that we filter out any port detected being managed by a driver not listed by the plugin.

  Plugins can also specify which drivers they do not expect, so that we filter out any port detected being managed by a driver listed by the plugin.

  These filters are specified by the MM_PLUGIN_ALLOWED_DRIVERS and MM_PLUGIN_FORBIDDEN_DRIVERS properties in the MMPlugin object provided by the plugin.

- udev tags

  Plugins can provide a list of udev tags, so that we filter out any port detected which doesn't expose any of the given tags.

  This filter is specified by the MM_PLUGIN_ALLOWED_UDEV_TAGS property in the MMPlugin object provided by the plugin.