This is driving me nuts...I had it working fine before and have no idea what has changed. I'm connecting to a proprietary company device over bluetooth, it has the auth chip and (as I said) everything was fine before.
My iPad and the accessory both show that they are connected to each other. Yet when I try to talk to the device within my app, most of the time EAAccessoryManager doesn't even find it...but once in a while I can connect. What gives?
-(void)scanForDevice
{
NSArray *accList = [[EAAccessoryManager sharedAccessoryManager] connectedAccessories];
// This is ZERO every time...even though iPad and device both indicate connection.
DLog(@"accList count: %i", accList.count);
for (EAAccessory *accessory in accList)
{
for (NSString* protocolString in accessory.protocolStrings) {
if ([protocolString isEqualToString:[redacted]]) {
[self connectToAccessory:accessory];
break;
}
}
}
}
ETA: I have since wired up a button to call the showBluetoothAccessoryPicker... method to show a Bluetooth picker within the app. This resulted in even more confusion. The accessory that the iPad is telling me I'm already connected to (in settings) shows up in the picker. When I click it, console output is as follows:
2014-04-01 16:48:00.324 Subview[3438:60b] BTM: attempting to connect to service 0x00000080 on device [redacted] 00:07:80:73:06:01
2014-04-01 16:48:02.497 Subview[3438:60b] BTM: connection to service 0x00000080 on device [redacted] 00:07:80:73:06:01 succeeded
2014-04-01 16:48:11.924 Subview[3438:60b] BTM: lost device [redacted] 00:07:80:73:06:01
2014-04-01 16:48:12.500 Subview[3438:60b] BTM: setting pairing disabled
2014-04-01 16:48:12.501 Subview[3438:60b] BTM: disabling device scanning
2014-04-01 16:48:12.509 Subview[3438:60b] <0x157d10770 JobListViewController.m:(255)> BTPicker failed with error: The operation couldn’t be completed. (EABluetoothAccessoryPickerErrorDomain error 1.)
That error code shows up in the docs as "Not found". Hmm...so the connection succeeds, then it's immediately lost, then it's not found, even though according to settings I was connected the entire time? I am a loss to explain any of this. Would greatly appreciate any help with someone who is experienced in this framework. I am almost completely convinced that it's either a problem with the framework, with the accessory itself, or some combination thereof.
Settings.app
? Did you try forget it there and redo the pairing? – Pumice