Developing Wireless CarPlay Systems

Session 717 WWDC 2017

Wireless CarPlay is perfect for any trip. Get in your car without taking your iPhone out of your bag or pocket, and start experiencing CarPlay effortlessly. Learn how to design your CarPlay system to connect wirelessly to iPhone. Understand hardware requirements, best practices for a great user experience, and how to optimize the pairing and reconnection process.

Hello, I'm Tanya Kancheva and I'm here to talk about wireless CarPlay.

wireless CarPlay is perfect for any trip, you can get in your car without taking your iPhone out of your bag or pocket and start experiencing CarPlay effortlessly.

The CarPlay experience is the same whether you are plugged in or using it wirelessly.

In this session, we will dive into the details on developing a wireless CarPlay system.

First, let's start by talking about the wireless CarPlay experience.

The first time you use wireless CarPlay you need to pair your iPhone to your car.

The simplest way to pair is by plugging in iPhone using a cable.

You can also pair without plugging in by using the car's UI to add a new device and by following the onscreen instructions.

Plugging in iPhone using a cable is the easiest and fastest way to pair for wireless CarPlay and all wireless CarPlay systems should support this feature.

When iPhone is plugged in CarPlay starts normally.

If the car supports wireless CarPlay the user will be presented with the following prompt on iPhone.

A simple tap on enable wireless CarPlay completes the pairing process.

Be sure to provide a meaningful display name as in this example, my car, so it's clear that iPhone will be associated with the car.

Once pairing is complete CarPlay starts automatically the next time you enter the car.

It's not necessary to require additional confirmation on the car's display because CarPlay is already running and the user has already chosen to use wireless CarPlay on iPhone.

As you can see, pairing by plugging in is simple and effortless.

The user can also pair without plugging in and by using the car's UI to add a new device and by following the onscreen instructions.

To begin, the pairing process needs to be started on both the car and on iPhone.

To make it easier CarPlay standardizes a long press on the Voice Control button to start the pairing process.

Normally this will start Siri, but if no phone is connected the car should immediately prepare for pairing.

You can also use menus and settings in the car's native UI to start the pairing process.

You may offer a CarPlay specific menu, a general Bluetooth menu or both.

In CarPlay settings on iPhone users are encouraged to press and hold the Voice Control button on the steering wheel to start the pairing process.

Once CarPlay setup is started on the car and iPhone select the discovered device to start the pairing process.

Apple recommends that you allow the user to select the car from iPhone.

In your native UI simply show your car's display name so the user knows what to look for.

If you do allow the user to initiate selection from the car you can show a list of discovered devices.

You can show a less specific to adding a CarPlay device or you can show a list of all discovered Bluetooth devices, including CarPlay devices.

If the user selects a device using a general Bluetooth menu and that device supports wireless CarPlay, you may decide to offer to enable CarPlay.

Do not show this screen if the user selected the device from a CarPlay specific menu.

Then CarPlay connects and CarPlay appears on the screen.

From here on the CarPlay experience is the same as plugging in until you leave the car.

Every time the user enters the car CarPlay reconnects automatically, iPhone can remain in your bag or pocket and no user interaction is necessary.

When CarPlay starts, be sure to observe the last user mode for audio in the display.

For details, watch the video Developing CarPlay Systems Part 1.

With wireless CarPlay it's easy to pair more than one iPhone with the car.

In addition, you may have one or many iPhones plugged in at the same time.

Provide a device selector in your native UI that lets the user choose the active CarPlay device.

Once CarPlay has started don't automatically switch to another device.

Changing the active CarPlay device should be an explicit user action.

If you support multiple Bluetooth devices and have a concept of favorite or frequently used devices use the same mechanism for wireless CarPlay.

Your device selector shows all CarPlay devices whether they are plugged in or paired for wireless CarPlay.

Indicate the active CarPlay device using the CarPlay logo.

Never indicate if CarPlay is running over wireless or wired.

The transfer type should be transparent to the user.

If you provide on off settings don't provide separate settings for wired and wireless CarPlay, just provide a setting for Bluetooth or iPod versus CarPlay.

Be judicious in showing notifications, only show notifications when it's important to let the users know.

Show a subtle notification when the first iPhone is connected only if CarPlay will not immediately become visible or the CarPlay [inaudible] icon is not immediately visible.

Show a notification when a second iPhone is connected over USB while CarPlay is running.

Do not show notifications when iPhone joins or leaves the access point or when it is reconnected over Bluetooth.

Now that we have seen how to use wireless CarPlay let's explore what it takes to develop such a system.

We'll start with the hardware requirements, go through setup and pairing, reconnecting for CarPlay, and finish with some considerations for your wireless architecture.

So, hardware requirements.

wireless CarPlay requires Bluetooth, a Wi-Fi access point and location data.

Bluetooth is used to discover and reconnect CarPlay devices.

To accomplish this the Bluetooth subsystem needs to implement the Bluetooth core specification, as well as support service discovery, iAP2 protocols and advertise CarPlay support in its Bluetooth Extended Inquiry Response.

The Wi-Fi link is used for all audio and video transfer to the CarPlay protocol, as well as iAP2 data transfer.

The access point must be certified by the Wi-Fi Alliance and it is recommended that it supports the 802.11ac standard and operates in the 5GHz frequency band.

In addition, the axis point needs to support the Apple Device Information Element and the Interworking Information Element.

The location has always been required for CarPlay, but it becomes an absolute necessity with wireless CarPlay as the driver's phone might be left in a pocket or a bag and be completely out of sight.

To provide reliable and precise location data, the head unit needs a GNSS receiver, access to the speed sensor of the vehicle, as well as the ability to provide dead reckoning position information.

Okay, now that we have talked through the basic hardware requirements let's talk about set up and pairing for CarPlay.

First, let's look at what components are needed to set up wireless and wired CarPlay.

Of course, one or many USB ports, a Wi-Fi access point, Bluetooth module, and an instance of the CarPlay communication plugin are required.

On ignition on or a head unit restart the components need to be initialized and set up.

USBs ready for role swap and NCM communication for wired CarPlay.

BT, Wi-Fi and networking for wireless CarPlay.

Bonjour and the communication plugin to enable CarPlay discovery.

When all those components are set up the system is ready for CarPlay connection.

As we saw earlier, there are two ways to pair iPhone to the car.

If iPhone is plugged in using a cable out-of-band pairing is triggered in the background.

Otherwise, a Bluetooth pairing process is needed.

Setup over USB requires less user interaction and is the recommended setup procedure.

Now let's dive into pairing over USB.

As you see in the diagram, we have the essential head unit components on the left-hand side and iPhone is displayed on the right.

At this point, the system is fully booted and ready for CarPlay.

The head unit is showing the native user interface as the user connects over USB.

A USB role switch follows and iPhone shows that CarPlay's connected.

With the role switch the unit also establishes an iAP2 link declaring support for all necessary messages.

While the CarPlay session is starting over USB iPhone asks the user to enable wireless CarPlay.

With that CarPlay over USB is already active.

So, iOS proceeds with setting up the audio and video streams to show CarPlay in the car.

Now the user decides to enable wireless CarPlay.

After user confirmation iOS generates a Bluetooth link key and sends it over iAP to the unit.

The head unit saves the link key together with the device transport identifiers and stores this iPhone as a Bluetooth paired device set up for CarPlay.

Once the device is saved the head unit sends back a confirmation and out-of-band pairing is complete.

Let's review.

Without out-of-band pairing the CarPlay session is established over USB and is not interrupted.

There is no actual exchange over BT during this process.

The device needs to be stored as the last connected BT device or preferred device so that it can be reconnected later on.

Hence, a wireless CarPlay session will start automatically only after an ignition cycle as the driver returns to the car.

It's important to note that you should not start wireless CarPlay when the driver disconnects from USB, she might be just leaving the car.

Now that we have seen the USB setup for wireless CarPlay let's take a look at the second method, pairing over Bluetooth.

There are a couple of ways to initiate Bluetooth pairing in a vehicle.

A long press on the Voice Recognition button on the steering wheel or through the native UI.

And with the native UI there are two options.

A dedicated UI for adding a CarPlay device or through the already existing UI for adding a BT device.

Over the next couple of slides, we will look into the differences between these pairing methods.

No matter which of the three pairing UIs was used by the driver to initiate pairing the head unit becomes discoverable.

The driver also needs to open either Bluetooth settings or CarPlay settings on iPhone to set iOS in a Bluetooth discoverable mode as well.

Again, this is a very generic representation of the fact that both the phone and the head unit must be set into a discoverable mode.

Now let's look at the different options on how to set up the head unit into a discoverable mode and how to select which device to pair to.

In this first variation, the head unit simply asks the user to search for the car's name on the CarPlay or BT settings menus on iPhone.

The user enters this menu by either navigating the native UI to add a new Bluetooth device or by long pressing on the Voice Recognition button on the steering wheel.

iPhone discovers the car and lists it.

The driver can then select the car on iPhone and iOS initiates a Bluetooth pairing request.

This is the simplest and most straightforward approach to accomplish Bluetooth pairing.

The second option is for the driver to select the device from a list of available Bluetooth devices on the car's native interface.

In this case, the head unit is not only discoverable, but also scans for BT devices.

Exactly as in the previous option, the driver enters this menu by either navigating the native UI to add a new Bluetooth device or by long pressing on the Voice Recognition button on the steering wheel.

Any BT capable device will be shown in this list, so the list might or might not include CarPlay devices.

That is why it is important to note that in this option any mention of Apple CarPlay on the UI is not recommended.

With this UI, the driver can select the device to pair to from the native UI or as before on the device.

The third option is very similar, however, this time the user is explicitly adding a new CarPlay device from the native user interface.

The list shows only devices that actually support wireless CarPlay.

The head unit must use the Apple CarPlay Bluetooth EIR to accomplish this filtering.

Again, as before, the driver selects either on the car's UI or on device.

After a device has been selected the head unit and iPhone complete Bluetooth secure simple pairing and connect IP over Bluetooth and the head unit identifies support for the required messages.

When iAP2 connects iOS will prompt the user to enable wireless CarPlay on device.

And just as a side note, but a very important one, connect additional BT profiles only if the wireless access point is operating in the 5GHz band.

Once iAP2 is connected iOS provides the device transport identifiers so that the head unit can store the device as a CarPlay device and recognize it over a different transport when it gets reconnected later on.

The head unit listens to wireless CarPlay update notifications and if CarPlay is enabled on device it may choose to confirm whether to proceed with setup for CarPlay.

As we saw earlier, this confirmation is only needed if the user selected the device through the add Bluetooth device menus.

As the user initiated pairing through Bluetooth settings on iPhone we see a similar confirmation on iPhone as well.

Of course, neither of those confirmation dialogs will be shown if the driver initiated pairing from CarPlay specific menus.

Next, let's assume the user confirms on the device first.

When that happens the device requests to receive the wireless credentials of the Wi-Fi access point.

The head unit must wait for the user confirmation before responding.

This is the time to get the user's consent and if needed, reconfigure the system for wireless CarPlay.

Now the user confirms on the native UI as well.

Then the head unit responds with the credentials and iPhone starts searching for the access point and joins it.

From now on, exactly ask for wired CarPlay.

Bonjour discovery runs and once the device is found the head unit initiates a CarPlay session through CarPlay Control API.

CarPlay session follows, as well as connection establishment for iAP2 over CarPlay.

Note that at this point iAP2 is also still connected over Bluetooth.

Then iPhone sends a disabled Bluetooth command and the head unit must disconnect all Bluetooth connections to this device.

Remember that if the access point is operating in the 2.4GHz band Bluetooth needs to be turned off while there's an active CarPlay session to avoid interference.

Now that the screen and video streams are started and the CarPlay UI is visible on the screen voila, CarPlay is running without any wires.

All right, now that we saw how to set up wireless CarPlay here's some general points to consider.

First, after setup is done the CarPlay UI is expected to show up.

Then if iPhone is playing music, music playback will be set up through CarPlay.

Lastly, the device must be stored as the last connected BT device so that it can be reconnected automatically later on.

And with that we can conclude the discussion around setup and pairing and move to actually look into how a CarPlay device is connected when the user returns to the car.

When you reconnect for CarPlay you need to take into account all devices connected to the system at the moment, as well as the state of the system before ignition was turned off.

Whether CarPlay is using USB as the transport or the wireless link it's completely transparent to the user and depends only on how a device is connected to the car and in which order the connections happened.

After deciding which device to connect to make sure the device still has CarPlay enabled.

Revert to using legacy technologies if CarPlay is no longer available.

Once the reconnection succeeds restore how the user used the system last time.

If she was listening to FM radio continue playing it.

Show the last screen the user was looking at either a native application or CarPlay.

The user experience should simply continue and follow the user's habit.

Lastly, once a CarPlay session is running on a device do not interrupt it.

Imagine the driver is listening to her favorite song or navigating and a friend plugs in to charge it will be disruptive if music all of a sudden resumed from the friend's phone.

Now let's review some scenarios to better understand what it means when we say the reconnection depends on the availability and the order of events.

In all these scenarios, we assume that the phone has been previously paired for wireless CarPlay and the system has at least one USB port.

We are going to pay attention to when iPhone was connected over USB, identify a common scenario, and observe which transport is used to establish a CarPlay session.

First, let's look at the scenario where there is just one iPhone in the car.

The simplest situation is that the user gets back into the car for a short drive and keeps iPhone in the pocket.

A morning commute running small errands would be the perfect examples.

As the only available transport is wireless naturally CarPlay runs wirelessly.

In the next scenario, the driver plugs in after the drive has started.

Typical usage here is just realizing that the phone needs to be charged after departing.

In this case, the session has already started over wireless and since we do not want any interruptions CarPlay remains over wireless.

In the next scenario, the user simply leaves the phone plugged in and gets out of the car.

This could be a stopover at the gas station or simply forgetting the phone in the car.

Now when the user returns the device is available to connect over both USB and wireless.

However, usually the USB stack resumes faster so CarPlay is reconnected over USB.

Now let's look at what happens if the driver plugs in right after entering the car.

This could be when leaving for a longer trip or maybe needing to charge right away.

In this case, as the system is coming up it will bring up both the USB and wireless stacks.

Since the timing will depend heavily on the user's behavior the CarPlay session will be started over the first available transport.

If USB is up while BT or Wi-Fi are still reconnecting the session will end up being over USB.

If wireless reconnected before USB then the session will run over wireless.

In the last scenario, we consider multiple devices in the car.

The driver might have plugged in right after entering the car.

This could be a road trip with friends that need to charge at some point or want to play music from their phones.

Again, as before, the session will initially start depending on the available transport.

Later on, the driver might decide to change the active CarPlay device using the native user interface.

All right, now let's see how you can implement all these scenarios.

We can start by looking at the flow for wireless reconnection.

First, wait until both Bluetooth and the access point are fully operational.

Then check that the last connected device is marked for CarPlay on the head unit.

If it is, make sure that there is no other active CarPlay session either with the same device or with another wired or wireless device.

If there is no other session proceed with connecting iAP2 over Bluetooth.

Once iAP2 Is connected wait to receive a notification that wireless CarPlay is enabled.

If it is wait for the device to be discovered and connect.

When the connect command is issued iPhone will check which interfaces are available and will initiate the session either over wireless or wired.

Moving on to USB the flow looks fairly similar.

You wait until the device gets connected, you check that there is no active session as we do not want to interrupt it.

If there is none check that CarPlay is enabled.

Then proceed with your role switch and selecting a device to connect.

At this point again, iPhone checks if both the wireless and wired link are available and picks one of the two to establish the session.

Then last user mode is restored and the driver is all set.

In the previous two slides, we saw how to automatically reconnect to the last used device.

But what happens if there are multiple CarPlay devices in the vehicle?

They might be connected just over USB, just paired for wireless or both paired for wireless and connected over USB.

One of those devices will get reconnected automatically, but as we mentioned before, the native UI lists all devices and lets the driver change the active CarPlay device.

When that happens, the head unit follows the same procedures to reconnect over the available transport.

Lastly, let's talk about reconnecting after a session disconnect.

CarPlay disconnection might occur for multiple reasons.

The head unit must be aware why the disconnection happened and determine if a reconnect is required.

Here are a couple of common scenarios and expected outcome.

In situations where the user unplugs from USB or manually disconnects from the native UI.

No reconnection is needed as there was an explicit user action to terminate the CarPlay session.

However, if the phone is no longer reachable for example, the user walks away, turns off Wi-Fi or anything similar, the head unit is expected to do a fast reconnect to the same device using CarPlay Control API.

If that fails then proceed with the Bluetooth reconnect to reestablish the CarPlay session.

With this we have explored all types of CarPlay connections.

Now let's go over some architectural considerations when designing a wireless CarPlay system.

When designing a wireless system, you want to optimize for performance.

That means that you have to decide which Wi-Fi protocol to support, what configuration to use and in which frequency band to operate.

Next, you need to think about what other wireless technologies will be used in the vehicle and potential interferences.

Services like Internet data or other in-car applications might also have an impact on the performance.

With all that in mind you need to assure that the wireless performance requirements for CarPlay are satisfied.

So, what do we recommend for wireless CarPlay?

First, we really recommend that your wireless access point operates in the 5GHz band.

It offers more channels to choose from, it's less prone to interference, and it is the least congested band.

Please do use 5GHz whenever possible.

Even though 2.4GHz is not recommended and is highly congested in some regulatory domains you might have to use it.

Then you need to be very aware of coexistent scenarios and you must disable the Bluetooth stack completely while there is an active CarPlay session.

If you offer LTE connectivity on Band 40 your choices of operating channels become even more limited.

Remember if you are designing a system which will operate in both bands you need to consider how the user experience will be impacted.

In 5GHz other Bluetooth devices may be paired and connected in parallel, whereas in 2.4GHz, adding or connecting a second Bluetooth device is not possible.

Some systems might choose to deploy multiple access points or dual band APs to offer a variety of in-car services and applications.

If these access points are operating in the same frequency band they need to use different channels to avoid interference.

If the access points use the same SSID and password they need to offer the same set of services to prevent inconsistent experience.

And lastly, using hidden networks is not recommended for CarPlay.

Finally, let's look at how to provide Internet data connectivity to iPhone.

The head unit communicates the state of the Internet connectivity dynamically through the Apple Device IE and through the Networking IE.

Notifications need to descend on changes.

For example, to state that the data communication module is available on the system or that there is a failure with that module or that the service contract has expired.

Temporary loss of connection due to poor cell coverage does not need to be communicated to iPhone.

For more information about this session check out the session website.

If you're interested in developing CarPlay apps check out the Enabling Your App for CarPlay session.

Also, refer to the videos from last year for basic information about CarPlay.

Apple, Inc. AAPL
1 Infinite Loop Cupertino CA 95014 US