iosbluetoothmfieaaccessory

EAAcessory MFi connection to issc datapath protocol- EASession fails to init


I have a bluetooth device which I can find in my accesories with the protocol "com.issc.datapath" and the name "Chatboard". (I use iOS 7.1)

I tried the ISSC BT Chatboard application which works fine with my bluetooth device, but I am not able to get a valid session. (And i can't find the source or an tutorial about this ISSC BT App)

In my code I setup the EAAccessoryController which returns the device mentioned above. Next I try to open the session as provided in the docs:

- (BOOL)openSession
{
    [_accessory setDelegate:self];
    _session = [[EASession alloc] initWithAccessory:_accessory forProtocol:_protocolString];

    if (_session)
    {
        [[_session inputStream] setDelegate:self];
        [[_session inputStream] scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
        [[_session inputStream] open];

        [[_session outputStream] setDelegate:self];
        [[_session outputStream] scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
        [[_session outputStream] open];
    }
    else
    {
        NSLog(@"creating session failed");
    }

    return (_session != nil);
}

I checked the Info.plist to make the entry for the Supported external accessory protocols, which is: com.issc.datapath

But the session creation fails...

Any hints, directions etc... pleaze!


Solution

  • Sorry for going quite. After a complete new install of this example provided on apple docs: https://developer.apple.com/library/ios/samplecode/EADemo/Introduction/Intro.html i had the chance to connect to the device.

    Issues I learned:

    1. Triple check your protocol string.
    2. Do not modify the sample code until the first successful run.
    3. Do not forget to enter the protocol string in the Info.plist with the key "Supported external accessory protocols" (and make sure it is the correct plist)
    4. Check your bundle identifier, when you want to start app when bt device connects. The bundle identifier has to be the same domain as the bt manufacturer.

    I hope this makes troubleshooters aware, because the answers were in the docu link provided above from apple.