0

Bundled routing c++ linux example

asked 2015-01-14 13:58:16 -0700

mathben gravatar image

Hi, I search example to use bundled routing in c++ application on linux with build guide.

All example I got with linux, the router is an external daemon.

My version of alljoyn is 14.12

Information I know : I read the code of bbservice. Do we need to set credentials and connect("null:") ? In pbxproj file, they add this argument to LDFLAGS : -lajrouter -lBundledRouter.o -lssl -lcrypto We need to compile alljoyn with this argument : BR=ON

Thanks for your help.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-01-14 15:54:21 -0700

Nikhil Dabhade gravatar image

updated 2015-01-15 13:52:08 -0700

Hi mathben,

  1. You would need a build that had BR=on

  2. The args passed to the BusAttachment::Connect should be "null:"

  3. If you passed in a connect args that the BusAttachment cannot recognize or connect to it will by default try the "null:" transport thereby invoking its own bundled router

[Added]
4. Also make sure you have BundledRouter.o in the list of libraries you link against
[/Added]

You are looking at the right place. If you look at alljoyn_objc/alljoyn_darwin.xcodeproj --> Target alljoyn_core_osx --> Info you will notice that BR=on is needed along with the libraries you mentioned.

Have you tried running bbservice without first running an external daemon ? If you do that it will invoke the bundled routing node.

Let me know how it goes

Nikhil

edit flag offensive delete publish link more
0

answered 2015-01-15 13:19:50 -0700

mathben gravatar image

Hi Nikhil.

I recompile alljoyn with BR=on. The deamon is not running and i can run bbservice without error.

Now, in my code,

s_bus->RegisterBusListener(s_busListener); s_busListener.set_s_bus(s_bus);

QStatus status = s_bus->Start(); QStatus status = s_bus->Connect("null:");

I compile with qt.

CONFIG += c++11 unix:!macx: LIBS += -L/home/mathben/Downloads/alljoyn/alljoyn-14.12.00-src/build/linux/x86_64/debug/dist/cpp/lib -lalljoyn -lstdc++ -lcrypto -lpthread -lrt -lajrouter -lssl

INCLUDEPATH += /home/mathben/Downloads/alljoyn/alljoyn-14.12.00-src/build/linux/x86_64/debug/dist/cpp/inc INCLUDEPATH += /home/mathben/Downloads/alljoyn/alljoyn-14.12.00-src/build/linux/x86_64/debug/dist/cpp/lib INCLUDEPATH += /home/mathben/Downloads/alljoyn/alljoyn-14.12.00-src/build/linux/x86_64/debug/dist/about/lib

DEPENDPATH += /home/mathben/Downloads/alljoyn/alljoyn-14.12.00-src/build/linux/x86_64/debug/dist/cpp/inc DEPENDPATH += /home/mathben/Downloads/alljoyn/alljoyn-14.12.00-src/build/linux/x86_64/debug/dist/cpp/lib DEPENDPATH += /home/mathben/Downloads/alljoyn/alljoyn-14.12.00-src/build/linux/x86_64/debug/dist/about/lib

DEFINES += QCC_CPU_X86

DEFINES += QCC_OS_GROUP_POSIX

DEFINES += QCC_OS_LINUX

I think the error is because I haven't -lBundledRouter.o I got this error : cannot find -lBundledRouter.o

I tested with my qt and mac osx and it's work.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-01-14 13:58:16 -0700

Seen: 195 times

Last updated: Jan 15 '15