Running Basic Sample - 精简 Linux
前提条件
- Build the thin Linux samples
- Build the AllJoyn™ router. AllJoyn 精简应用程序需要一个可以连接的 AllJoyn 路由来正常工作。
运行 Basic Client 和 Service
- 使用配置文件运行 AllJoyn daemon,使精简应用程序可以连接。
```sh
#
# This sets the library path to load the liballjoyn.so shared library.
export LD_LIBRARY_PATH=pwd
/../lib:$LD_LIBRARY_PATH
./alljoyn-daemon & ```
- 运行 basic_service (在新的命令行中).
sh
cd $AJ_ROOT/core/ajtcl/samples/basic
./basic_service
- 运行 basic_client (在新的命令行中).
sh
cd $AJ_ROOT/core/ajtcl/samples/basic
./basic_client
basic_client 的输出应为如下所示:
./basic_client
<node name="/sample">
<interface name="org.alljoyn.Bus.sample">
<method name="Dummy">
<arg name="foo" type="i" direction="in"/>
</method>
<method name="Dummy2">
<arg name="fee" type="i" direction="in"/>
</method>
<method name="cat">
<arg name="inStr1" type="s" direction="in"/>
<arg name="inStr2" type="s" direction="in"/>
<arg name="outStr" type="s" direction="out"/>
</method>
</interface>
</node>
'org.alljoyn.Bus.sample.cat' (path='/sample') returned 'Hello World!'.
Basic client exiting with status 0.
basic_service 的输出应为如下所示:
./basic_service
<node name="/sample">
<interface name="org.alljoyn.Bus.sample">
<method name="Dummy">
<arg name="foo" type="i" direction="in"/>
</method>
<method name="cat">
<arg name="inStr1" type="s" direction="in"/>
<arg name="inStr2" type="s" direction="in"/>
<arg name="outStr" type="s" direction="out"/>
</method>
</interface>
</node>
000.000 aj_guid.c:76 LookupName(): NULL
Session lost. ID = 681866772, reason = 2AllJoyn disconnect.