diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-02 19:47:36 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-15 18:21:42 +0200 |
commit | b067c5854c76a96b949ff0c092f74649fbda44fc (patch) | |
tree | 3330910c57aaba13de322e6257739669c2174872 /examples/service/README.md | |
parent | 44109a1ad1d92b0da2c88782217bbb8a1d1ff4aa (diff) |
Initial commit
Change-Id: I536251add63ef100b42a67e39a02fef117f2b414
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'examples/service/README.md')
-rw-r--r-- | examples/service/README.md | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/examples/service/README.md b/examples/service/README.md new file mode 100644 index 0000000..17c9869 --- /dev/null +++ b/examples/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:~# +``` + + |