Auto connection control from gadget snap

Gadget snap can define slots related to hw available on on the device. Further there could be multiple instances of slots of the same type (gpio, serial interface). Thanks to the nature of those slots, there is no robust mechanism which will allow store side to auto connect such a slot for installed snaps. Store snap declaration is working with interface types. For example in case of gpio slots, we would typically have multiple slot instances, which would lead to multiple candidates for auto connection. Using slot names from store side is not possible, since every device can have different mapping of gpio pings, further slot names are defined by gadget snap and there is no guarantee two devices would keep same slot naming convention.

Proposed solution to enable auto connection in such a case would be connection definition in gadget snap. Similar to config defaults value-key pairs defined in gadget snaps.

Reasoning is that gadget snap is published by device owner, hence

  • it has knowledge about hw mapping of exposed slots
  • The owner of the device should have the right to declare which snaps could be auto connected on its device

@mvo any thoughts on this one?