• 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
Using unsecure/unauthenticated RFCOMM
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using unsecure/unauthenticated RFCOMM


  • Subject: Using unsecure/unauthenticated RFCOMM
  • From: Alexei Czeskis <email@hidden>
  • Date: Thu, 23 Feb 2012 10:09:09 -0800

Hello!

Does anyone have any experience using unsecure/unauthenticated RFCOMM
on OS X?  I'm trying to do unsecure RFCOMM between two unpaired
bluetooth devices (one is a MacBook running 10.7.3, the other is an
Android phone running ICS). I seem to be able to open an
unauthenticated baseband connection, but not an unauthenticated RFCOMM
channel over an unauthenticated basebandconnection.

What's odd is that I am able to open an unauthenticated baseband
connection successfully, but when I try to open an RFCOMM channel over
that connection, the devices try to pair.  Here is roughly what I'm
doing:

/*
 * Before this part, I:
 * 1. Create device from a BT address string
 * 2. Perform an SDP query
 * 3. Extract the SDP record by UUID, make sure the service name
matches my service
 *     (whine that getServiceRecordForUUID returns one record instead of a list)
 * 4. Get the channel ID from SDP record
*/

// Try connecting to device
if( [device openConnection:nil
               withPageTimeout:100000
               authenticationRequired:false] != kIOReturnSuccess ) {
    NSLog(@"Couldn't open unauthenticated baseband connection to
client device");
    exit(3);
}
NSLog(@"\tOpened unauthenticated baseband connection successfully");

// Try opening an RFCOMM channel
IOBluetoothRFCOMMChannel *channel = nil;
IOReturn status;
if ( [device openRFCOMMChannelSync:&channel
                withChannelID:channelID delegate:self] != kIOReturnSuccess) {
  NSLog(@"Couldn't open RFCOMM channel");
  [device closeConnection];
  exit(8);
}
NSLog(@"\tOpened RFCOMM channel");

The above code fails at the openRFCOMMChannelSync() call.

I'm fairly certain that the other endpoint is doing what it's supposed
to be doing -- I've been able to created unauthenticated RFCOMM
channels to it using unbuntu without pairing the two devices.

Can anyone point me in the right direction?  Thanks!


-Alexei

 _______________________________________________
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: Using unsecure/unauthenticated RFCOMM
      • From: Matthias Ringwald <email@hidden>
  • Prev by Date: Is Core Bluetooth compatible with Grand Central Dispatch?
  • Next by Date: iPhone 4S and BLE HID Keyboard
  • Previous by thread: Is Core Bluetooth compatible with Grand Central Dispatch?
  • Next by thread: Re: Using unsecure/unauthenticated RFCOMM
  • Index(es):
    • Date
    • Thread