diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-04 13:59:00 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-15 18:21:42 +0200 |
commit | e3d26a820db76f006ec364c90dc54a689446d998 (patch) | |
tree | ae7a80f266445fd6a3bb29abb25ac231d18e7516 /templates/service/README.md | |
parent | 02075924e861edb74935266cc722d362af87a9f0 (diff) |
Rename to more meaningful name directories
Change-Id: Ib3990308c1f2358b3e330cd0068719098c4dab56
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'templates/service/README.md')
-rw-r--r-- | templates/service/README.md | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/templates/service/README.md b/templates/service/README.md new file mode 100644 index 0000000..17c9869 --- /dev/null +++ b/templates/service/README.md @@ -0,0 +1,66 @@ +# Application Framework - Service Template + +## Instructions + +Duplicate directory and adjust names. In particular, replace 'xxxxxx' by a proper service name. + +* adjust CMakeLists.txt (project name and version) +* ajdust config.xml (description, author, license...) +* rename xxxxxx-service-binding.c to something meaningful +* store icon file in icons directory and update the variable PROJECT_ICON in CMakeLists.txt + +## Build + +Run: + +``` +mkdir build +cd build +cmake .. +make +``` + +## Deployment + +Copy the .wgt file on the target through ssh and install it (adjust BOARDIP to your real IP address): + +``` +$ BOARDIP=1.2.3.4 +$ scp xxxxxx-service.wgt root@$BOARDIP:/tmp +$ ssh root@$BOARDIP +# afm-util install /tmp/xxxxxx-service.wgt +# afm-util list +``` + +## Run service manually + +On the target board: + +``` +# afm-util start xxxxxx-server@0.1 +# ps -ef| grep afb-daemon | grep xxx +``` + +## Test using curl + +``` +# PORT=12345 # adjust the port depending in on afb-daemon instance: use ps -ef to check +# curl -v http://localhost:$PORT/api/xxxxxx/ping +* Trying 127.0.0.1... +* Connected to localhost (127.0.0.1) port 5555 (#0) +> GET /api/xxxxxx/ping HTTP/1.1 +> Host: localhost:5555 +> User-Agent: curl/7.44.0 +> Accept: */* +> +< HTTP/1.1 200 OK +< Connection: Keep-Alive +< Content-Length: 184 +< Set-Cookie: x-afb-uuid-5555=30ab9573-cbc8-43f7-b385-0186feebc69a; Path=/api; Max-Age=3600; HttpOnly +< Date: Sun, 10 Jul 2016 00:09:14 GMT +< +* Connection #0 to host localhost left intact +{"response":"Some String","jtype":"afb-reply","request":{"status":"success","info":"Ping Binder Daemon tag=pingSample count=1 query={ }","uuid":"30ab9573-cbc8-43f7-b385-0186feebc69a"}}root@porter:~# +``` + + |