All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikko Saarnivala <msaarniv@gmail.com>
To: BLUEZ-USERS <bluez-users@lists.sourceforge.net>
Subject: [Bluez-users] A slave device wont re-connect
Date: Thu, 14 Jun 2007 16:55:15 +0300	[thread overview]
Message-ID: <467148C3.4070409@gmail.com> (raw)

Hello everyone,

I have two devices that can act as Bluetooth master (A and B) and a 
single device that can act only as a Slave (C). The slave can 
communicate only using the RFCOMM profile. The devices A and B are 
actually Linux boxes with D-Link DBT-122 BT USB dongles. The device C is 
a sensor device that I have no control over (I can just switch it on and 
off).

I've been trying to implement a software on the devices A and B which 
would do the following:

1) make periodic BT scans
2) if it finds the device C in these scans, it would create an RFCOMM 
connection to the device C and simply read the data that it is sending
3) when the device C moves out of the range say device A to the coverage 
area of device B the device B should then discover device C and create 
the connection (roaming)

My application is threaded where thread 1 periodically creates a BT 
socket, mekes a BT scan and closes the socket. Thread number 2 is 
created when the first thread discovers the device C. This thread does 
the following:
1) create a BT socket
2) binds the socket to a local BT address
3) connects to the discovered device C
4) read data from socket
5) close socket

This all goes just fine. If the device C first connects to device A and 
then moves to lose connection with it, the device B can discover it and 
the connection succeeds. The problem comes when the device C loses the 
connection to B. Even though the device A can discover C again, the 
connect() _always_ fails.

I have even tried to close the connection using RFCOMMRELEASEDEV ioctl.

My question is that have I missed something that I should do in order to 
shutdown the BT connection properly so that the device C would be ready 
for a new connection from another device?

Best regards,

-- 
Mr. Mikko Saarnivala

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

             reply	other threads:[~2007-06-14 13:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-14 13:55 Mikko Saarnivala [this message]
2007-06-16  7:36 ` [Bluez-users] A slave device wont re-connect Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=467148C3.4070409@gmail.com \
    --to=msaarniv@gmail.com \
    --cc=bluez-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.