• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OBEXFileTransferServices delegate method trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


This topic has been answered several times in this list, like here:

http://lists.apple.com/archives/bluetooth-dev/2004/Sep/msg00018.html

In general it is a good idea to search the archive of this list first:

http://lists.apple.com/archives/bluetooth-dev/

Regards,

Ralf



 _______________________________________________
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

  • Follow-Ups:
    • Re: OBEXFileTransferServices delegate method trouble
      • From: Ralf Menssen <email@hidden>
  • Next by Date: Re: OBEXFileTransferServices delegate method trouble
  • Next by thread: Re: OBEXFileTransferServices delegate method trouble
  • Index(es):
    • Date
    • Thread