參考官網步驟
以下為紀錄成功過程
Export path
1. Open terminal and move to root dir
Note: In my case, root dir name is alljoyn-14.12.00a-src
2. Terminal type
export AJ_ROOT=`pwd`
3. Terminal type
export TARGET_CPU=x86
Note: <TARGET CPU> can be either x86_64, x86, or whatever value you set for “CPU=” when running SCons.
value of TARGET CPU must matchas path, e.g.
/alljoyn-14.12.00a-src/build/linux/x86_64/ or /alljoyn-14.12.00a-src/build/linux/x86/
4. Terminal type
export LD_LIBRARY_PATH=$AJ_ROOT/build/linux/$TARGET_CPU/debug/dist/cpp/lib:$LD_LIBRARY_PATH
Run the AboutService Sample App
1. In root of dir(alljoyn-14.12.00a-src), type
$AJ_ROOT/build/linux/$TARGET_CPU/debug/dist/cpp/bin/samples/AboutService
Note: some message will print on terminal e.g.
BusAttachment started. 0.037 ****** ERROR NETWORK common/os/posix/Socket.cc:346 | Binding (sockfd = 59) to 0.0.0.0 9955: 98 - Address already in use: ER_OS_ERROR BusAttachment connect succeeded. BusName :AVq3OlHG.2 AboutObj Announce Succeeded. 0.041 ****** ERROR NETWORK common/os/posix/Socket.cc:346 | Binding (sockfd = 58) to 0.0.0.0 9955: 98 - Address already in use: ER_OS_ERROR 1.863 ****** ERROR NETWORK iodisp2_0 common/os/posix/Socket.cc:463 | Shutdown socket (sockfd = 11): 107 - Transport endpoint is not connected: ER_OS_ERROR
it will show message when client connects.
Run the AboutClient Sample App
1. In root of dir(alljoyn-14.12.00a-src), type
$AJ_ROOT/build/linux/$TARGET_CPU/debug/dist/cpp/bin/samples/AboutClient
Note: terminal print message e.g.
BusAttachment started. BusAttachment connect succeeded. WhoImplements called. ********************************************************************************* Announce signal discovered From bus :R8gNQJgr.2 About version 1 SessionPort 900 ObjectDescription: /example/path com.example.about.feature.interface.sample AboutData: Key: AppId 01 b3 ba 14 1e 82 11 e4 86 51 d1 56 1d 5d 46 b0 Key: DefaultLanguage en Key: DeviceId 93c06771-c725-48c2-b1ff-6a2a59d445b8 Key: ModelNumber 123456 Key: AppName Application Key: DeviceName My Device Name Key: Manufacturer Manufacturer ********************************************************************************* ... Calling /example/path/com.example.about.feature.interface.sample Echo method reply: ECHO Echo echo...
2. AboutServer will print message e.g.
... Session Joined SessionId = 3156666061 Echo method called: ECHO Echo echo...