Support for multiple dynamic serial-port interfaces

Actually using e.g. /dev/ttyUSB1 is not enough even for hardwired FTDI devices as the enumeration depends on the boot process. So another USB to serial converter could become /dev/ttyUSB1 if it is plugged to the right USB port at the right time. Using the serial number is also a bad idea, since a gadget should work for a batch of devices (that most likely have different serial numbers) and not only for one single device.

My suggestion is to support parameters for interfaces in the connection phase (i.e. when snap connect is called). For sure this won’t work for auto connected interfaces, but that’s OK IMHO. So the interface defintion (in snapd) only defines the type of device using placeholders. The placeholders (with specific pre defined allowed value ranges) can be given in the connection phase.

A possible syntax could be:

$ snap connect <snap>:<plug interface>:<paramA>=<valueA>:<paramB>=<valueB> <snap>:<slot interface>