AllJoyn 框架版本 15.09.00a 用于在 Linux 平台上构建 bbservice 和 bbclient 应用程序,以执行以下这些测试。
如果 bbservice 和 bbclient 在同一个 Linux 设备上运行,使用以下命令
bbservice -n com.test &
bbclient -n com.test -d -c 5 &
然后 bbclient 可以成功 ping bbservice 5 次。
下面是这个测试的输出。
bbservice -n com.test &
AllJoyn Library version: v15.09.00
AllJoyn Library build info: AllJoyn Library v15.09.00 (Built Mon Feb 29 22:13:06 UTC 2016)
opts.transports = 0x105
bbservice com.test ready to accept connections
bbclient -n com.test -d -c 5 &
AllJoyn Library version: v15.09.00
AllJoyn Library build info: AllJoyn Library v15.09.00 (Built Mon Feb 29 22:13:06 UTC 2016)
FindAdvertisedName 0x100 takes 54 ms
FoundAdvertisedName(name=com.test, transport=0x100, prefix=com.test)
FindAdvertisedName 0x4 takes 66 ms
FoundAdvertisedName(name=com.test, transport=0x4, prefix=com.test)
Accepting JoinSession request from :9-ewflpc.2
Accepting JoinSession request from :9-ewflpc.2
NameOwnerChanged(:okSgAM9h.1, null, :okSgAM9h.1)
Session Established: joiner=:9-ewflpc.2, sessionId=e78616c5
NameOwnerChanged(:okSgAM9h.2, null, :okSgAM9h.2)
NameOwnerChanged(com.test, null, :okSgAM9h.2)
Session Established: joiner=:9-ewflpc.2, sessionId=e80376f3
Link timeout was successfully set to 10
JoinSession 0x4 takes 72 ms
Sending "Ping String 1" to org.alljoyn.alljoyn_test.my_ping synchronously
JoinSession 0x100 takes 76 ms
Pinged with: Ping String 1
Link timeout was successfully set to 10
com.test.my_ping ( path=/org/alljoyn/alljoyn_test ) returned "Ping String 1"
Sending "Ping String 2" to org.alljoyn.alljoyn_test.my_ping synchronously
Pinged with: Ping String 2
com.test.my_ping ( path=/org/alljoyn/alljoyn_test ) returned "Ping String 2"
Sending "Ping String 3" to org.alljoyn.alljoyn_test.my_ping synchronously
Pinged with: Ping String 3
com.test.my_ping ( path=/org/alljoyn/alljoyn_test ) returned "Ping String 3"
Sending "Ping String 4" to org.alljoyn.alljoyn_test.my_ping synchronously
Pinged with: Ping String 4
com.test.my_ping ( path=/org/alljoyn/alljoyn_test ) returned "Ping String 4"
Sending "Ping String 5" to org.alljoyn.alljoyn_test.my_ping synchronously
Pinged with: Ping String 5
com.test.my_ping ( path=/org/alljoyn/alljoyn_test ) returned "Ping String 5"
com.test.GetProperty ( path=/org/alljoyn/alljoyn_test) returned "100"
SessionLost(e78616c5) was called. Reason = 2.
SessionLost(e80376f3) was called. Reason = 2.
bbclient exiting with status 0 (ER_OK)
如果 bbservice 在 IP 地址为 192.168.1.1 的 Linux 设备上运行,而 bbclient 在另一个 IP 地址为 192.168.1.2 的 Linux 设备上运行,则 bbclient 无法找到并 ping bbservice。这两个 Linux 设备通过网线连接,通过 Linux ping 命令可以互相 ping 通。
下面是这个测试的输出。
(在 192.168.1.1 Linux 设备上)
bbservice -n com.test &
AllJoyn Library version: v15.09.00
AllJoyn Library build info: AllJoyn Library v15.09.00 (Built Mon Feb 29 22:13:06 UTC 2016)
opts.transports = 0x105
bbservice com.test ready to accept connections
(在 192.168.1.2 Linux 设备上)
bbclient -n com.test -d -c 5 &
AllJoyn Library version: v15.09.00
AllJoyn Library build info: AllJoyn Library v15.09.00 (Built Mon Feb 29 22:13:06 UTC 2016)
那么需要做些什么才能让bbclient在不同的Linux设备上运行时可以ping通bbservice。
谢谢,
P.Tran