Sorry for the late reply, busy days...
Yes, this plug is "auto" connected by the deviceadmin snap.
I extended the datalayer.registernode example from the SDK version 1.12 and added a hook that copies files when the necessary plug (active-solution) is connected.
See documentation of snapcraft: https://snapcraft.io/docs/interface-hooks https://snapcraft.io/docs/supported-snap-hooks
Add a folder "db_config" including a test file and a folder "hooks" including the hook executable "connect-plug-active-solution" to the project:
Make file "connect-plug-active-solution" executable chmod +x connect-plug-active-solution
Add changes to "snacraft.yaml"
Add plug to the application, to be able to read/write test file in the program later on
apps:
registerNode:
command: registerNode
# interfaces to connect to https://snapcraft.io/docs/supported-interfaces
plugs:
- network
- datalayer
- active-solution
Add new part to the snap to get the test file into the snap parts:
test:
plugin: dump
source: ./db_config
organize:
'*': ./db_config/
Add plug to the snap to get general access to the active configuration plugs:
active-solution:
interface: content
content: solutions
target: $SNAP_COMMON/solutions
Add plug to the hook so active configuration can be manipulated in there hooks:
connect-plug-active-solution:
plugs: [active-solution]
Add command line code in the executable "connect-plug-active-solution" to create a folder and copy test file to the active configuration #!/bin/bash
mkdir -p $SNAP_COMMON/solutions/activeConfiguration/db_config/
cp $SNAP/db_config/test $SNAP_COMMON/solutions/activeConfiguration/db_config/
After installation the folder "db_config" is added to the active configuration including file "test"
... View more