Hello Chaps,
I'm currently running a C program for service discovery on a list of devices. The function loops through the list elements and performs an SDP enquiry on each device and returns the results to the screen, but I'm finding that if i get a slow device in the list it can hold things up a little, and in general it would be fantastic to hit all the devices with an enquiry simultaneously.
What's the best method for multithreading this procedure to perform a discovery on several devices at once?, is this even possible? I'd appreciate any suggestions of tales of previous experiences,
Thanks again,
Rob
_________________________________________________________________
Try Live.com - your fast, personalized homepage with all the things you care about in one place.
http://www.live.com/getstarted
Hi Malte,
> > I'm currently running a C program for service discovery on a list of
> > devices. The function loops through the list elements and performs an
> > SDP enquiry on each device and returns the results to the screen, but
> > I'm finding that if i get a slow device in the list it can hold things
> > up a little, and in general it would be fantastic to hit all the
> > devices with an enquiry simultaneously.
>
> Multithreading is possible, I use the OpenThreads library to do so for
> the same reasons. Attention, OpenThreads is OO and C++ so you might look
> for another solution like pthreads.
if you have a recent kernel then this might work since the kernel queues
the page requests. However in general a simultaneous service discovery
(or name resolving for that matter) is not possible. The chips baseband
can only page one remote device at a time. So even if it looks like
simultaneous service discovery. It is not. The kernel serializes it for
you and this means the same page timeout problems appear when devices
are out of range.
The only way to speed this up is to change the page timeout value of the
Bluetooth chip.
Regards
Marcel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Am Freitag, den 30.03.2007, 19:33 +0000 schrieb Robert Rawlins:
> Hello Chaps,
>
> I'm currently running a C program for service discovery on a list of
> devices. The function loops through the list elements and performs an
> SDP enquiry on each device and returns the results to the screen, but
> I'm finding that if i get a slow device in the list it can hold things
> up a little, and in general it would be fantastic to hit all the
> devices with an enquiry simultaneously.
Multithreading is possible, I use the OpenThreads library to do so for
the same reasons. Attention, OpenThreads is OO and C++ so you might look
for another solution like pthreads.
Cheers,
Malte
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Hi,
the choice of C++ and an object orientated approach was more done by my
customer. It has some benefits, e.g. regarding encapsulating data and
functionality but didnt made life easier in the first place. Bluez and
OpenObex is C and gave me some headaches with the callback routines for
instance.
I use threading for the whole application, not only or particulary for
the SDP discovery. And in general the multitasking solution at least
feels faster than the single task one.
You want to use Push instead of Put or FTP, Push is the only Obex
service which doesnt need pairing.
Cheers,
Malte
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Thanks for the advice Marcel, It'll prove invaluable i'm sure.
2 Dongles makes good sense, so i'll defiantly work with that arrangement to get things working fluidly. Is a single dongle able to handle a device enquiry and an SDP at the same time? or is that asking too much? I'm just trying to find the limitations of the hardware, just so i know what to expect as top performance.
>> Modify the page timeout and link supervision timeout to faster>> detect page failures and disconnected links.
I've seen you speak about this before and sounds like its a good way of managing the resources and speeding up the process. Could you explain a little more about modifying those page and link supervision time outs? is this something i do with my code or an alteration i need to make to the bluez stack? and are there any negative effects to making a change like this?
>> No. OBEX Push is for pushing files and OBEX FTP is for FTP like access>> to a file storage.
This is as i expected it would be, that's absolutely fine, i will continue to use our own USSP-Push like tool for doing the obex push, unless you have any other recommendations on doing this.
>> The inquiry and service discovery is kinda simple via D-Bus and Python.>> For pushing the actual file, we don't have a real Python binding.
I'll agree that the Python and D-Bus certainly appears simpler on the face of things, from the samples i've seen, many written by yourself, the code certainly seems less complex that the alternative C methods. Do i need to look into PyBluez to use the python d-bus method, or is the PyBluez wrapper something else all together?
I've noticed while reading through the API documentation is lists a function for 'periodic' enquiry, is this something i should be looking to use in my application? my guess is that its a 'yes' and this function just repeatedly looks for devices in range?
Thanks again for all your help Marcel, and thanks to you other guys for your suggestions.
Rob
_________________________________________________________________
Try Live.com: where your online world comes together - with news, sports, weather, and much more.
http://www.live.com/getstarted
Hi Robert,
> Thanks again for your help, I'm glad that i now know simultaneous
> service requests is -not- an option, which means that my current
> solution isn't so bad. At the moment i run an HCI enquiry and then
> loop through the results, SDP each device for the obex channel and
> initiate a push to them. The speed is pretty good, we just have the
> problem that if we've got a slow 1.1 device in range, they can hold up
> the queue a couple of seconds.
>
> Basically i'm looking to build a small application which distributes
> calendar information to people as they walk past my clients pub. But
> as people are walking past it is important that we discover the device
> and its services as quickly as possible, so they dont walk out of
> range before we get chance to push the file to them.
>
> Have any of you had experience of working with this before? or have
> any advice on it?
sort the list of found devices by RSSI to contact the devices in range
first. Modify the page timeout and link supervision timeout to faster
detect page failures and disconnected links.
You can use two dongles. So one for running the inquiry and the other
one for service discovery and pushing the actual files.
> With regards to pushing a file to them, is ObexObjectPush my best
> option? or is ObexFTP replacing this now?
No. OBEX Push is for pushing files and OBEX FTP is for FTP like access
to a file storage.
> Using python wont be an issue, I find that most of these top level
> languages are very similar so learning the syntax for python wont be
> an issue, its just a case of finding some good examples to look it.
The inquiry and service discovery is kinda simple via D-Bus and Python.
For pushing the actual file, we don't have a real Python binding.
Regards
Marcel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Hi Guys,
Thanks again for your help, I'm glad that i now know simultaneous service requests is -not- an option, which means that my current solution isn't so bad. At the moment i run an HCI enquiry and then loop through the results, SDP each device for the obex channel and initiate a push to them. The speed is pretty good, we just have the problem that if we've got a slow 1.1 device in range, they can hold up the queue a couple of seconds.
Basically i'm looking to build a small application which distributes calendar information to people as they walk past my clients pub. But as people are walking past it is important that we discover the device and its services as quickly as possible, so they dont walk out of range before we get chance to push the file to them.
Have any of you had experience of working with this before? or have any advice on it?
With regards to pushing a file to them, is ObexObjectPush my best option? or is ObexFTP replacing this now?
Using python wont be an issue, I find that most of these top level languages are very similar so learning the syntax for python wont be an issue, its just a case of finding some good examples to look it.
Thanks again for your help guys, i look forward to hearing from you.
Rob
_________________________________________________________________
Try Live.com - your fast, personalized homepage with all the things you care about in one place.
http://www.live.com/getstarted