I'm new at bluetooth.
I'm trying to get all received messages from my mobile phone (an old style Nokia) from my iMac.Since the OBEXFileTransferServices class seems to retrieve information only about files in "Gallery", not in "Messages", I :
found "Nokia PC Service" record of the device connected to the device opened a RFCOMM channel
IOBluetoothSDPServiceRecord *record = ... UInt8 rfcommChannelID; IOReturn status = [record getRFCOMMChannelID:&rfcommChannelID]; status = [device openConnection]; if (status == kIOReturnSuccess) { status = [device openRFCOMMChannelSync:&channel withChannelID:rfcommChannelID delegate:self]; ...
Everything seems to be ok: status is always kIOReturnSuccess the method - (void)rfcommChannelOpenComplete:(IOBluetoothRFCOMMChannel*)rfcommChannel status:(IOReturn)error is called with appropriate values.
But when I try to send data to the phone ([mRFCOMMChannel writeSync:buffer length:numBytesToSend]) the only method called is - (void)rfcommChannelClosed:(IOBluetoothRFCOMMChannel*)rfcommChannel and the channel is closed.
besides, the method - (void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel data:(void *)dataPointer length:(size_t)dataLength is never called.
Does anybody know what could be wrong? Perhaps it depends on the data I send?
And of course, does anybody know a better way to get messages from the phone?
Thank you all in advance. Best regards, livio. |