2

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!

wassx
  • 333
  • 3
  • 18

1 Answers1

1

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.

wassx
  • 333
  • 3
  • 18
  • hey Pal, what do you mean by bundle identifier has to the same as bt manufacturer, Are you talking about the apple seed id ? or the com.company.appname ? – Rahul Raj Dec 09 '14 at 17:33
  • @Stefan, I am also facing same problem, can you tell me bundle identifier of app and bluetooth manufacturer are same ?. Because i don't know bluetooth manufacturer and i know only protocol string. Can you explain thanks in advance. – Hari c Aug 17 '17 at 11:28