Moved to own topic from this thread:
/sdk-el5su9ce/post/cannot-store-data-in-configuration-MaorZD5gLEttzX2
Moved to own topic from this thread:
/sdk-el5su9ce/post/cannot-store-data-in-configuration-MaorZD5gLEttzX2
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
chmod +x connect-plug-active-solution​Â
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-solutionparts:
test:
plugin: dump
source: ./db_config
organize:
'*': ./db_config/plugs:
active-solution:
interface: content
content: solutions
target: $SNAP_COMMON/solutions​hooks:
connect-plug-active-solution:
plugs: [active-solution]​Â
#!/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"
Â
Â