xkn

Q: Midi Bluetooth connects and then disconnects immediately

This is a really confusing problem that I'm having a hard time troubleshooting.

 

I'm developing an app that uses the Apple-provided `CABTMIDILocalPeripheralViewController` to establish a Bluetooth connection between my iPhone (6s, iOS 10.0.1 14A403) and my MacBook Air (11" mid-2013, OS X 10.11.6).

 

The app works fine for advertising Bluetooth, and in the Audio Midi Setup app, the "Connect" Action button enables as shown in the docs.  The problem is, that when I click on "Connect", it waits a little bit, then displays the "Disconnect" text for a brief flash (less than a second, but unclear exactly how long), before displaying the "Connect" text again.

 

Basically, it looks like the connection is established, and then dropped immediately after it's established.

 

I'm about 99% certain that this isn't an issue with the app development, since I can connect via Bluetooth using the exact same process with my Mac Mini (whose OS version I don't have handy right now, but is 10.11.x) without any issues, and I can connect the iPhone to an iPad over Bluetooth using the same mechanism in the app.  It seems to be an issue specific to this computer.

 

The text in Console doesn't seem to indicate anything about the disconnection either:

 

10/4/16 11:40:22.273 PM Audio MIDI Setup[1818]: Connecting to peripheral with UUID 4E29D1FE-1710-4DA6-86A5-E4D449418FAD ...

10/4/16 11:40:22.446 PM blued[92]: Device Connected with address: cc-20-e8-ac-78-8b and classOfDevice 0x7a020c and connectionHandle 0x0040

10/4/16 11:40:22.594 PM Audio MIDI Setup[1818]: Checking pairing status...

10/4/16 11:40:22.625 PM Audio MIDI Setup[1818]: Pairing authentication successful.

10/4/16 11:40:22.626 PM Audio MIDI Setup[1818]: Instructing the driver to connect to peripheral with UUID 4E29D1FE-1710-4DA6-86A5-E4D449418FAD

 

So... what's happening here?  How can I fix this?

MacBook Air, OS X El Capitan (10.11.6)

Posted on Oct 4, 2016 2:44 PM