The serial-port interface

serial-port enables access to a specific serial port. This interface is restricted because it provides privileged access to configure serial port hardware.

The slot is intended to be implemented by a gadget snap and is not provided by the core system snap.

Auto-Connect: no

  • Should specify a single path attribute:

    • path (slot): path to serial device node e.g. /dev/ttyS1
  • Or three attributes:

    • usb-vendor (slot): integer representing the USB Vendor ID, must be in range 0 < vid <= 65535
    • usb-product (slot): integer representing the USB Product ID, must be in range 0 <= vid <= 65535
    • path (slot): path of the form /dev/serial-port-... where a symlink will be created to the device e.g. /dev/serial-port-mydevice

To use a serial-port device, the snap developer must add plugs: [ serial-port ] to a snap’s snapcraft.yaml. The snap user can then access a specific serial-port device with an interface connection.

Use snap interface serial-port to see which serial-port devices are available on the system:

$ snap interface serial-port 
name:    serial-port
summary: allows accessing a specific serial port
  - core:model01 (allows accessing a specific serial port)
  - core:monome (allows accessing a specific serial port)

Once connected, the consuming snap can use the device via the path specified by the connected slot.

This is a snap interface. See Interface management and Supported interfaces for further details on how interfaces are used.

Last updated 11 months ago.