Shivakumar
Shivakumar

Reputation: 477

Multiple App Support on external accessory using iOS external accessory protocol

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.?

Upvotes: 2

Views: 1134

Answers (2)

Joel Fischer
Joel Fischer

Reputation: 6597

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.

Upvotes: 2

atrebbi
atrebbi

Reputation: 553

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 )

Upvotes: 0

Related Questions