Re: How to disconnect a ObexFileTransferServices connection?
Re: How to disconnect a ObexFileTransferServices connection?
- Subject: Re: How to disconnect a ObexFileTransferServices connection?
- From: mat davidson <email@hidden>
- Date: Mon, 27 Nov 2006 09:06:42 -0800
Sup Ralf-
I think we're seeing 2 issues here:
1.) I think you're right, isConnected should be returning FALSE on
receiving disconnectionComplete. I'll look into it ASAP.
2.) However, if you're trying to switch over to the OPP profile from
FTP, you're going to have to close down your OBEXSession and create a
new one. From what I can see, OBEXSession objects are created
according to an SDP record so the FTP OBEXSession cannot be (re)used
for OPP operations. So yes, you'll have to completely close down
your OBEXSession.
mat
On Nov 24, 2006, at 4:46 AM, Ralf Menssen wrote:
It seems to be not possible to close an ObexFileTransferServices
without destroying the ObexSession. I am creating an
ObexFileTransferServices using withOBEXSession (relevant code only):
mOBEXSession = [[IOBluetoothOBEXSession withDevice:mBTDevice
channelID:channelID] retain];
mFileTransferService = [[OBEXFileTransferServices
withOBEXSession:mOBEXSession] retain];
then I'm connecting it to FileTransferServices:
status = [mFileTransferService connectToFTPService];
and the delegate function:
- (void) fileTransferServicesConnectionComplete:
(OBEXFileTransferServices *)inServices error:(OBEXError)inError
is entered with (inError == 0). Everything is fine, I can work with
the device. For some reason I now want to switch to the
ObjectPushService, it behaves differently when sending a file and
this other behaviour is wanted.
So I call:
status = [mFileTransferService disconnect];
and in the call back:
- (void) fileTransferServicesDisconnectionComplete:
(OBEXFileTransferServices*)inServices error:(OBEXError)inError
{
NSLog ([NSString stringWithFormat:@"DisconnectionComplete: %d",
inError]);
if([mFileTransferService isConnected])
NSLog (@"After Close is still connected");
}
It tells me disconnection was successful (inError == 0), but also
that mFileTransferService is still connected. The now following
attempt to connect to ObjectPushService:
status = [mFileTransferService connectToObjectPushService];
fails in the fileTransferServicesConnectionComplete delegate
function with error -21882 (kOBEXSessionAlreadyConnectedError).
Connecting to FTPServices again would also fail with same error. So
to me it looks like disconnecting does not what it promises to do.
Is it necessary to close the whole OBEXSession here?
Ralf Menssen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden