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 14:08:07 +0100
Sorry about my last post, I found the error. I forgot to remove a few lines of code, resetting the channel ID... :)
Best
Daniel
On Jan 3, 2008 1:24 PM, Daniel Klevebring <
email@hidden> wrote:
That's a very good question, and with your code for setting the channel right, my code now works like a charm on my friends SonyEricsson W880i (using channel 255) but still gives an error on my Nokia 6288 (using channel 10).
Any ideas on why? Both phones support obex file transfer, and i can browse my nokia using 'Browse device' in the bluetooth menu.
Best
Daniel
On Jan 3, 2008 10:27 AM, Ralf Menssen <
email@hidden> wrote:
Let ask the question the other way round: Why do you think '7' might be a good value?
You have to retrieve the correct channelID from the SDP. Like this:
BluetoothRFCOMMChannelID getObexFTPChannel (IOBluetoothDevice *inDevice)
{
BluetoothRFCOMMChannelID channelID;
IOBluetoothSDPServiceRecord *dialupServiceRecord;
IOBluetoothSDPUUID *ourUUID = [IOBluetoothSDPUUID uuid16:(UInt16)kBluetoothSDPUUID16ServiceClassOBEXFileTransfer];
dialupServiceRecord = [inDevice getServiceRecordForUUID:(IOBluetoothSDPUUID *)ourUUID];
if (dialupServiceRecord)
{
IOReturn status = [dialupServiceRecord getRFCOMMChannelID:&channelID];
if (status == noErr)
return channelID;
}
return -1;
}
Regards,
Ralf
On 03.01.2008 10:04 Uhr, "Daniel Klevebring" <email@hidden> wrote:
Hi again,
I have now changed my code, and now the delegate function gets called.
Here's my code (relevant parts):
main.m:
...
//set up channel and max packet length = 256
channelID = 7;
...
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?
_______________________________________________
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