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