05-30-2012 01:56 PM
For one of my projects, I need to have Bonjour connectivity over UDP, I already managed to set up a UDP socket connection between the PlayBook and my computer, but I'm not sure how to go with Bonjour.
Do you know of a library already available for the PlayBook or QNX?
Solved! Go to Solution.
06-03-2012 01:58 PM
06-03-2012 03:26 PM
06-03-2012 04:22 PM
I tried that, but I'm not so familiar with C, or Makefiles or Posix. So I wasn't successful yet in compiling the library for PlayBook, and my dev environment is Windows,which seems to be problematic with the GNU make toolchain (gives me an error that uname is not a known command...). I was also looking at a possible QNX port but didn'tfind much about it, someone on the Internet released a 'patch' for Bonjour on QNX a few years ago on a mailing list, but I couldn't figure out what it was good for.
I'm not giving up though...
06-03-2012 04:34 PM
If I compile this for you, will you love me... FOREVER?
06-03-2012 04:47 PM
06-03-2012 04:53 PM - edited 06-03-2012 05:14 PM
LOL, ok, well I'll get back to PySide then. :-P
But I did take a look at it for you, and started doing some work.
Grab that tarball and extract it. If you look in the folder it extracts, you'll see a mDNSPosix folder. If you look inside there, you'll see a Makefile. Adding these lines will get you started:
ifeq ($(os),qnx) CC = ntoarmv7-gcc CFLAGS_OS = -I/opt/bbndk-2.0.0/target/qnx6/usr/include LD = ntoarmv7-gcc -shared LINKOPTS = -lsocket -lnsl -lresolv ifneq ($(DEBUG),1) STRIP = ntoarmv7-strip endif else
and add the following to line 172
You'll need to set this up on a Ubuntu/Linux build environment, most likely. If you install build-essentials and bison from apt-get, that should get you what you need to start building. I was in the middle of figuring out the compiler options to have it find the headers, when I stopped to write this post.
EDIT: looked at this a bit more, your next hurdle is a lack of syslog.h. It's not shipped with the NDK. According to this post:
you're going to have to implement your own, or remove it from the files somehow. To be honest, I don't think it would be difficult to implement yourself, but just to get going for now, I'd remove it and any functions that reference it, for now.
Give me a like. ;-)
06-04-2012 06:55 PM
Thanks a lot for your indications, it really helped!!
I set up a dev env on Ubuntu 12.04, just a plain ubuntu install with no config, and simply installing BB ndk 2.0 was enough to be able to compile!!
I'm progressing on this slowly...
For now, I just removed all references to syslog, for now...
It seems I already have compiled the basic libraries and a few of the embedded exemples, next step will be to run a simple test on the PlayBook.
A few remarks:
-lnsl and -lresolv seem not to be available on QNX, I just removed the links and it seemed to work, there are also a few headers that need to be renamed or refactored... (<sys/fcntl.h> is in <fcntl.h> on qnx ...)
Hope I'll have this done by the end of the week.
06-05-2012 05:40 PM
It seems I'm almost done with Bonjour on the PlayBook, tonight I just managed to compile through all the steps.
Now I just need to code a test app for the PlayBook to verify the compiled lib is actually working... hopefully it will be ok, but I'll leave that for tomorrow, it's late here, need a rest ;-)
And with a bit of luck, I'll have my app ready to deploy when I get the dev alpha in Paris next Tuesday :-P
06-05-2012 05:43 PM
That's fantastic to hear! Really looking forward to what you'll come up with.
Be sure to contribute your changes upstream back to Apple, so that we can all benefit from the work. :-)