All of lore.kernel.org
 help / color / mirror / Atom feed
* A couple of questions related to a rfcomm server
@ 2011-07-13 10:51 Sérgio Capela
  2011-07-24 16:26 ` Peter Hurley
  0 siblings, 1 reply; 5+ messages in thread
From: Sérgio Capela @ 2011-07-13 10:51 UTC (permalink / raw)
  To: linux-bluetooth


Hello,

since this is the only contact available at bluez.com I'm sending these  
questions to this list. If this is not the contact to be used please  
direct me to the one which is.

I'm trying to make a sort of content server using bluetooth. As such I  
coded a non blocking rfcomm server which accepts remote connections and  
according to the received connections sends data back. The machine doing  
this uses two bluetooth adapters and one is binded to the accepting  
socket, however the same machine, in this case the same application is  
supposed to scan visible remote bluetooth adapters for rssi values and so  
my first question arises.

Is it possible to accept connections at the same time a inquiry is running  
or is the inquiry a blocking operation at the stack level? With two  
adapters my server accepts remote connections and receives and sends data  
but when an inquiry is running it stops accepting connections. The inquiry  
is done in a separate thread.

Another question is related to a rfcomm client getting into D state and  
thus not killable. Due to my setup (two adapters in the same computer) I  
can use the computer as both the server and the client. For test purposes  
only I made a simple rfcomm client and I put it in a shell cycle thus  
stressing the system regarding bluetooth connections. In this situation  
the rfcomm client application becomes unresponsive after some time due to  
a non exiting disk sleep. I then end up with multiple instances of the  
same application and I can't kill them. By launching the application after  
this I can see that the code blocks at a socket connection command  
entering in a disk sleep state from which it doesn't exit. When this  
happens I have to unplug the bluetooth adapter to get it working again  
since it starts to give timeouts with hciconfig commands like "hciconfig  
reset".

Any ideas about this? The problem itself is not serious since it shouldn't  
arise in normal conditions but it does require a reboot because of the  
state D processes and makes the adapter unusable unless it is unplugged.

Best regards,
-- 
Sérgio Pedro dos Santos Capela - Tziranda

Polo Tecnológico de Lisboa
Edifício Empresarial 3
1600-546 Lisboa

Telf:  21 314 09 83
Telml: 96 491 94 37
Email: ssc@tziranda.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-01 15:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-13 10:51 A couple of questions related to a rfcomm server Sérgio Capela
2011-07-24 16:26 ` Peter Hurley
2011-07-24 22:08   ` Sérgio Capela
2011-07-25 22:05     ` Peter Hurley
2011-08-01 15:09       ` Sérgio Capela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.