Skip to contentSkip to conversation

modify RFCOMM_DISC_TIMEOUT

Bluez-devel Carlos AM 2 participants 3 messages Jul 22, 2004 – Jul 23, 2004 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore

Carlos AM

author
#0 lore raw

Hi

I am developing a GPS unit that communicates via RFCOMM and I noticed that the timeout of the RFCOMM disconnection is 20 seconds. ¿Does exists a way to change this timeout from a rfcomm server program that uses sockets?
It seems that changing this #define in the rfcomm.h is not enough

Regards
Carlos AM
Naxus Conectividad Móvil

maintainer
#1 lore raw

Hi Carlos,

Quoted 3 lines

I am developing a GPS unit that communicates via RFCOMM and I noticed that the timeout of the RFCOMM disconnection is 20 seconds. =BFDoes exists a way to change this timeout from a rfcomm server progra=

m

Quoted 2 lines

that uses sockets?
It seems that changing this #define in the rfcomm.h is not enough

what do you expect that RFCOMM_DISC_TIMEOUT is doing?

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#3 lore raw
In reply to a message not in the archive

Hi Carlos,

Quoted 12 lines

I run a rfcomm server built on top of bluez using sockets, the client runs a different bluetooth protocol implementation that is very buggy and sometimes stops the rfcomm comunication without sending a DISC. So the rfcomm server waits for 20 seconds (RFCOMM_DISC_TIMEOUT) and then closes the connections and become available again. The sending loop of the server is:

//using sockets
//send until write returns -1
while(n>=0)

 {
    n=write(client,s,strlen(s));
    sleep(1);
Quoted 7 lines

}
//go to listen again

If the client simply stops the communication, not disconnect, the server must be available as soon as possible. 20 seconds it's too long for our application.

what you want is an idle timeout detection. The RFCOMM_DISC_TIMEOUT is not meant for doing this. Show us the output of "hcidump -x -t" while this happens.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel