aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Usage.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/Usage.md')
-rw-r--r--docs/Usage.md52
1 files changed, 40 insertions, 12 deletions
diff --git a/docs/Usage.md b/docs/Usage.md
index 65f1ce9..e64c533 100644
--- a/docs/Usage.md
+++ b/docs/Usage.md
@@ -1,22 +1,50 @@
# Usage
-## 1) Add app-controller-submodule as a submodule to include in your project
+## (Optional) Remove the git submodule version
+
+If you already use the controller component but use the submodule version then
+you have to get rid of it to be sure to link and use the library version. To do
+so, you have to do the following:
+
+* deinitialize the submodule using `git`
```bash
-git submodule add https://gerrit.automotivelinux.org/gerrit/apps/app-controller-submodule
+# This example assumes that the git submodule is named app-afb-helpers-submodule
+# and is located at your root project repository.
+git submodule deinit app-afb-helpers-submodule
```
-## 2) Add app-controller-submodule as a static library to your binding
+* remove the relative submodule lines from the `.gitmodules` file
-```cmake
- # Library dependencies (include updates automatically)
- TARGET_LINK_LIBRARIES(${TARGET_NAME}
- ctl-utilities
- ... other dependencies ....
+```bash
+vim .gitmodules
+```
+
+* remove the `ctl-utilities` target link from any CMake target you specified.
+ Those lines look like:
+
+```bash
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
+ ctl-utilities # REMOVE THIS LINE
+ ${link_libraries}
)
```
-## 3) Declare your controller config section in your binding
+## Add libappcontroller as a static library to your binding
+
+In your `config.cmake` file, add a dependency to the controller library, i.e:
+
+```cmake
+set(PKG_REQUIRED_LIST
+ json-c
+ afb-daemon
+ ctl-utilities --> this is the controller library dependency name
+)
+```
+
+Or you can also use the `FIND_PACKAGE` CMake command to add it.
+
+## Declare your controller config section in your binding
```C
// CtlSectionT syntax:
@@ -32,7 +60,7 @@ static CtlSectionT ctlSections[]= {
```
-## 4) Do the controller config parsing at binding pre-init
+## Do the controller config parsing at binding pre-init
```C
// check if config file exist
@@ -46,8 +74,8 @@ static CtlSectionT ctlSections[]= {
if (!ctlConfig) return -1;
```
-## 5) Execute the controller config during binding init
+## Execute the controller config during binding init
```C
int err = CtlConfigExec (ctlConfig);
-``` \ No newline at end of file
+```