Re: OBEXFileTransferServices delegate method trouble
Re: OBEXFileTransferServices delegate method trouble
- Subject: Re: OBEXFileTransferServices delegate method trouble
- From: "Daniel Klevebring" <email@hidden>
- Date: Thu, 3 Jan 2008 10:04:05 +0100
Hi again,
I have now changed my code, and now the delegate function gets called.
Here's my code (relevant parts):
main.m:
//setting up the device
mDevice = [IOBluetoothDevice withAddress: &deviceAddress];
//set up channel and max packet length = 256
channelID = 7;
mMaxPacketLength = 256;
//create the obex session
mOBEXSession = [IOBluetoothOBEXSession withDevice:mDevice channelID:channelID];
//create filetransferrer
FileTransferrer * mFileTranferrer = [[FileTransferrer alloc] initWithOBEXSession: mOBEXSession];
NSRunLoop *theRL = [NSRunLoop currentRunLoop];
while (![mFileTranferrer finished] && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);
FileTransferrer.m:
- (FileTransferrer *) initWithOBEXSession: (IOBluetoothOBEXSession *) inOBEXSession {
self = [super init];
finished = NO;
mFileTranfer = [[OBEXFileTransferServices alloc] initWithOBEXSession: inOBEXSession];
[mFileTranfer setDelegate: self];
[mFileTranfer retain];
OBEXError status = [mFileTranfer connectToFTPService];
if(status == kOBEXSuccess){
NSLog(@"Local success when connecting to FTP service");
}else {
NSLog(@"Local failure when connecting to FTP service");
}
return self;
}
- (void) fileTransferServicesConnectionComplete:(OBEXFileTransferServices*)inServices error:(OBEXError)inError{
NSLog( [NSString stringWithFormat: @"Other error when connecting to FTP service on device, error code %i", inError] );
}
The problem is however that the fileTransferServicesConnectionComplete prints an error:
'Other error when connecting to FTP service on device, error code -21850'
I wonder if my choice of channel (7) is correct for OBEX file transfer. Can this be what's causing the error?
Best
Daniel
On Dec 31, 2007 12:25 PM, Ralf Menssen <
email@hidden> wrote:
On 31.12.2007 2:11 Uhr, "Daniel Klevebring" <email@hidden
> wrote:
However, the delegate function never gets called (it produces no output).
Am I setting the delegate in a correct way?
Best regards
Daniel K
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden
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