Hi Marco,
thats exactly the point:
With the *same* target device (a mobile phone) and the same starting conditions (always deleted a paired device from system-preferences) I get *different* behavior (regarding authentication) when using 'Bluetooth File Exchange'.app or using the OBEXFileTransferServices class.
What I do is actually this (modulo asynchronous delegate handling of course):
IOBluetoothDevice *device = ... // device is from inquiry
IOBluetoothSPDUUID *uuid = [IOBluetoothSDPUUID uuid16:kBluetoothSDPUUID16ServiceClassOBEXFileTransfer];
IOBluetoothSDPServiceRecord *rec = [device getServiceRecordForUUID:uuid];
IOBluetoothOBEXSession *ses = [IOBluetoothOBEXSession withSDPServiceRecord:rec];
OBEXFileTransferServices *ofts = [OBEXFileTransferServices withOBEXSession:ses];
// (*) see below
[ofts connectToFTPService];
[ofts sendFile:myFile];
// *** here the device will ask for authentication ***
I played around with opening the connection manually at the location marked by (*) above without any difference:
[device openConnection:self withPageTimeout:kDefaultPageTimeout authenticationRequired:NO];
What is 'Bluetooth File Exchange'.app doing here? Maybe it does not use the class OBEXFileTransferServices but lower level APIs which make the differences here?
Cheers
marc
On 2006-01-08, at 17:38, Marco Pontil wrote:
Marc,
The receiver of the file is the party that decides if authentication is needed or not. If you do not get a paring request when transferring a file is either because:
1] the receiver does not require it.
2] the receiver was previously paired with your mac (trough an eralier connection, or setup trough the setup assistant).