0

I am having some difficulties getting ExternalAccessory running for my ipod...

I have a bluecove bluetooth listener running on my computer (mac, Mountain Lion) in java (Code for that here: http://pastebin.com/j6Eu0H66), and I have successfully paired my ipod with my computer. However, when I have my ipod list out:

[[EAAccessoryManager sharedAccessoryManager] connectedAccessories];

I get nothing but crickets. I am assuming this is because I did not set any valid accessories in my info.plist -- but the problem is, I have no idea what I should enter!

Does anyone have any ideas on why I can't find my computer via the EAAccessoryManager and does anyone have any idea what classifies as a valid protocol? I can find no documentation on what to actually write as a protocol.

P.S. As an earlier part of this project, I was trying to pair my computer with my NXT via lejos, however I ran into this problem:

https://groups.google.com/forum/?fromgroups=#!topic/bluecove-users/7jWv1V1GC-4

As a result, I used the hack posted a couple comments after the first, and replaced my Mountain Lion IOBluetooth.framework with a Lion IOBluetooth.framework. I am not sure if that has a huge impact on the iOS side of things, but I figured I should let you guys know.

P.S.S. The code I am using to print out the list of accessories: Note that it does not return anything yet, nor does it use protocolString yet.

I get the "Testing123" log, but not the "Device!" log

- (EASession *)openSessionForProtocol:(NSString *)protocolString
{


    NSLog(@"Testing123");
    NSArray *accessories = [[EAAccessoryManager sharedAccessoryManager]
                            connectedAccessories];
    EAAccessory *accessory = nil;
    EASession *session = nil;




    for (EAAccessory *obj in accessories)
    {
        NSLog(@"Device!");
        /*
        if ([[obj protocolStrings] containsObject:protocolString])
        {
            accessory = obj;
            break;
        }
         */
    }

    return NULL;
}

Also, here is a screenshot of my info.Plist:

enter image description here

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Georges Oates Larsen
  • 6,812
  • 12
  • 51
  • 67
  • 2
    The External Accessory framework only works with accessories that are MFi-compliant, not generic paired Bluetooth accessories. I doubt you'll be able to connect your Mac and iOS device using this framework. – Brad Larson Oct 31 '12 at 19:40
  • Hello! In that case, what should I use to connect my iOS device and Mac laptop? – Georges Oates Larsen Oct 31 '12 at 19:41
  • Is WiFi an option? If so, Bonjour makes for easy device discovery. If your iOS device and Mac support Bluetooth LE, you can use Core Bluetooth to communicate between them. – Brad Larson Oct 31 '12 at 20:00
  • I am a super noob here, so please forgive me as I ask some blatant questions: WiFi is not an option unless I can use it without a router -- is it possible to connect two wifi devices to each other directly without going through a router? On the flipside, Bluetooth LE sounds interesting, but I have no idea how to tell if my iPod Touch supports it, much less if my computer does. Do you know how I can tell? – Georges Oates Larsen Oct 31 '12 at 20:22
  • The 5th generation iPod touch supports Bluetooth LE, but none of the older models do. The iPhone 4S and iPhone 5 also support this. Every new Mac since the July 2011 MacBook Air (with the exception of the Mac Pro) should support LE. On WiFi, the only direct connection I've seen was where the iOS device acted as a tethering proxy: https://github.com/tcurdt/iProxy/wiki , but it can be done. – Brad Larson Oct 31 '12 at 20:34
  • Thankyou for the link! It seems that neither of my devices support bluetooth LE then :( – Georges Oates Larsen Oct 31 '12 at 23:23

1 Answers1

0

I don't know what is your goal connecting your iPod to your computer, but if you are just trying to change some information between iOS and your computer Bonjour is an easy and very interesting way to do this job. Using bonjour you have some advantages like connecting to a Windows PC or even an Android device.

If you have/want to use bluetooth, it will be a difficult work because iOS ExternalAccessory framework only works with accessories that are MFi-compliant, like @Brad Larson said. Bluetooth LE is an option, if your pc supports it and so your iPod, but BLE protocol was made to support only few amount of data transfer, and you will have to strip your data in little chunks to send and receive them between the devices, pair and remember paired devices by yourself, etc but its an answer to another question ...

Unfortunately, in your case, I don't think bluethoot is a good choice, but in the other hand, you must give a look at Bonjour, that is easy to use too.

Hope it helps anyway.

FormigaNinja
  • 1,571
  • 1
  • 24
  • 36