2 This guide will help you setup your developing environment for Protocol plug-in Manager and Protocol plug-ins in Ubuntu.
5 Before starting, following tools should be installed.
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
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
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
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
23 Building and Using Protocol Plug-in Manager
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;
28 ~/oic/oic-resource/service/protocol-plugin $_
31 The Protocol Plug-in directory includes following sub directories;
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
41 If you build by scons skip 2,3.
43 2. Compiling C-Pluff library
44 Before building Protocol-Plugin Manager, C-Pluff library should be compiled as follows.
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
55 By running make in the protocol-plugin path, protocol-plugin manager, all plugins and sample applications will be created.
57 NOTE: To build plugins in 64-bit Ubuntu Linux, OCLib.a and libcoap.a library should be re-compiled with ?fPIC option.
59 ~/service/protocol-plugin/build/linux$make
63 This version of protocol plug-in source code has following functionality.
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.
69 So, to test a plug-in, follow below steps.
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.)