iotivity 0.9.0
[platform/upstream/iotivity.git] / service / protocol-plugin / readme
1
2 This guide will help you setup your developing environment for Protocol plug-in Manager and Protocol plug-ins in Ubuntu. 
3
4 1. Preparings
5 Before starting, following tools should be installed. 
6
7 Automake
8 Automake is a tool for automatically generating Makefile.in files compiliant with the GNU Coding Standards. This tool is used for compiling C-Pluff open source which used in Plug-in Manager.
9 $ sudo apt-get install automake
10
11 Libtool
12 GNU libtool is a generic library support script. This tool is used for compiling C-Pluff open source which used in Plug-in Manager.
13         $ sudo apt-get install libtool
14
15 gettext
16 GNU `gettext' utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages. This tool is used for compiling C-Pluff open source which used in Plug-in Manager.
17         $ sudo apt-get install gettext
18
19 Expat
20 Expat is a stream-oriented XML parser library. This library is used for compiling C-Pluff open source which used in Plug-in Manager.
21         $ sudo apt-get install expat
22
23 Building and Using Protocol Plug-in Manager
24
25 Once the source code is downloaded into a specific folder, oic in this context, you may follow the steps to build and execute Protocol Plug-in Manager.
26 The path for Protocol Plugin is as following;
27
28 ~/oic/oic-resource/service/protocol-plugin $_
29
30  
31 The Protocol Plug-in directory includes following sub directories;
32
33 /plugin-manager Directory for Plug-in Manager
34 /plugins        Directory for Reference Plugins  
35 /lib            Directory for Common Library
36 /sample-app     Directory for Iotivity Sample Application
37 /doc            Directory for Developers Document
38 /build          Directory for Building and Binary Release
39
40
41 If you build by scons skip 2,3.
42
43 2. Compiling C-Pluff library 
44 Before building Protocol-Plugin Manager, C-Pluff library should be compiled as follows.
45
46 ~/service/protocol-plugin/lib/cpluff$ aclocal
47 ~/service/protocol-plugin/lib/cpluff$ autoconf
48 ~/service/protocol-plugin/lib/cpluff$ autoheader
49 ~/service/protocol-plugin/lib/cpluff$ automake
50 ~/service/protocol-plugin/lib/cpluff$ ./configure
51 ~/service/protocol-plugin/lib/cpluff$ make
52
53  
54 3. Run make
55 By running make in the protocol-plugin path, protocol-plugin manager, all plugins and sample applications will be created. 
56  
57 NOTE: To build plugins in 64-bit Ubuntu Linux, OCLib.a and libcoap.a library should be re-compiled with ?fPIC option.
58  
59 ~/service/protocol-plugin/build/linux$make
60
61
62 4. Using Plugins 
63 This version of protocol plug-in source code has following functionality.
64
65 1) Provides plug-in manager which can start and stop plug-in library.
66 2) Provides plug-in library which can communicate with MQTT protocol Fan and Light.
67 3) Locate shared plug-in library and XML file in a specific folder.
68
69 So, to test a plug-in, follow below steps.
70
71 1) Copy libpmimple.so from {Top_Dir}/out/linux/x86/release to sample-app folder.
72 2) Provides OIC Sample Client which can get info about Fan and Light with configuration file(pluginmanager.xml).
73 3) Copy the pluginmanager.xml from ~/service/protocol-plugin/sample-app/linux/mqtt/ to sample-app folder.
74 4) Modifty the pluginmanager.xml 
75 5) Before starting sample app need as below command. 
76    $export LD_LIBRARY_PATH={Top_Dir}/out/linux/x86/release/:$LD_LIBRARY_PATH
77 6) Start the plug-in from plug-in manager sample.
78    ex)~service/protocol-plugin/sample-app/linux/mqtt$./mqttclient
79    (Need mqtt broker working in the local system(127.0.0.1) for test.)
80