Ohly, Patrick wrote: > On Tue, 2009-07-28 at 10:31 +0100, Zhao, Forrest wrote: >>> >>>>> If OBEX really doesn't support resuming an interrupted connection, >>>>> then syncevo-dbus-server would have to check whether the first >>>>> message in a new connection is something which matches an active >>>>> session. That changes steps 3-7, because the connect cannot be >>>>> processed without the message data. A unique ID for the peer would >>>>> be useful, but only if it remains constant after a loss of >>>>> connection. In HTTP that's not the case, because the same client >>>>> might have a different IP after reconnecting. >>>> This is not the case for OBEX, either. After the connection is >>>> dropped, the OBEX server may reassign the connection ID to another >>>> OBEX session. >>> >>> But the peer itself has a unique ID that could be used to address it >>> in a new connection request, right? Is it the same for USB and >>> Bluetooth? >> >> hmm, please read the definition of cmd_connect() at >> http://git.kernel.org/?p=bluetooth/obexd.git;a=blob;f=src/obex.c;h=53ec9b92c54bed4fac349674060cce10f0658eef;hb=HEAD >> >> You may find that connection ID(i.e. cid) is defined as a global >> variable and assigned by OBEX server. Please let me if this answers >> your question. > > No, not quite. I'm looking for whatever corresponds to the IP address > in a TCP connect(), or at a lower level the MAC. In case that it > makes a difference, this is from a user space perspective, not inside > the kernel.
This is done by rfcomm_connect() in obexd. The declaration is static int rfcomm_connect(const bdaddr_t *src, const bdaddr_t *dst, uint8_t channel, GIOFunc function, gpointer user_data); src is source BT MAC address; dst is destination BT MAC address, channel is the service channel (e.g. PBAP server channel is 15). > > So for initiating an OBEX connection, how do I find the available > devices and choose one of them? To find the available BT devices, please use command 'hcitool scan'; to find the services supported by a BT device, please use command 'sdptool browse BT-MAC-address'. > > If I was contacted via obexd and Bluetooth, can I find that device > again when it reconnects via USB, without establishing a connection > and exchanging some data? Sorry, I have not experienced such case. Marcel, Could you help to answer this question? Thanks, Forrest _______________________________________________ SyncEvolution mailing list [email protected] http://lists.syncevolution.org/listinfo/syncevolution
