2

We are developing an MFi external accessory on which we can launch iOS apps from iPhone using External Accessory Protocol.We are using Ford Smartdevicelink protocol to register the apps. We are using USB as the medium of communication between accessory and iPhone. Currently, we are able to launch one app on accessory. We would like to launch multiple apps simultaneously. But we are struck here. Please provide some inputs as to how we can accomplish this. A

The problem we are facing is, if one app is already launched in accessory and iPhone, if we launch another app in iPhone while previous app is in background, accessory receives "StopExternalAccessoryProtocolSession" for background app. Hence the background app becomes non functional and hence only one app is functional at a time. For the new app launched we receive "StartExternalAccessoryProtocolSession" and it becomes functional.

Also we are using one protocol identifier for all the apps. Should we use different protocols for all the apps for multiple app support? or If we can achieve this using single protocol identifier, Please provide inputs on how can we achieve this.?

Shivakumar
  • 427
  • 2
  • 15

2 Answers2

2

I'm a maintainer on SDL-iOS.

For SDL, the way we've gotten around it is by enabling up to 30 protocol strings to be used. The app will look for the com.smartdevicelink.prot0 stream and connect. It will receive a single byte of data 0x01 - 0x1E from the accessory of which data protocol to connect to.

This is a list of the SDL Protocol Strings.

EDITED to fix a mistaken statement.

Joel Fischer
  • 6,521
  • 5
  • 35
  • 46
  • On the app side we are enabling all the protocols you mentioned above. What needs to be done on accessory side? I am enabling all the protocols on accessory side too but still not able to launch multiple apps. – Shivakumar Feb 25 '16 at 14:14
  • Take a look at the sdl_ios project's SDLIAPTransport class. An app will try to connect to the control protocol com.smartdevicelink.prot0 first. It needs to receive a single byte of data telling it which data protocol to switch to (com.smartdevicelink.prot1 - 30). If you need more help, there is a slack linked from the github repositories. – Joel Fischer Feb 25 '16 at 15:48
0

The external accessory has a data flow that can only be read once. For a similar problem , i implemented a socket server that could send data read from accessory via tcp or udp , so I simply had a main app that spoke with external accessory and acted sa a proxy for other apps ( the app I'm talking about is NMEA Gps and lets other apps connect to an external Gps from dual electronics )

atrebbi
  • 553
  • 3
  • 20
  • The method you mentioned has been done for android. But iOS, we are not able to do. Did you implement the proxy app for iOS or android? – Shivakumar Dec 30 '15 at 04:04
  • iOS , the app is this : https://itunes.apple.com/it/app/nmea-gps/id590868529?mt=8 – atrebbi Feb 23 '16 at 16:23