MFi Accessory Interface Specification For Apple Devices R2
MFi Accessory Interface Specification For Apple Devices R2
MFi Accessory Interface Specification For Apple Devices R2
Contents
1. Introduction 21
1.1 Purpose of This Document 21
1.2 Requirements, Recommendations, and Permissions 21
1.3 Applicability 22
1.4 Terminology 22
1.4.1 Accessory and Device 22
1.4.2 Authentication Coprocessor 22
1.4.3 I2C Bus 23
1.4.4 Challenge 23
1.4.5 Challenge Response 23
1.4.6 X.509 Certificate 23
1.4.7 Component 23
1.4.8 Feature 23
1.4.9 USB Device and Host Mode 24
1.4.10 IAP 24
1.4.11 Direct User Action 24
Contents
4. Accessory Authentication 49
4.1 Accessory Authentication Requirements 49
4.2 Accessory Authentication Usage 49
4.3 Accessory Authentication Examples 51
4.3.1 Typical Accessory Authentication 51
4.3.2 Accessory Authentication Failure Due To Invalid Certificate 52
4.3.3 Accessory Authentication Failure Due To Invalid Response 52
5. Accessory Identification 53
5.1 Accessory Identification Requirements 53
5.2 Accessory Identification Usage 53
Contents
6. App Launch 58
6.1 App Launch Requirements 58
6.2 App Launch Usage 59
7. AssistiveTouch 60
7.1 AssistiveTouch Requirements 60
7.2 AssistiveTouch Usage 61
9. Device Authentication 64
9.1 Device Authentication Requirements 64
9.2 Device Authentication Usage 64
Contents
Contents
Contents
Contents
Contents
Contents
10
Contents
11
Contents
12
6. App Launch 58
Figure 6-1
7. AssistiveTouch 60
Figure 7-1
AssistiveTouch Pointer 60
13
Table 11-2
USB Interface Descriptor (Alternate Setting 0 - Zero Bandwidth) for External Accessory Native
Transport (USB Host Mode) 72
14
Table 19-3
Table 19-4
Table 19-5
Table 19-6
USB D+/D- resistor values for self-powered accessory connectors that do not implement iAP2
120
Maximum allowable Low Power Mode current draw 123
USB Events that permit Intermittent High Power Mode 124
USB Events that exit Intermittent High Power Mode 124
USB Vendor Request for Apple Device to Host Mode Switch 125
15
Figure 25-5
Figure 25-6
Figure 25-7
Figure 25-8
Table 25-1
Table 25-2
Table 25-3
Table 25-4
Table 25-5
Table 25-6
Table 25-7
Table 25-8
Table 25-9
Table 25-10
Table 25-11
Table 25-12
16
Table 26-22
Table 26-23
Table 26-24
Table 26-25
Table 26-26
Table 26-27
Table 26-28
Table 26-29
Table 26-30
Table 26-31
Table 26-32
Table 26-33
Table 26-34
Table 26-35
Table 26-36
Table 26-37
Table 26-38
Table 26-39
Table 26-40
Table 26-41
Table 26-42
Table 26-43
Table 26-44
Table 26-45
Table 26-46
Table 26-47
Table 26-48
Table 26-49
Table 26-50
Table 26-51
Table 26-52
Table 26-53
Table 26-54
Table 26-55
Table 26-56
Table 26-57
Table 26-58
Table 26-59
Table 26-60
17
Table 26-61
Table 26-62
Table 26-63
Table 26-64
Table 26-65
Table 26-66
Table 26-67
Table 26-68
Table 26-69
Table 26-70
Table 26-71
Table 26-72
Table 26-73
Table 26-74
Table 26-75
Table 26-76
Table 26-77
Table 26-78
Table 26-79
Table 26-80
Table 26-81
Table 26-82
Table 26-83
Table 26-84
Table 26-85
Table 26-86
Table 26-87
Table 26-88
Table 26-89
Table 26-90
Table 26-91
Table 26-92
Table 26-93
Table 26-94
Table 26-95
Table 26-96
Table 26-97
Table 26-98
Table 26-99
18
Table 26-100
Table 26-101
Table 26-102
Table 26-103
Table 26-104
Table 26-105
Table 26-106
Table 27-14
Table 27-15
19
Table 27-16
20
1. Introduction
should or recommended means the full implications must be understood before choosing a different
course.
should not or not recommended means the full implications must be understood before choosing this
course.
may or optional means the statement is truly optional, and its presence or absence cannot be assumed.
The absence of requirements, recommendations, or permissions for a specific accessory design in this
specification must not be interpreted as implied approval of that design. Developers are strongly encouraged
to ask Apple for feedback on accessory designs that are not explicitly mentioned in this specification.
21
1. Introduction
1.3 Applicability
1.3 Applicability
This document covers the accessory interface exposed by Apple devices that have the Lightning connector.
At time of release, this includes the following Apple devices:
iPhone 5
iPad mini
For Apple devices that have the 30-pin connector, see the following documents:
Any conflicts between the Accessory Interface Specification and MFi Accessory Specifications must be resolved
in favor of the Accessory Interface Specification .
1.4 Terminology
1.4.1 Accessory and Device
Throughout this document, the term device is used to refer to an Apple iPod, iPhone, or iPad. Similarly, the
term accessory is used to refer to any product intended to interface with a device via the means described in
this document.
22
1. Introduction
1.4 Terminology
1.4.4 Challenge
A random number sent from an Apple device to an accessory, or vice versa. The device/accessory being
challenged must perform a 1.4.5 Challenge Response (page 23) computation on the offered challenge and
return the resulting 1.4.5 Challenge Response (page 23) to the challenging device for verification.
1.4.7 Component
An accessory is defined as a collection of functional units called components . Examples of a component include,
but are not limited to, the following:
Data transport
Power source
1.4.8 Feature
All accessories must support one or more accessory interface features . Each feature may have associated
accessory design requirements and recommendations; an accessory must comply with all feature-specific
requirements to properly support the feature. Some features require other features to be implemented.
23
1. Introduction
1.4 Terminology
Accessory design must take into account the possibility that an Apple device may not support all of the
accessory's implemented features and react appropriately.
1.4.10 IAP
There are two iAP protocols - iAP1 and iAP2 . iAP1 is the iPod Accessory Protocol as specified in MFi Accessory
Firmware Specification R46 . iAP2 is a complete replacement for iAP1 and is not backward compatible; it is
documented in this specification.
An iAP2 connection is composed of an iAP2 transport , iAP2 link , and one or more iAP2 sessions .
24
The requirements in this section apply to all accessories regardless of their feature sets.
2.2 IAP1
iAP1 is not recommended for new accessories. Its development is being placed into a maintenance mode.
Accessories that connect to Apple devices with the Lightning connector and support only iAP1 must send the
iAP1 StartIDPS command once every 5 seconds until the Apple device responds.
2.3 IAP2
iAP2 is recommended for new accessories.
Accessories may support both iAP1 and iAP2. This specification documents how an accessory may detect
whether the connected Apple device supports iAP2 in 24.7.2 Initialization (page 150). If the Apple device does
not support iAP2, the accessory may fall back to iAP1.
If an accessory implements support for both iAP1 and iAP2, it must always use only iAP2 when connected to
an Apple device that supports iAP2.
The iPod nano (7th generation) does not support iAP2; accessories wishing to claim compatibility with it must
implement support for iAP1.
25
26
If an accessory is capable of streaming audio to or from an Apple device via more than one audio transport
connection, it must shut down the active audio transport connection before starting the next one. The presence
or absence of audio on an audio transport connection has no bearing on the connection state. Shutdown and
startup actions for each audio transport connection are specified in the following table:
Table 2-1
Startup Action
Shutdown Action
26.13.1
StartUSBDeviceModeAudio (page
216)
26.13.3
StopUSBDeviceModeAudio (page
217)
USB attach
USB detach
Bluetooth A2DP
Bluetooth connect
Bluetooth disconnect
27
Startup Action
Shutdown Action
Headphone Jack
Jack insertion
Jack removal
If an accessory is capable of establishing a Bluetooth A2DP audio transport connection along with any other
audio transport connection to an Apple device, the accessory must satisfy all requirements stated in 8. Bluetooth
Pairing and Connection Status (page 62).
28
2.18 Cases
Accessories that substantially enclose Apple devices must must not be integrated with keyboards and must
comply with the guidelines stated in the latest version of Apple's Case Design Guidelines for Apple Devices .
When incorporating that document in this specification, substitute must for should throughout.
The Case Design Guidelines document can be found at https://developer.apple.com/resources/cases/, along
with dimensional drawings of Apple devices.
Reduction of the iPhone's RF/antenna efficiency. Accessories should minimize decreases in the iPhone's
total radiated power (TRP). This can be quantified by measuring TRP across all of the iPhone's operating
bands and some frequencies. For accessory testing and certification requirements, see Measuring TRP in
MFi Accessory Testing Specification .
Desense of the iPhone's RF reception. Accessories should minimize decreases in the iPhone's effective
isotropic sensitivity (EIS). This can be quantified by measuring EIS across all of the iPhone's operating
bands. For accessory testing and certification requirements, see Measuring EIS in MFi Accessory Testing
Specification .
29
The RF testing configuration must be freestanding, as shown in RF Certification Setup in MFi Accessory
Testing Specification .
In addition to the other iPhone configuration requirements for RF testing, described in RF Certification
Setup in MFi Accessory Testing Specification , the iPhone display must be switched off.
Total radiated power (TRP) of the iPhone while connected to the accessory must be tested and certified,
as described in Measuring TRP in MFi Accessory Testing Specification , with no AC power applied to the
accessory.
The antenna sensitivity (EIS) of the iPhone while connected to the accessory must be tested and certified,
as described in Measuring EIS in MFi Accessory Testing Specification , with AC power to the accessory tuned
on.
30
Accessories may incorporate a Lightning connector to establish mechanical and electrical connections with
an Apple device and enable other accessory interface features.
This chapter covers the Lightning connector. See MFi Accessory Hardware Specification R9 for details of the
30-pin.
24.4 mm
6.00 mm
6.65 mm
31
3.1.3 Reversability
The Lightning connector engages with Apple devices in either orientation. Accessories do not need to manage
this capability. The connector pad configuration always remains constant from the accessory's point of view,
because the connector automatically routes power and data to and from the accessory appropriately after
determining its insertion orientation.
32
Lightning (C10)
Lightning (C11)
Only the mechanical housings differ. All references to the Lightning connector in this chapter are applicable
to both versions unless explicitly specified otherwise.
Accessory developers must take the following recommendations and requirements into consideration when
deciding which version to use for a particular accessory design:
33
Figure 3-2
Lightning (C10)
Side A
Side B
Figure 3-3
Lightning (C11)
Side A
Side B
34
Figure 3-4
35
Figure 3-5
36
Connector pads
1
2
3
4
Side A
5
Side B
All connector configurations that exchange data with the Apple device offer accessories the ability to provide
power to, and draw power from, the Apple device via the Device Power and Accessory Power pads respectively.
Accessories that do not draw power from the Apple device may leave the Accessory Power pad unconnected
(NC). This may ease accessory assembly operations.
Accessories must use Lightning (C10D) or Lightning (C11D) if there is no potential for data communication
with the Apple device. Conversely, if there is potential for data communication to occur, such as when the
accessory is a USB Type A to Lightning connector charge/sync cable and might be plugged into both an Apple
device and a PC or Mac, Lightning (C10D) or Lightning (C11D) must not be used.
37
Table 3-1
Pad
Configuration A:
USB Host Mode
Configuration B:
USB Device Mode
Configuration C:
Serial
Configuration D:
Power Only
Ground 1
Ground 1
Ground 1
Ground 1
USB D-
USB D-
Accessory Serial TX
USB D-
USB D+
USB D+
Device Serial TX
USB D+
Device Power
Device Power
Device Power
Device Power
Accessory Power
Accessory Power
Accessory Power
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Not Connected
Ground 2
Ground 2
Ground 2
Ground 2
The Lightning connector must not be subjected to any process, such as a reflow process, that heats it
outside of the soldering area to a temperature above 80 degrees C for more than 30 minutes. Recommended
processes include soldering, hot-bar reflow, and over-molding.
The accessory should not mount or hold on to the Lightning connector's PCB.
38
Any process performed on the Lightning connector must not cause any buildup of material on its exposed
plug surfaces.
Figure 3-7
Soldering area
Do not mount
Additionally, all accessory integrations of a Lightning (C11) connector must make physical contact with the
connector in the area labeled 'MIN MOUNTING AREA' as shown in Figure 3-5 (page 36).
Figure 3-8 (page 39) illustrates the following requirements related to plug engagement:
At least 6.47 mm of the connector plug must be exposed. 6.65 mm +0.10 mm/-0.18 mm is recommended.
When a force of 30 N is applied to the plug in the direction of device insertion, the exposed connector
plug length must not decrease below 6.47 mm. The plug is designed to exert a force of 15 N during device
insertion.
The connector plug must not break away from the accessory when a force of 30 N or less is applied on
the plug in the direction of device extraction.
The connector must not be mounted in such a way that the connector plug is biased more than 2 degrees
sideways.
Figure 3-8
Angular bias
Plug exposure
Insertion/extraction force
Angular bias
39
All Lightning connector faces besides the cosmetic plug faces must be hidden within the accessory such that
the faces are not visible, as shown in Figure 3-9 (page 40).
Figure 3-9
Exposed
Accessory surface
Plug surfaces
To be compatible with cases, the Lightning connector enclosure dimensions (see Figure 3-10 (page 40)) must
not exceed:
40
(A) 20 mm
(B) 15 mm
(C) 6.85 mm
A jet dispense process is recommended for applying encapsulation. Some recommended vendors of
encapsulation equipment are:
Nordson/EFD/Axxon
Asymptek
Musashi Engineering
41
Solder
B
C
The following recommendations related to EMC apply to all cable accessories, using Figure 3-11 (page 42) as
a visual reference:
The cable (C) should have both braid and foil shield. The braid should have a minimum of 95% coverage.
Shield braid (B) should make 360 degree termination to the plug housing (A). Copper tape is recommended
for this purpose. The termination should include mechanically secured crimp and soldering. 'Pigtail'-type
connections should not be used.
Connection from plug (D) to plug housing should make a 360 degree termination.
42
All dongle accessories must break or bend before the user can apply a 100 N force 10 mm away from the
bottom of the device as illustrated in Figure 3-12 (page 43).
Figure 3-12
10 mm
4 M1.6 screws should be used to secure the Lightning (C11) connector to the dock accessory.
2 M1.6 screws are used in the bottom holes of the Lightning (C11) connector and locating posts are fed
through the top holes. Apple recommends that the size and tolerance of the locating posts is 1.68 0.05
mm.
The tip of the Lightning (C11) plug is made with a conductive material. Apple recommends that a continuity
tester be designed and used during the accessory manufacturing process to assure that the minimum exposed
plug length meets the requirement of 6.47 mm.
43
The accessory must have a backstop that contacts the iPhone or iPod touch at a point at least 15 mm vertically
from the bottom of the device when a force of 5 N is applied perpendicular to the screen of the device at a
point 100 mm vertically from the bottom of the device. The iPhone or iPod touch will rotate approximately 2
degrees from its rest position relative to the backstop when this force is applied. A typical backstop is shown
in Figure 3-13 (page 44).
Figure 3-13
5N
15 mm
The accessory must have a flexible mechanism that allows a user to rotate the iPhone or iPod touch from the
rest position to at least 15 degrees from vertical. This mechanism must prevent the user from applying 10 N
perpendicular to the iPhone or iPod touch at a distance 100 mm from the bottom of the device before the
device reaches the compliant limit.
Figure 3-14
< 10 N
Flexible
mechanism
100 mm
44
The accessory should have at least 20 mm of contact with the device on either side of the connector, measured
from the center of the plug, when the device is in the rest position.
Figure 3-15
Accessory
40 mm total minimum
Centerline
of plug
The Lightning connector is designed to disconnect if biased more than 4 degrees sideways.
Figure 3-16
Max 4
Accessory
The accessory should not block any iPhone or iPod touch speakers or microphones. See 2.18 Cases (page
29) for a pointer to dimensional drawings of iPhone and iPod touch that call out locations of speakers and
microphone.
45
The accessory must have a backstop that contacts the iPad at a point at least 50 mm vertically from the bottom
of the device when a force of 2.5 N is applied perpendicular to the screen of the device at a point 200 mm
vertically from the bottom of the device.
The accessory should maintain at least 50 mm of contact with the iPad on either side of the connector, measured
from the center of the plug when the device is in its rest position.
The accessory and its backstop should not block any speakers or microphones.
The accessory must have a flexible mechanism that allows a user to rotate the iPad from its rest position to at
least 15 degrees from vertical. This mechanism must prevent the user from applying more than 5 N force
perpendicular to the iPad at a distance of 200 mm from the bottom of the device before the device reaches
the compliant limit.
This flexibility requirement is illustrated in Figure 3-17 (page 46). Drawings 1 and 2 show the iPad being
engaged with the connector plug. Drawing 3 shows the device responding to a force of 5 N or less, applied
200 mm above the bottom of the device, by rotating up to 15 degrees from its vertical position.
Figure 3-17
<5N
15
Flexible
mechanism
200 mm
46
The accessory must have a backstop that contacts the iPod nano at a point at least 15 mm vertically from the
bottom of the device when a force of 10 N is applied perpendicular to the screen of the device at a point 50
mm vertically from the bottom of the device.
The accessory should maintain at least 20 mm of contact with the iPod nano on either side of the connector,
measured from the center of the plug, when the device is in its rest position.
The accessory and its backstop should not block any speakers or microphones.
The accessory must have a flexible mechanism that allows a user to rotate the iPod nano from its rest position
to at least 15 degrees from vertical by only applying a load to the device. This mechanism must prevent the
user from applying more than 20 N force perpendicular to the iPhone or iPod touch at a distance of 50 mm
from the bottom of the device before the device reaches the compliant limit.
This flexibility requirement is illustrated in Figure 3-18 (page 47). Drawings 1 and 2 show the iPod nano being
engaged with the dock connector plug. Drawing 3 shows the device responding to a force of 20 N or less,
applied 50 mm above the bottom of the device, by rotating up to 15 degrees from its vertical position.
Figure 3-18
Flexible
mechanism
50 mm
47
Ground 2 must be connected to the accessory's system ground if the accessory draws power from the
Apple device, but may be left unconnected (NC) otherwise.
USB Host or Device Mode accessories must connect a drain wire to Ground 1.
The Lightning connector shield must not be used as the only ground path.
48
4. Accessory Authentication
Accessory authentication provides a mechanism for Apple devices to trust the identities and feature sets of
accessories that are compliant with this specification.
It is also possible for an accessory to require the Apple device to authenticate itself to the accessory. For more
details, see 9. Device Authentication (page 64).
IAP2 linkIAP2
All accessories that support the Accessory Authentication feature must send or receive the following iAP2
control session messages:
26.1.1 RequestAuthenticationCertificate (page 182)
26.1.2 AuthenticationCertificate (page 182)
26.1.3 RequestAuthenticationChallengeResponse (page 182)
26.1.4 AuthenticationResponse (page 183)
26.1.5 AuthenticationFailed (page 183)
49
4. Accessory Authentication
4.2 Accessory Authentication Usage
coprocessor and transmit it to the Apple device using an 26.1.2 AuthenticationCertificate (page 182) message.
The certificate must be sent within 1 second of receiving the 26.1.1 RequestAuthenticationCertificate (page
182).
If the certificate is valid, the Apple device will respond with a 26.1.3
RequestAuthenticationChallengeResponse (page 182) message. The accessory then must use the Apple
authentication coprocessor to compute a response to the authentication challenge and send an 26.1.4
AuthenticationResponse (page 183) message with the response. This response must be sent within 2 seconds
of receiving the 26.1.3 RequestAuthenticationChallengeResponse (page 182) message.
If the authentication response is correct, then the Apple device will send an 26.1.6
AuthenticationSucceeded (page 183) message. The accessory must immediately proceed to 5. Accessory
Identification (page 53).
To demonstrate correct handling of the 26.1.5 AuthenticationFailed (page 183) message during self-certification,
accessories must send an empty or invalid certificate when the Apple Authentication Coprocessor is not present.
50
4. Accessory Authentication
4.3 Accessory Authentication Examples
Device
Coprocessor
Accessory Authentication
RequestAuthenticationCertificate
AuthenticationCertificate
RequestAuthenticationChallengeResponse
<Challenge Data>
Read Status
Status:
PROC_RESULTS
AuthenticationResponse
<Challenge Response Data>
AuthenticationSucceeded
51
4. Accessory Authentication
4.3 Accessory Authentication Examples
Device
Control Session
Accessory Authentication
RequestAuthenticationCertificate
AuthenticationCertificate
AuthenticationFailed
Device
Control Session
Accessory Authentication
RequestAuthenticationCertificate
AuthenticationCertificate
RequestAuthenticationChallengeResponse
AuthenticationResponse
AuthenticationFailed
52
5. Accessory Identification
All accessory interface features other than charging require that the identification feature be supported.
53
5. Accessory Identification
5.2 Accessory Identification Usage
Otherwise, a 26.2.4 IdentificationRejected (page 190) message is sent detailing which invalid parameters and
unsupported messages were present in the previous 26.2.2 IdentificationInformation (page 184) message.
Note that it is possible for the list of unsupported messages to be empty; that is an indication of incorrect
accessory implementation, rather than unsupported features on a specific device.
Accessory Test System (ATS) output and iOS device console logs (see 'Getting Crash Logs and Console Output'
at http://developer.apple.com/library/ios/#qa/qa1747/ will also provide additional supporting information
which is useful for accessory development. Apple strongly recommends that accessory developers pay close
attention to both ATS and the device logs.
If the identification information has been rejected, the accessory must send another 26.2.2
IdentificationInformation (page 184) message with different parameters or abort the identification process
using 26.2.5 CancelIdentification (page 192). Cancellation of the identification process will cause the Apple
device to inform the user that the accessory is not supported.
Failure of the accessory to send 26.2.2 IdentificationInformation (page 184) within 1 second of either 26.2.1
StartIdentification (page 184) or 26.2.4 IdentificationRejected (page 190) is grounds for failing to pass self
certification.
Once 26.2.3 IdentificationAccepted (page 190) is received, the accessory must not send any more identification
messages other than 26.2.6 IdentificationInformationUpdate (page 192).
It is possible for an accessory to update its identification information after 26.2.3 IdentificationAccepted (page
190) by sending an 26.2.6 IdentificationInformationUpdate (page 192) message. For example, the user may
change the accessory's active language. When that occurs, the accessory must send an 26.2.6
IdentificationInformationUpdate (page 192) message containing both the new active language and accessory
information strings in the new language.
If the identification process fails or the accessory cancels identification, the Apple device may choose to restart
the identification process or terminate the iAP2 link.
54
5. Accessory Identification
5.2 Accessory Identification Usage
55
5. Accessory Identification
5.3 Accessory Identification Examples
Device
Control Session
Accessory Identification
StartIdentification
IdentificationInformation
IdentificationAccepted
Device
Control Session
Accessory Identification
StartIdentification
IdentificationInformation
IdentificationRejected
IdentificationInformation
IdentificationAccepted
56
5. Accessory Identification
5.3 Accessory Identification Examples
Device
Control Session
Accessory Identification
StartIdentification
IdentificationInformation
IdentificationRejected
IdentificationInformation
IdentificationRejected
CancelIdentification
Device
Control Session
Accessory Identification
StartIdentification
IdentificationInformation
IdentificationAccepted
IdentificationInformationUpdate
57
6. App Launch
An accessory that supports the App Launch feature can request that an iOS device launch an app on its behalf.
Figure 6-1
58
6. App Launch
6.2 App Launch Usage
59
7. AssistiveTouch
The AssistiveTouch feature lets users generate iOS Multi-Touch gestures using one finger, a stylus, or a compatible
accessory. Accessory developers should consider supporting AssistiveTouch if the accessory is intended for
use by users with special needs who can see the display and manipulate more complex input peripherals, such
as joysticks, touchpads, or multiple switches.
When an AssistiveTouch-compatible accessory connects to an Apple device and the feature is enabled, an
accessory-controlled virtual cursor is displayed. All AssistiveTouch interaction then proceeds as if the user's
own fingers were being used to interact with the device.
Figure 7-1
AssistiveTouch Pointer
60
7. AssistiveTouch
7.2 AssistiveTouch Usage
All accessories that support the AssistiveTouch feature must send or receive the following iAP2 control session
messages:
26.4.1 StartAssistiveTouch (page 193)
26.4.2 StopAssistiveTouch (page 193)
26.4.3 StartAssistiveTouchInformation (page 194)
26.4.4 AssistiveTouchInformation (page 194)
26.4.5 StopAssistiveTouchInformation (page 194)
61
Accessories can automate the Bluetooth pairing process between an Apple device and any number of integrated
Bluetooth accessory components if they also have a wired connection to the Apple device.
Additionally, some Apple devices can report changes in the Bluetooth connection status for an accessory's
Bluetooth components. These notifications can be useful when the accessory wishes to determine whether it
is connected to a particular iOS device via both Bluetooth and a Lightning connector. Accessories must
implement this feature if they can maintain audio transport connections over both Bluetooth A2DP and other
transports (see 2.11 Multiple Audio Connections (page 27)).
62
63
9. Device Authentication
The Device Authentication feature is used to verify the authenticity and/or identity of an Apple device. This
may be used for the following purposes:
Ensuring that an accessory is only used with one particular Apple device or set of Apple devices.
Accessories must not collect or store information about individual users for access control purposes. Instead,
access control to an accessory must be managed on a per-device basis.
64
Apple strongly recommends the use of digital audio paths to and from accessories. USB Host Mode audio is
the recommended approach; the USB Device Mode audio feature is being placed into a maintenance mode.
When an Apple device is in USB Host Mode, it can interact with accessories that are compliant with either the
USB Audio 1.0 or 2.0 specification. Version 2.0 is recommended, even for USB Full Speed accessories. USB High
Speed accessories must not implement the USB Audio 1.0 specification.
When an Apple device is in USB Device mode, it can appear as a USB Audio 1.0 device for the purpose of
streaming audio to the accessory. The audio stream contains stereo PCM data and is synchronized using USB
1 ms Start-Of-Frame (SOF) packets. USB Device Mode audio does not support streaming audio from an accessory
to the device.
If the input and output endpoints are both asynchronous, both endpoints must use the same clock source
(i.e. be sample locked) and use implicit feedback.
The maximum packet size descriptor must comply with requirements for USB Audio packet sizes per
Section 2.3.1.1 of the USB Audio Data Formats 2.0 specification. Packets must never vary by more than 1
sample frame per packet.
The maximum packet size for each endpoint must comply with the calculation method specified by
Technical Note TN2274 in the Mac Developer Library online documentation.
When streaming, accessories must always observe the bandwidth restrictions for the current sample rate
and format settings.
Volume Control Feature Units must use a Status Interrupt Pipe, per Section 3.7.1.2 of the USB Audio 1.0
specification or Section 6 of the USB Audio 2.0 specification.
65
A USB Host mode accessory that wants to give iOS access to its volume control capabilities must implement
either a USB Master Volume Control Feature Unit and/or USB Individual Volume Control Feature Units on
all the relevant streaming audio endpoints. If iOS wants to set the accessory's overall input/output volume
and no master control exists, it will aggregate the individual controls and set them in tandem.
The following USB features are recommended for accessories implementing USB Host Mode Audio, but are
not required:
Apple devices running iOS 5.0 or later support more than two channels of audio input in USB Host Mode.
Accessories that use this feature must bundle all audio input channels into a single audio streaming
interface.
Apple devices running iOS 6.0 or later support more than two channels of audio output in USB Host Mode.
Accessories that use this feature must bundle all audio output channels into a single audio streaming
interface.
Developers should test their accessory designs against the latest OS X Audio driver; the application Audio
MIDI Setup, in the OS X Applications/Utilities folder, can be used to verify accessory compatibility.
Developers should make use of the USB Prober application, available with Xcode, to inspect and verify
the contents of USB descriptors.
When receiving USB Device mode audio over a USB streaming interface, the accessory may buffer data to
achieve consistent audio playback. Since buffering introduces latency, it is recommended that this latency be
kept below 200 ms to ensure timely response to user input, such as a play/pause button.
66
All accessories that support the USB Device Mode Audio feature must send or receive the following iAP2 control
session messages:
26.13.1 StartUSBDeviceModeAudio (page 216)
26.13.2 USBDeviceModeAudioInformation (page 217)
26.13.3 StopUSBDeviceModeAudio (page 217)
67
Accessory
Device
Control Session
...
IdentificationInformation
...
USBTransportComponent:
<TransportComponentIdentifier> 0
<TransportComponentName> Dock Connector
TransportSupportsiAP2Connection
<USBDeviceSupportedAudioSampleRate>
32kHz (6)
44.1kHz (7)
48kHz (8)
...
iAP2HIDComponent:
<HIDComponentIdentifier> 0
<HIDComponentName> Front Panel
<HIDComponentFunction> Media Playback Remote (1)
...
IdentificationAccepted
StartHID:
...
<HIDReportDescriptor>
...
StartUSBDeviceModeAudio
USBDeviceModeAudioInformation:
<SampleRate> 32kHz (6)
<VolumeAdjustment> 0dB
<SoundCheckAdjustment> 0dB
68
The iOS External Accessory framework provides accessories with the means to communicate with one or more
iOS apps via one or more External Accessory (EA) sessions. These sessions present a simple read/write bytestream
interface; it is up to the accessory developer to specify a custom protocol between the app and the accessory.
The design and maintenance of communication protocols between accessories and applications are entirely
the responsibility of the developers of these products. Apple makes no attempt to secure protocol name space
or provide for communication security between accessories and applications.
All accessories may implement this feature by defining and implementing an iAP2 External Accessory session.
Additionally, accessories with a USB Host Mode transport component may choose to implement an External
Accessory native transport. A native transport will generally provide higher performance than the iAP2 session.
Apple does not guarantee reliable delivery and/or a minimum level of transfer speed for External Accessory
sessions or native transports.
69
iOS devices attempt to match apps and accessories by using information provided by the accessory during
identification. An app will be deemed compatible with an accessory if the app supports at least one of the
accessory's declared protocols. Additionally, accessories may specify a preferred or default app during
identification; the iOS device will prompt the user to download that app if it is not currently installed on the
device and there are no other compatible apps installed.
Figure 11-1
Protocol names must be in reverse-DNS format and must be associated with domains that are registered
with the Internet Corporation for Assigned Names and Numbers (ICANN), so that Apple can rely on each
protocol having a unique owner. Apple does not require a developer to be the owner of the domain name
used, but does require that the developer have permission to use the domain name for the protocol.
Protocol names used for demonstration or example purposes in accessory reference designs must not be
used in shipping accessories.
70
Accessories must choose a match action (MatchAction (Table 26-11 (page 187))) for each supported protocol.
Apple recommends that developers use 1 unless the protocol in question is meant for infrequently accessed
accessory features, such as firmware updates or diagnostics.
71
Table 11-1
USB Interface Interface Descriptor (Alternate Setting 1 - Active Session) for External Accessory Native
Transport (USB Host Mode)
USB Descriptor
Value
Comments
Interface Number
0xNN
Interface Class
0xFF
Vendor-specific interface
Interface SubClass
0xF0
MFi Accessory
Interface Protocol
0x01
Interface String
com.company.protocol
Number of Endpoints
Alternate Setting
Table 11-2
USB Interface Descriptor (Alternate Setting 0 - Zero Bandwidth) for External Accessory Native Transport
(USB Host Mode)
USB Descriptor
Value
Comments
Interface Number
0xNN
Interface Class
0xFF
Vendor-specific interface
Interface SubClass
0xF0
MFi Accessory
Interface Protocol
0x01
Interface String
com.company.protocol
Number of Endpoints
Alternate Setting
72
73
Device
Link
Session Type:
SYN[200] ACK[100]
ACK[200]
Control Session
iAP2 EA Session
...
...
IdentificationInformation
...
MessagesReceivedFromDevice:
<StartExternalAccessoryProtocolSession> 0xEA00
<StopExternalAccessoryProtocolSession> 0xEA01
SupportedExternalAccessoryProtocols:
<ExternalAccessoryProtocolIdentifier> 0
<ExternalAccessoryProtocolName> com.company.accessory
<ExternalAccessoryProtocolMatchAction> 1
...
IdentificationAccepted
StartExternalAccessoryProtocolSession
<ExternalAccessoryProtocolIdentifier> 0
<ExternalAccessoryProtocolSessionIdentifier> 0
Link
...
Control Session
iAP2 EA Session
StopExternalAccessoryProtocolSession
<ExternalAccessoryProtocolSessionIdentifier> 0
74
Device
USB
Enumeration
Control Session
...
IdentificationInformation
...
SupportedExternalAccessoryProtocols:
<ExternalAccessoryProtocolIdentifier> 0
<ExternalAccessoryProtocolName> com.accessory.protocolname
<ExternalAccessoryProtocolMatchAction> 1
<NativeTransportComponentIdentifier> 0
...
USBHostTransportComponent:
<TransportComponentIdentifier> 0
<TransportComponentName> Dock Connector
TransportSupportsiAP2Connection
...
IdentificationAccepted
USB
...
...
USB
75
Each Apple device contains a standard stereo headphone jack, but the headphone jack on some models may
also be used as a microphone input, with or without a control button.
The following figure is an example of circuitry in a headphone/microphone accessory.
Figure 12-1
Accessory
Apple device
Left channel
Headphones
Microphone
FET impedance
converter
10 pF
R1
33 pF
VAR1
shield case
Table 12-1
2.7 V
Right channel
L01
SW
4
4-pin
3.5mm plug
L02
Output
C1
R2
Ground
Component
Value
C1
1 F
R1
2.21 k 1%
R2
L01/L02
SW
Action Button
VAR1
12 V varistor
76
Note: The value given for L01 and L02 is typical. These ferrite chokes reduce time division multiple
access (TDMA) noise; their exact values depend on the specific accessory design.
Switch SW shorts the microphone signal to ground. The Apple device treats its closure as a headset button
press and initiates a context-specific action (for example, answering a phone call). The microphone bias current
must be between 210 and 500 A, measured into a circuit pulled up to 2.7 V through 2.21 k, to ensure button
press detection. The recommended microphone sensitivity is 44 dBV with a maximum impedance of 2.2 k
at the output of the equivalent circuit shown above, measured under test conditions of Vs = 2.0 V, RL = 2.2
k, Ta = 20 C, and relative humidity = 65%.
Any accessory headphone/microphone receptacle that can accept the Apple Earphones with Remote and Mic,
and is electrically connected to the audio jack on an Apple device, must support full functionality of the Apple
Earphones with Remote and Mic.
Every accessory cable and connector that can be inserted into an Apple device's audio jack must meet the
following requirements.
Figure 12-2
Plug length
14.00 0.10 mm
All flanges on connector
must be non-conductive
Pin 1
Pin 4
Pin 3
Pin 2
Other dimensions of the Apple device's audio jack conform to the JEITA standard RC 5325A, "4-Pole Miniature
Concentric Plugs and Jacks." The following table lists its pin assignments.
Table 12-2
Pin
Description
77
Pin
Description
Signal Return
Microphone Input
78
Apple devices can receive button press information from accessory headsets that incorporate the headphone
remote and mic system feature via the audio jack.
Remote button detection requires a transmitter chip, provided by Apple, that communicates over the accessory's
microphone bias line. When implemented with a MEMS microphone as specified in this document, the
transmitter chip currently supports three remote buttons in the accessory: volume up, volume down, and
push-to-talk.
79
Table 13-1
Part Number
Usage
MFI353S2429
MFI353S2430
Number
Name
I/O
Description
A1
TONE
Output
A2
GND
Power
Audio return
B1
MIC
Input
Microphone bias
B2
REM
Input/Output
C1
VSHUNT
Input
C2
MICPWR
Output
Microphone power
80
Figure 13-1
e1
C
B
g1
A
1
Ball A1
index area
Bottom View
z C
Seating plane
H1
Table 13-3
Dimension
Value in mm
0.95/0.85
1.45/1.35
0.50 max
H1
0.19/0.15
0.50
e1
0.25
1.00
g1
0.50
0.25/0.21
0.015
81
6X
y M C A B
Dimension
Value in mm
0.05
Symbol
Description
Minimum
Maximum
VSUPPLY
0.5 V
4.6 V
VI
0.5 V
4.6 V
V0
0.5 V
4.6 V
IIK
20 mA
I0K
20 mA
ISUPPLY, IGND
50 mA
50 mA
82
Button mode, VMICBIAS = 1.8 to 2.1 V; MIC is connected to VMICBIAS through a 2.21 k 1% resistor.
Tone mode, VMICBIAS = 2.56 to 2.84 V; MIC is connected to VMICBIAS through a 2.21 k 1% resistor.
Symbol
Parameter
Test Conditions
IMICBIAS-B
Quiescent Current
into MIC+VSHUNT
IMICBIAS-B
Minimum
Typical
Maximum
Button Mode,
VMICBIAS = 2.1 V
3 A
6 A
Quiescent Current
into MIC+VSHUNT
Button Mode,
VMICBIAS = 1.5 V
3 A
6 A
IMIC-T
Quiescent Current
into MIC
Tone Mode
34 A
46 A
IVSHUNT-T
Quiescent Current
into VSHUNT
60 A
70 A
IMIC-TA
Tone Mode
35 A
45 A
IVSHUNT-TA
104 A
118 A
VTR
Tone Mode
Threshold Voltage
MIC Rising
(Microphone
enable), VMICPWR =
2.20 V
2.35 V
2.50 V
0.55 V
0.8 V
1V
1.0 V
VTF
Tone Mode
Threshold Voltage
MIC Falling
(Microphone
disable), VMICPWR =
400 mV
83
Symbol
Parameter
Test Conditions
Minimum
Typical
Maximum
VMICPWR
MICPWR Output
Voltage
IMICPWR = 120--150
1.51 V
1.56 V
1.61 V
RSO
Shunt Regulator
Output Impedance
Freq = 100 Hz
18
25
RSO
Shunt Regulator
Output Impedance
Freq = 20 Hz
12
21
35
RONA
Switch A, RDSON
40
55
22
30.5
= 1 mA, VMICBIAS =
2.56V
RONB
Switch B, RDSON
Note: This current is pulled through RVSHUNT between MIC and VSHUNT and is the minimum current
to keep VSHUNT regulated at 1.56 V. Excess current through RVSHUNT is available to the load at
MICPWR. Excess current not used by the load at MICPWR is internally shunted to GND.
Table 13-6
Symbol
Parameter
Test Conditions
en-mic100
100 Hz to 20
kHz
fTONE1
Button 1 Frequency
RREM = 6.81 k
fTONE2
Button 2 Frequency
RREM = 9.42 k
fREL
Typical
Maximum
1.5 Vrms
2 Vrms
109 kHz
130 kHz
159 kHz
138 kHz
165 kHz
200 kHz
Button Release
Frequency
81 kHz
97 kHz
117 kHz
RBT1
Button 1 Boundary
6.61 k
6.81 k
7.01 k
RBT2
Button 2 Boundary
9.33 k
9.42 k
9.51 k
VTA
Tone Amplitude
350 mV
550 mV
720 mV
RTONE = 1 M
Minimum
84
Symbol
Parameter
Test Conditions
Minimum
Typical
Maximum
VTA
Tone Amplitude
RTONE = 100 k
300 mV
515 mV
710 mV
Table 13-7
Symbol
Parameter
Test Conditions
Minimum
Typical
Maximum
tONA
Switch A Enable
Time
0.8 ms
1.2 ms
2 ms
tOFFB
Switch B Disable
Time
0.7 ms
1 ms
2 ms
tREG
Shunt regulator
enable time
1 ms
2.5 ms
3.5 ms
Provide a tone generator for sending discrete frequency tones on the bias line corresponding to button
events.
The controller in the Apple device provides regulated downstream power (nominally 2.7 or 2.0 V) to the
transmitter chip and microphone through the microphone bias line. Figure 13-2 (page 86) illustrates the
functional components of the transmitter chip. In this diagram, a latch drives the configuration of switches A
and B. The power-on reset monitors voltage on the MIC pin to ensure that there is a enough power before
initiating the turn-on sequence; it shuts the chip down if there is insufficient voltage.
85
Figure 13-2
MICPWR
1.56V
MIC
Latch
2.3V
Power-on
Reset
REM
Switch B
TONE
Tone
Generator
Impedance
Detector
GND
Button events are sent from the transmitter to the controller in one of two modes, button mode or tone mode.
When a microphone is not present or is not in use, the transmitter is put in button mode by the controller in
the Apple device, and button events are detected using discrete voltage levels. These discrete voltage levels
are a percentage of a regulated output voltage on the microphone bias line. When a microphone is in use, the
controller puts the transmitter into tone mode by placing more than 2.35 V on the microphone bias line, and
the transmitter then sends button events using tone sequences of discrete frequencies in the range 99 kHz to
300 kHz.
Switch Closed
Voltage
S0
0.000 V 1%
S1
1.510 V 1%
86
Switch Closed
Voltage
S2
1.603 V 1%
When the transmitter chip is in button mode (VMIC has never reached 2.35 V), it shorts the MIC and REM pins
together and disables all other inputs and outputs. When a button event occurs, the DC voltage on the
microphone bias line changes. Table 13-8 (page 86) shows the DC voltage corresponding to a given button
press when using the R1 and R4 resistor values listed in Table 13-9 (page 93). This DC level is then detected
by the controller in the Apple device. Switch S0 is a unique switch that shorts the VMIC line to ground.
When the VMIC line is shorted to ground, power is removed from the transmitter chip. When power recovers,
the transmitter chip enters button mode or tone mode, depending on the voltage detected at the MIC pin.
87
The transmitter chip's startup timing when it enters tone mode is shown in Figure 13-3 (page 88). Values for
the timing parameters are given in Table 13-6 (page 84).
Figure 13-3
VMIC
0V
2.5V
VREM
0V
2.5V
VMICPWR
0V
2.5V
VSHUNT
0V
2.5V
VTONE
0V
t OFFB
tCAL
tONA
tACK
tREG
TM2T
Upon detecting VMIC > 2.35 V, the switch connecting the MIC and REM pins together is opened after time
tOFFB (see Figure 13-3 (page 88) and Table 13-6 (page 84)).
2.
After a delay of tREG after VMIC > 2.35 V, the SHUNT pin and the MICPWR pins are shorted. The microphone
is enabled by turning on the FET switch through the MICPWR pin.
3.
Once the noise prevention process has settled, the transmitter chip sends a preset acknowledge (ACK)
tone sequence.
88
4.
The controller detects the ACK sequence (see Figure 13-4 (page 89)) and authenticates the presence of
the transmitter chip.
Figure 13-4
2.5V
VMIC
tCAL
0V
tACK
tCAL = Calibration Tone (typically 1ms)
tACK = ACK Tone (typically 6ms)
The tone generation circuit of the transmitter chip internally detects each button press and sends a high
frequency tone sequence between 99 kHz and 300 kHz. The high frequency tone sequence is unique to each
button. The controller detects the frequency of each tone and translates it into a predetermined button event.
A button release has a different frequency than a button press.
89
For accuracy, the transmitter chip sends two tones for each button press as shown in Figure 13-5 (page 90).
The first tone, lasting 1 ms, is a calibration frequency and the second, lasting 2 ms, is the unique frequency for
the selected button. The ratio of these two frequencies is calculated and translated into button press information.
This provides a very accurate result that is independent of clock frequency variation.
Figure 13-5
De-bounced TX
button press or
TX power-up
1ms
Calibration
frequency
2ms
Button or TX ACK
selected frequency
1.67ms
2.89 ms
4ms
Continue TX ACK selected frequency
(TX power-up only)
DETECT
Tone
RX Tone
pulses
tCAL
tCAL
Tone pulse
counter
Count Tone
pulses to
set tCAL
Count n
Tone pulses
over tCAL
Tone frequency
decoded here
from n value
INT output
The transmitter chip remains in tone mode until the MIC pin is pulled below 0.8 V. When power recovers, the
transmitter chip enters button mode or tone mode depending on the voltage detected at the MIC pin.
90
The circuits in the accessory that support these components must be those shown in Figure 13-6 (page 92)
and Figure 13-7 (page 93). The nominal values of the components shown in these schematics are given in
Table 13-9 (page 93).
These circuits are designed to produce a tone amplitude between the microphone bias line and the microphone
return, at the end of a cable 1 meter long, of at least 30 mV peak-to-peak into a 2000-ohm load. If necessary,
the value of R3 must be adjusted to achieve this result. Figure 13-7 (page 93) shows how a voltage on the
Microphone Power line from the transmitter chip enables the MEMS microphone chip through Q1. It also shows
components R7, C4, and R8, which control the microphone's frequency response. The equation that determines
the values of these components is given in 13.2.1 Button Detection Circuitry Adjustments (page 94).
Figure 13-6 (page 92) and Figure 13-7 (page 93) are two parts of one circuit. The two Microphone Return lines
shown in these sub-circuits must be connected at the component locations. Their common return line and
the return lines for each of the two earbud speakers must then be routed separately through the cable that
goes to the Apple device, being tied together only at the headphone connector. This configuration is required
to minimize crosstalk between the separate earbud channels and the microphone.
91
Note: With the exception of the MEMS digital microphone listed in Figure 13-7 (page 93), symbol
U2, components of equal or better specifications may be substituted for the components called out
below.
Figure 13-6
Transmitter Circuit
MIC
VSHUNT
TONE
B1
R6
Microphone Bias
R2
C2
C1
R3
C1
A1
U1
MICPWR
REM
C2
B2
Microphone Power
R1
R4
D1
GND
A2
S1
S2
S0
Microphone Return
92
Figure 13-7
Microphone Circuit
Microphone Bias
1
VDD
MICOUT
U2
C4
R7
R8
GND
2, 3
Microphone Power
Q1
1 G
R5
Microphone Return
Table 13-9
Symbol
Description
Notes
C1
C2
C4
D1
Q1
CEDM 7001
R1
R2
R3
R4
R5
R6
Ceramic
93
Symbol
Description
Notes
R7
R8
Resistor
S0
Dome switch
S1
Dome switch
S2
Dome switch
U1
Provided by Apple
U2
Resistor (R8)
Knowles SPQ2409HE5H-PB
Knowles SPY0824LR5H-B
Goertek S15OB383-002
The values of some of the components listed in Table 13-9 (page 93) may be adjusted to optimize the
performance of the headphone accessory, using these formulas:
High-pass filter corner frequency in Hertz 1/(2 R8 C4 ) , where R8 is the value of resistor R8 in ohms
and C4 is the value of capacitor C4 in Farads. This formula assumes that the value of R7 is greater than the
value of R8.
System sensitivity at 1 Pascal in Volts = (M0 / R8 ) R2 , where M0 is the microphone sensitivity in Volts per
Pascal, R8 is the value of resistor R8 in ohms, and R2 is the value of resistor R2 in ohms in parallel with 1.05
k.
94
Note: If the microphone bias voltage drops below 1.6 V, the transmitter chip will begin to fail and
the microphone chip may produce indeterminate outputs.
95
Some Apple devices can accept input from Human Interface Device (HID) accessories, such as external keyboards,
and also send HID reports to those accessories. This capability is then made available system-wide for all apps
on the device or certain features built into the device system software. If an accessory is designed to provide
human input events to a specific third-party app, it should consider implementing the External Accessory
Protocol feature instead.
The HID feature can be implemented both over an iAP2 control session and over native transports that support
HID classes or profiles, such as USB Host. Implementing HID over native transports may make sense when using
off the shelf chipsets with built-in support for HID, but HID over the iAP2 control session is recommended
when transport independence and/or Apple device-powered operation is desired (because HID over iAP2 can
use the Serial transport). Also, multiple HID descriptors can be registered from one accessory over one iAP2
control session and the Apple device will route HID reports from each HID device appropriately.
The accessory must identify at least one iAP2HIDComponent (Table 26-17 (page 189)) or
USBHostHIDComponent (Table 26-18 (page 189)).
The accessory must be capable of generating and receiving all HID usages declared in the component's
HID descriptor.
Additionally, accessories that support the HID feature must not anticipate or assume corresponding state
changes by the Apple device after sending HID usages. For further explanation, see 2.7 Presentation of Apple
Device Updates (page 26).
96
Usage ID
Usage Name
Apple Function
0x0030
Power
Lock
0x0040
Menu
Home
0x00B5
Transport Right
0x00B6
Transport Left
0x00CD
Play/Pause
Play/Pause
0x00E2
Mute
Mute
0x00E9
Volume Increment
Louder
0x00EA
Volume Decrement
Softer
0x01AE
AL Keyboard Layout
97
Usage ID
Usage Name
Apple Function
0x01B1
AL Screen Saver
Picture Frame
0x0221
AC Search
Spotlight
See 'Appendix E.6: Report Descriptor(Keyboard)' in Device Class Definition for Human Interface Devices 1.11
(available from the USB-IF) for a sample HID descriptor.
Keyboards may integrate an LED to indicate the status of Caps Lock. Apple devices do not support any other
keyboard status LEDs.
HID Consumer Page controls for use by media playback remote components
Usage ID
Usage Name
Apple Function
0x00B0
Play
Play
0x00B1
Pause
Pause
0x00B5
Transport Right
0x00B6
Transport Left
0x00B9
Random Play
Shuffle
0x00BC
Repeat
Repeat
0x00BE
Tracking Normal
98
Usage ID
Usage Name
Apple Function
0x00CA
Tracking Increment
0x00CB
Tracking Decrement
0x00CD
Play/Pause
Play/Pause
0x00E2
Mute
Mute
0x00E9
Volume Increment
Louder
0x00EA
Volume Decrement
Softer
All x and y movements must be reported in increments of 1, proportionally scaled to the physical movement
of the user. If the accessory is a joystick, for example, then a small movement of the joystick must report
a movement delta of 1, but a large movement of the joystick must report a larger movement delta.
The accessory must send repeated HID pointer movement reports at a constant rate appropriate for the
accessory. The accessory must not perform its own scaling of the report rate; the AssistiveTouch feature
uses its own speed scaler setting for this purpose. If no movement has taken place, the accessory must
send a movement report of 0 in both x and y directions.
The accessory must generate HID reports for two buttons, one for a touch event and the other for a
contextual menu trigger. Both button down and button up reports must be sent individually and must
match actual user actions on the accessory. When the user presses on the first button, a button1 'down'
report must be sent, and button1 events must not be sent until the user releases the button, after which
a button1 'up' report must be sent.
The accessory must start sending HID reports to the Apple device as soon as the Apple device sends a
notification to the accessory indicating that the AssistiveTouch cursor has been enabled.
The accessory must cease sending HID reports to the Apple device as soon as the Apple device sends a
notification to the accessory indicating that the AssistiveTouch cursor has been disabled.
The accessory must be capable of interleaving pointer movement reports with button up and down reports.
The accessory must let the user hold a button down and move the pointer at the same time.
99
See Appendix E.10: Report Descriptor(Mouse) in Device Class Definition for Human Interface Devices 1.11
(available from the USB-IF) for a sample HID descriptor.
05 01
USAGE (Keyboard)
09 06
COLLECTION (Application)
A1 01
USAGE_PAGE (LEDs)
05 08
LOGICAL_MINIMUM (0)
15 00
LOGICAL_MAXIMUM (1)
25 01
09 02
REPORT_SIZE (1)
75 01
REPORT_COUNT (1)
95 01
100
OUTPUT (Data,Var,Abs)
91 02
REPORT_SIZE (7)
75 07
REPORT_COUNT (1)
95 01
OUTPUT (Cnst,Var,Abs)
91 03
USAGE_PAGE (Keyboard)
05 07
19 E0
29 E7
REPORT_SIZE (1)
75 01
REPORT_COUNT (8)
95 08
INPUT (Data,Var,Abs)
81 02
LOGICAL_MINIMUM (0)
15 00
LOGICAL_MAXIMUM (255)
25 FF
USAGE_MINIMUM (0)
19 00
USAGE_MAXIMUM (255)
29 FF
REPORT_SIZE (8)
75 08
REPORT_COUNT (5)
95 05
INPUT (Data,Ary,Abs)
81 00
05 0C
LOGICAL_MINIMUM (0)
15 00
LOGICAL_MAXIMUM (1)
25 01
USAGE (Menu)
09 40
0A 21 02
0A B1 01
0A AE 01
09 B6
USAGE (Play/Pause)
09 CD
09 B5
USAGE (Mute)
09 E2
09 EA
09 E9
USAGE (Power)
09 30
REPORT_SIZE (1)
75 01
REPORT_COUNT (11)
95 0B
INPUT (Data,Var,Abs)
81 02
REPORT_SIZE (5)
75 05
101
REPORT_COUNT (1)
95 01
INPUT (Cnst,Var,Abs)
81 03
END_COLLECTION
C0
Device
Control Session
Keyboard Example
...
...
IdentificationInformation
...
USBTransportComponent:
<TransportComponentIdentifier> 0
<TransportComponentName> Lightning Connector
TransportSupportsiAP2Connection
...
iAP2HIDComponent:
<HIDComponentIdentifier> 0
<HIDComponentName> USB Keyboard
<HIDComponentFunction> Keyboard (0)
...
IdentificationAccepted
StartHID
<HIDComponentIdentifier> 0
<VendorIdentifier> 05ac
<ProductIdentifier> 0000
<HIDReportDescriptor> (See example Descriptor)
AccessoryHIDReport
<HIDComponentIdentifier> 0
<HIDReport> 00 00 00 00 00 00 20 00 (Play/Pause button pressed)
AccessoryHIDReport
<HIDComponentIdentifier> 0
<HIDReport> 00 00 00 00 00 00 00 00 (No buttons pressed)
StopHID
<HIDComponentIdentifier> 0
102
09 01
COLLECTION (Application)
A1 01
LOGICAL_MINIMUM (0)
15 00
LOGICAL_MAXIMUM (1)
25 01
REPORT_SIZE (1)
75 01
REPORT_COUNT (5)
95 06
USAGE (Play/Pause)
09 CD
09 B5
09 E9
09 EA
INPUT (Data,Var,Abs)
81 02
REPORT_SIZE (3)
75 03
REPORT_COUNT (1)
95 01
INPUT (Cnst,Var,Abs)
81 03
END_COLLECTION
C0
103
Device
Control Session
...
IdentificationInformation
...
USBTransportComponent:
<TransportComponentIdentifier> 0
<TransportComponentName> Lightning Connector
TransportSupportsiAP2Connection
...
iAP2HIDComponent:
<HIDComponentIdentifier> 0
<HIDComponentName> Steering Wheel Media Playback Remote
<HIDComponentFunction> Media Playback Remote (1)
...
IdentificationAccepted
StartHID
<HIDComponentIdentifier> 0
<VendorIdentifier> 05ac
<ProductIdentifier> 0000
<HIDReportDescriptor> (See example Descriptor)
AccessoryHIDReport
<HIDComponentIdentifier> 0
<HIDReport> 0x01 (Play/Pause button pressed)
AccessoryHIDReport
<HIDComponentIdentifier> 0
<HIDReport> 0x00 (No buttons pressed)
StopHID
<HIDComponentIdentifier> 0
05 01
USAGE (Joystick)
09 04
104
COLLECTION (Application)
A1 01
LOGICAL_MINIMUM (0)
15 00
LOGICAL_MAXIMUM (255)
26 FF 00
PHYSICAL_MINIMUM (0)
35 00
PHYSICAL_MAXIMUM (255)
46 FF 00
REPORT_SIZE (8)
75 08
REPORT_COUNT (2)
95 02
USAGE (X)
09 30
USAGE (Y)
09 31
INPUT (Data,Var,Abs)
81 02
LOGICAL_MAXIMUM (1)
25 01
PHYSICAL_MAXIMUM (1)
45 01
REPORT_SIZE (1)
75 01
REPORT_COUNT (3)
95 03
USAGE_PAGE (Button)
05 09
USAGE_MINIMUM (Button 1)
19 01
USAGE_MAXIMUM (Button 3)
29 03
INPUT (Data,Var,Abs)
81 02
REPORT_SIZE (1)
75 01
REPORT_COUNT (5)
95 05
INPUT (Cnst,Ary,Abs)
81 01
END_COLLECTION
C0
105
Device
Control Session
AssistiveTouch Example
...
...
IdentificationInformation
...
USBTransportComponent:
<TransportComponentIdentifier> 0
<TransportComponentName> Lightning Connector
TransportSupportsiAP2Connection
...
iAP2HIDComponent:
<HIDComponentIdentifier> 0
<HIDComponentName> AssistiveTouch Joystick
<HIDComponentFunction> AssistiveTouch Pointer (2)
...
IdentificationAccepted
StartHID
<HIDComponentIdentifier> 0
<VendorIdentifier> 05ac
<ProductIdentifier> 0000
<HIDReportDescriptor> (See example Descriptor)
AccessoryHIDReport
<HIDComponentIdentifier> 0
<HIDReport> 04 FF FF (Button 3 pressed, Pointer top/right)
AccessoryHIDReport
<HIDComponentIdentifier> 0
<HIDReport> 00 00 00 (No buttons pressed)
StopHID
<HIDComponentIdentifier> 0
106
The location feature provides compatible accessories with a means to provide external Global Positioning
System (GPS) information in the form of National Marine Electronics Association (NMEA) sentences to Apple
devices. Apple devices that support this feature can take advantage of this additional information to augment
their built-in location services. For example, some external Location-enabled accessories can provide more
accurate or more frequent position updates. Additionally, Apple devices can conserve power by using location
information from an external accessory instead of on-board positioning technologies.
107
The media library feature allows accessories to download the metadata contents of an Apple device's media
library (not the media items themselves) and request playback of media items. The feature is divided into three
subfeatures: information, updates, and playback. Media library information informs the accessory about available
media libraries on the device. Media library updates provide an accessory with an updated view of the contents
of a particular media library. Media library playback allows the accessory to request playback of one or more
items from the media library.
Accessories that use this feature must have sufficient computational and storage resources to store and
continuously update their mirror of the Apple device's media library. Accessories may choose not to receive
certain types of media item metadata, like album artwork, to minimize storage and computational requirements.
If an accessory runs out of storage capacity while receiving media library updates it must not use this feature
until sufficient storage capacity has been freed to resume receiving media library updates.
108
Additionally, the accessory must not request a full database update using the 26.10.4
StartMediaLibraryUpdates (page 204) message more than once during an iAP2 connection. The accessory must
be capable of processing incremental media library updates from the device and persist its media library mirror
across connections to minimize the occurrence of full updates.
All accessories that support the Media Library Updates feature must send or receive the following iAP2 control
session messages:
26.10.4 StartMediaLibraryUpdates (page 204)
26.10.5 MediaLibraryUpdate (page 206)
26.10.6 StopMediaLibraryUpdates (page 209)
Autonomous generation of these messages without being preceded by direct user action is grounds for failure
to pass self certification. If an accessory wishes to resume media playback upon initial connection to the Apple
device, it must send a Play HID usage as documented in 14. Human Interface Device (HID) (page 96).
109
110
Regardless of whether the accessory sends 26.10.6 StopMediaLibraryUpdates (page 209) or disconnects from
the Apple device, the accessory must store the last received MediaLibraryRevision parameter value. When
the accessory next sends 26.10.4 StartMediaLibraryUpdates (page 204) to the same Apple device it must set
LastKnownMediaLibraryRevision to that value to avoid having to retrieve a complete media library
update. If the accessory has limited storage capacity it may choose to only retain a media library snapshot
from one Apple device at a time.
111
Starting with iOS 4.2.1, some Apple devices provide support for USB Host Mode MIDI. Compatible accessories
can interface directly with iOS apps that make use of the Core MIDI framework.
To support MIDI, accessories must follow the requirements in Universal Serial Bus Definition for MIDI Devices ,
Release 1.0, available at www.usb.org. Developers should test their accessory designs against the latest Mac
OS X MIDI driver; the application Audio MIDI Setup, in the Mac OS X Applications/Utilities folder, can be used
to verify accessory compatibility.
Every accessory that supports the USB Host Mode MIDI must implement a MIDI Streaming IN endpoint.
112
The Now Playing feature enables an accessory to display information about the current "Now Playing" media
source and media item on an Apple device. Media sources include both the built-in Music and Video apps on
iOS devices and certain third-party iOS apps that support the generation of Now Playing metadata (see
MPNowPlayingInfoCenter in the iOS SDK documentation). Accessories must be prepared for the Now Playing
media source and media item to change at any time, whether the accessory requested the change or not.
Music
Videos
Podcasts
iBooks
iTunes U
If the accessory will register for album artwork associated with the now playing media item, the accessory must
implement and declare a file transfer session as documented in 25.3 File Transfer Session (page 173).
113
114
19. Power
The power feature covers both accessories that provide power to the Apple device and accessories that draw
power from the Apple device.
Provide a means for a compatible external power supply, such as an Apple power adapter or personal
computer, to power the device directly (passthrough).
Accessories that provide power to the Apple device must provide power at all times unless direct user action
(button press, power switch, menu item selection, detach of external power supply, etc.) is taken to put the
accessory into an 'off' state. Failure to provide power at all times may result in the accessory being unable to
charge an Apple device whose battery level is too low for the device to boot and is grounds for failure to pass
self certification.
Self-powered accessories that draw power from a wall socket or internal battery and implement an iAP2
connection may inform the Apple device that power is not available or available at a reduced level via an iAP2
26.12.4 PowerSourceUpdate (page 216) message when the user unplugs the accessory from the wall socket.
115
19. Power
19.1 Power Requirements
Power to the Apple device must be restored (and a corresponding 26.12.4 PowerSourceUpdate (page 216)
message must be sent) when the user plugs the accessory back into a wall socket. Otherwise, the accessory
must provide power to the Apple device when running off its internal battery.
If a self-powered accessory temporarily reduces power supply to the Apple device, the reduced power supply
level must be one of the following:
0 mA
500 mA
1000 mA
2100 mA
All accessories that support the Power Sources (if iAP2 is implemented) feature must send or receive the
following iAP2 control session messages:
26.12.4 PowerSourceUpdate (page 216)
To avoid interference with audio output, the switching frequency must always be greater than the audio
band (that is, more than 22 kHz ) for all loads greater than 5 mA .
The switching frequency must always be above 60 kHz , and preferably above 450 kHz , for all loads greater
than 20 mA .
116
19. Power
19.1 Power Requirements
If the AC adapter bridge diodes have large inherent reverse capacitance (greater than 100 pF, as many large
power diodes do), then the net impedance change due to diode switching may be acceptably small; it will not
adversely affect the touch sensor output. In more compact IC designs, however, the chip area of each diode
may be reduced in size and its reverse capacitance may become correspondingly smaller.
To stabilize the impedance of bridge diodes with unacceptably low reverse capacitance, follow the example
shown in Figure 19-1 (page 117). In this example, capacitors C1, C2, C3, and C4 have been placed in parallel
with diodes D1, D2, D3, and D4 to stabilize the bridge impedance. Their values are larger than the inherent
reverse capacitances of the diodes.
Resistors R1, R2, R3, and R4 are optional; if included, they can block noise at very high frequencies, which can
help with EMI compatibility. The suggested values of R1, R2, R3, and R4 shown were chosen to have trivial
levels of impedance relative to the impedances of C1, C2, C3, and C4 at power line frequencies.
Figure 19-1
Accessory
C3
R1
R3
C1
D3
D1
D2
D4
C4
R2
R4
C2
Neutral
Table 19-1
Component
Value
47 pF
2 k
117
19. Power
19.1 Power Requirements
The Lightning connector must supply 2100 mA at 4.55 V to claim compatibility with iPad, iPad mini, iPhone,
and iPod. 2400 mA at 5.0 V is recommended.
The Lightning connector must supply 1000 mA at 4.70 V to claim compatibility with iPad mini, iPhone,
and iPod. 1000 mA at 5.0 V is recommended.
The connector must supply 2100 mA at 4.97 V to claim compatibility with iPad, iPad mini, iPhone, and
iPod. 2400 mA at 5.2 V is recommended.
118
19. Power
19.1 Power Requirements
The connector must supply 1000 mA at 4.90 V to claim compatibility with iPad mini, iPhone, and iPod.
1000 mA at 5.2 V is recommended.
The connector must meet or exceed all applicable USB-IF specifications, both mechanical and electrical
(or only electrical if the connector is not a standard USB connector).
They must test for DC resistances below the limits shown in the following table.
They must exhibit no more inductance than a simple ferrite bead on every circuit.
To minimize power losses, every cable shield should be connected to the ground conductor at both ends.
Table 19-2
Specification
Maximum DC resistance
200 m
300 m
160 m
140 m
85 m
119
19. Power
19.1 Power Requirements
Additionally, all such connectors must supply between 4.9 V to 5.25 V on the VBUS (Device Power) pin when
there is no current being drawn.
Figure 19-2
USB D+/D- resistor networks for self-powered accessory connectors that do not implement iAP2
USB Vbus
R1
USB Vbus
R2
D+
R3
D
R4
Note: All resistors used to implement the networks specified in Figure 19-2 (page 120) must have
a tolerance of 1% or better.
Table 19-3
USB D+/D- resistor values for self-powered accessory connectors that do not implement iAP2
Current
R1
R2
R3
R4
2400 mA
43.2 k
49.9 k
43.2 k
49.9 k
2100 mA
43.2 k
49.9 k
75.0 k
49.9 k
1000 mA
75.0 k
49.9 k
43.2 k
49.9 k
120
19. Power
19.1 Power Requirements
If the accessory has standard USB type-A connectors supplying 500 mA that could be used to provide power
to an Apple device in addition to Apple device-compatible USB type-A connectors, then the following labeling
requirements apply:
The standard USB type-A connectors supplying 500 mA must be labeled using the USB icon.
USB type-A connectors capable of identifying themselves to an Apple device as supplying 1000 mA must
be labeled, singly or in groups, with the text 'iPod/iPhone'.
USB type-A connectors capable of identifying themselves to an Apple device as supplying 2100 mA or
2400 mA must be labeled, singly or in groups, with the text 'iPod/iPhone/iPad'.
If the accessory has multiple Lightning connectors with different device compatibilities, then the iPad-compatible
connectors must be labeled with the text 'iPad' unless it is physically impossible to connect an iPad to the
iPod/iPhone compatible connectors.
121
19. Power
19.1 Power Requirements
When an accessory attached to an Apple device is also connected to a personal computer, it must pass USB
VBUS power to the Apple device. Some personal computers can supply more than 500 mA through their USB
ports; this ensures that if the Apple device needs more power than is available from the accessory, it will be
able to get extra power from the computer. Hence the Apple device must be able to draw power from the
computers USB port whenever the accessory is plugged into it. Failure to pass VBUS power through may result
in the Apple device not communicating with the computer.
Note: The traces and circuits used to pass USB VBUS power must be capable of handling at least
2.5 A . This is the minimum current necessary to guarantee synchronization of an Apple device with
iTunes on any computer.
122
19. Power
19.2 Power Usage
Table 19-4
iAP2 Transport
None
0 mA
Serial
5 mA
0 mA
10 mA
Bluetooth
0 mA
123
19. Power
19.2 Power Usage
Event
Audio
EA Native Transport
MIDI
If an accessory receives permission to enter Intermittent High Power Mode via multiple mechanisms, the
highest power limit overall applies.
Event
Audio
EA Native Transport
MIDI
124
Some Apple devices can enter USB Host mode from USB Device mode after receiving a specific USB Vendor
Request. Accessories that interface with an Apple device via a USB to Lightning cable may choose to use this
feature in order to support typical USB peripherals such as Flash drives and also take advantage of features
that are only available to USB Host Mode accessories.
The accessory must have a USB-A receptacle that is capable of functioning in both USB Host and USB
Device roles.
The receptacle must be labeled in accordance with the requirements specified in the Power feature. See
19.1.1.12 Multiple Connectors (page 121) for details.
The USB-A receptacle must provide power compatible with Apple devices as specified in the Power feature.
The accessory (USB host) must detect and enumerate the Apple device (USB device).
2.
The accessory must send the following USB Custom Vendor Request, which asks for a USB role switch:
Table 20-1
Field
Value
Comments
bmRequestType
0x40
bRequest
0x50
wValue
0x00
Reserved
125
Field
Value
Comments
wIndex
0x00
Reserved
wLength
No data transfer
3.
If the Apple device supports this role switch request, it disconnects itself from the bus. If it does not, it
issues a STALL packet. See On-The-Go Supplement , Section 6.3, Step B. If the accessory receives a STALL
packet, it must assume that the Apple device does not support this feature and proceed accordingly. For
example, the accessory may establish an iAP2 connection using USB Device mode instead.
4.
The accessory must detect the bus disconnect and turn on D+ pull-up. See On-The-Go Supplement , Section
6.3, Step C.
5.
The Apple device will assert a bus reset signal to start using the bus. See On-The-Go Supplement , Section
6.3, Step D.
6.
The accessory (USB device) must wait at least 1000 ms for the Apple device (USB host) to start enumeration
of the accessory. See On-The-Go Supplement , Section 6.8.1.5.
7.
If 1000 ms passes without any traffic, the accessory must transition back to USB Host mode.
The following two events take place when the cable connecting the Apple device to the accessory's USB-A
receptacle is unplugged from either or both ends:
The Apple device detects loss of VBUS and switches back to USB Device mode.
The accessory detects a minimum of 200 ms of bus inactivity and transitions back to USB Host mode. See
On-The-Go Supplement , Section 6.8.1.6.
126
21. VoiceOver
VoiceOver is the screen reader feature built into both Apple's iOS and OS X operating systems. Users who are
blind or have low vision can interact with and control iOS devices and Macs simply by moving their finger over
the touchscreen or touch-sensitive trackpad. For more information on VoiceOver, see http://www.apple.com/accessibility/voiceover/. In addition, when VoiceOver is paired with certain accessories users are able to use
VoiceOver even if they are unable to touch the display at all.
Most VoiceOver accessories interface with one or more switch-type inputs. Accessory developers targeting
users who can see the display and manipulate more complex input peripherals should consider supporting
the AssistiveTouch feature.
127
21. VoiceOver
21.2 VoiceOver Usage
128
Apple devices can share Wi-Fi configuration information with an accessory. The user must grant permission
for the device to share this information. The device can only share information about the currently connected
Wi-Fi network, and this feature will not account for other router-configured access control mechanisms such
as RADIUS or MAC address filtering.
Figure 22-1 Wi-Fi Information Sharing Alert
129
It must let the user initiate Wi-Fi login sharing via either a physical button or an onscreen option.
It must not be able to initiate Wi-Fi login sharing without an explicit user action via the means described
above.
It must notify the user, visibly and/or audibly, when it has received Wi-Fi connection information.
It must notify the user, visibly and/or audibly, when it has successfully established a Wi-Fi connection.
130
All devices support one or more transports that can be used to establish an iAP2 connection with an accessory.
Some transports are better suited for various features than others, so transport selection should be a high
priority early in the accessory design process.
All USB descriptors (particularly the endpoint descriptors and the bMaxPower field of the configuration
descriptors) must accurately represent the accessory's capabilities.
Every USB device descriptor must declare a unique Vendor ID (VID) assigned by the USB-IF and a unique
Product ID (PID) assigned by the accessory developer. The USB-IF Vendor ID must be assigned to the MFi
licensee responsible for the accessory. Re-using the Vendor ID of a silicon or component provider is
specifically prohibited.
All USB Device, Configuration, and Interface descriptors must be accompanied by human-readable String
descriptors. Among these String descriptors, the following must match 26.2.2
IdentificationInformation (page 184) message parameter values that the accessory passes to the Apple
device:
USB Manufacturer String Descriptor must match the Manufacturer parameter value.
USB Product String Descriptor must match the Name parameter value.
USB Serial Number String Descriptor must match the SerialNumber parameter value.
There is no USB 5 V VBUS supply from an Apple device; only Accessory Power is available.
Upon receiving a USB Suspend command the accessory must immediately enter Low Power Mode and
remain in that mode until it receives a USB Resume command.
The accessory must capable of handling simultaneous bulk IN and bulk OUT transfers.
131
USB Descriptor
Value
Comments
Interface
0x00
Interface Class
0xFF
Vendor-specific interface
Interface Subclass
0xF0
MFi accessory
Interface Protocol
0x00
Interface String
'iAP Interface'
Number of Endpoints
132
a ZLP data transfer. When the Apple device receives a ZLP data transfer on its interrupt IN endpoint while a
bulk IN read is currently in progress, it will queue up a new bulk IN read internally, to be started immediately
after the current bulk IN transfer finishes.
The Apple device may temporarily stop reading the bulk IN endpoint. This is normal behavior; the Apple device
will resume reading the bulk IN endpoint (as needed) after one or more internal buffers become available. If
bulk IN reads stop, even though the maximum packet size was returned with the last read, the accessory must
not send more than one additional ZLP data transfer to signal that its bulk IN endpoint should be read.
In USB Host mode, the Apple device sends data to the accessory using the bulk OUT endpoint. The accessory
must return a USB ACK packet if the write operation is successful or return a USB NAK packet if it is not ready
to accept data. If the accessory repeatedly returns a USB NAK packet for more than 1 second, the write operation
will time out and information from the Apple device may be lost.
Table 23-2
Step
Device
Accessory
Continue steps 1 and 2 until the accessory has data to send to the Apple device. When the accessory has
data to send, it goes to step 3 in response to the next interrupt IN endpoint read
3
Continue steps 4 and 5 until the accessory will be returning a packet of less than the maximum USB
packet size in response to the next bulk IN endpoint read. When the accessory has less than the maximum
USB packet size of data to return, it must go to step 6 in response to the next bulk IN endpoint read.
133
Step
Device
Accessory
To initiate another bulk IN endpoint data transfer immediately, the accessory must send a new ZLP
transfer on the interrupt IN endpoint (or have sent one while the current transfer was in process), effectively
returning to step 3. Otherwise, it must return to step 1.
After the accessory sends a ZLP data transfer to the Apple device on the interrupt IN endpoint (to initiate
a data transfer on the bulk IN endpoint), the accessory should respond to each bulk IN read by returning
a packet of the maximum USB packet size. The accessory should continue doing this until the last USB
packet, when it may return a partial or empty packet.
The accessory should avoid sending data payloads smaller than the maximum USB packet payload size,
because afterward it must send another ZLP data transfer on the interrupt IN endpoint to reinitiate the
bulk IN read process. The latency time between a ZLP data transfer on the interrupt IN endpoint and a
bulk IN read can be as long as the polling interval, introducing additional data transfer delays and lowering
throughput.
If the bulk IN data packet being returned is exactly the size of the USB packet payload, the Apple device
will go on to read the next USB packet on the bulk IN endpoint. The accessory must respond to that read
with a ZLP data transfer to ensure that the bulk IN endpoint read process terminates properly.
The iAP2 link packets sent over USB may cross USB packet boundaries, and USB packets may cross iAP2
link packet boundaries. If possible, multiple iAP2 link packets should be concatenated or combined to fill
each USB packet up to the maximum USB packet payload size, thereby minimizing the number of transitions
between the interrupt IN and bulk IN endpoints. Each of these transitions introduces an interrupt IN
endpoint polling interval latency, which should be avoided because it slows the overall data transfer
throughput.
Accessories should send the largest iAP2 link packets possible. This permits more data to be sent to the
Apple device before a response is required. Sending small packets and waiting for the Apple device to
respond introduces unnecessary delays and lowers data throughput.
134
Accessories must not send extra interrupt IN endpoint ZLPs beyond those required to signal the Apple
device to read the bulk IN endpoint. If surplus ZLPs are sent, they may cause the Apple device to poll the
bulk IN endpoint unnecessarily, thereby reducing the USB bus bandwidth available for other purposes.
When the accessory sends surplus ZLPs without available data to read on the bulk IN endpoint, the Apple
device applies a bulk IN read timeout of 1 second. The bulk IN read transfer from the accessory must finish
before the timeout. If the transfer does not finish before the timeout, the accessory must send a new ZLP.
23.2.1 Power
All accessories that connect to an Apple device in USB Device Mode must provide power to the device as
documented in 19. Power (page 115).
23.2.2 Enumeration
The initialization and configuration of an attached USB device is documented in the USB 2.0 specification. This
document does not cover this topic in detail, but instead provides information specific to Apple devices. To
distinguish an Apple device in USB Device Mode, the accessory must check the device descriptor of attached
USB devices for the following fields:
Vendor ID = 0x05AC
Product ID = 0x12nn
135
Note: Accessories must not attempt to distinguish between different types of Apple devices based
on the least significant byte of the Product ID. Additionally, accessories must not use any other aspect
of the device descriptor, such as number of configurations, interfaces, of endpoints, to determine
whether an Apple device is connected. Use of additional parameters will cause the accessory to fail
self certification immediately.
OR
Configuration Descriptor
bConfigurationValue = 1
bNumInterfaces = 1
Configuration Descriptor
bConfigurationValue = 2
bNumInterfaces = 3
Interface Descriptor
bNumEndpoints = 2
bInterfaceClass = Mass Storage Device Class
Interface Descriptor
Interface Descriptor
bNumEndpoints = 0
bInterfaceClass = Audio Control
bNumEndpoints = 0
bInterfaceClass = Audio Streaming (0 bandwidth)
Interface Descriptor
Interface Descriptor
bNumEndpoints = 1
bInterfaceClass = Audio Streaming (full bandwidth)
bNumEndpoints = 1
bInterfaceClass = HID Class
136
Note: The Apple device USB isochronous audio data endpoint descriptor bmAttributes field
erroneously returns the Synchronization Type field (D3:2) as b00 (no synchronization) instead of the
correct value, b11 (synchronous). Apple devices support synchronous data transfers, so accessories
must override these attribute bits. The erroneous b00 value is retained for backwards compatibility
with older Apple device accessories.
The Apple device HID interface utilizes several vendor-specific HID reports, some of which are used to transport
data from the accessory (output reports) and some of which are used to transport data to the accessory (input
reports). To send data to an Apple device, the accessory must choose one or more appropriately sized HID
reports in which to embed the iAP2 link packet and send them to the Apple device HID interface using USB
SetReport commands. The Apple device reassembles the iAP2 link packet and processes it. The process is
repeated in reverse when the Apple device sends responses or iAP2 link packets to the accessory. In this case,
the data is sent on an interrupt endpoint associated with the HID interface.
The different HID report sizes, endpoint requirements, and particulars are all described in the USB descriptors
that accompany the interface.
Note: Accessories must always request and parse the HID report descriptor each time an Apple
device is connected or the accessory resets USB, because the HID Report ID and size descriptions
may change.
137
The HID Report ID indicates the type of report and implies the size of the report. Every report of a given type
is the same size. The Apple device specifies several different report types. The USB host must analyze the HID
report descriptor of the Apple device at runtime to determine which Report ID corresponds to the most
appropriate report type for each transfer. Note that the HID report descriptor may change in future Apple
devices.
Usage of a HID Report ID is defined by the USB specification and is not specific to Apple devices, in contrast
to the LCB and the rest of the payload.
The link control byte provides a mechanism for grouping sets of reports and is used by the HID interface to
manage the data flow.
Table 23-3
Bit
Name
Usage
Bit 0
Continuation
0 indicates that this HID report is the first in a set of one or more reports.
This also implies that any previous sets are completed. Any incomplete
iAP packets received prior to the arrival of this report are flushed and
lost. 1 indicates that this report is not the start of a set, but is a
continuing part of a set.
Bit 1
More to Follow
0 indicates that this report is the last in a set. Any following reports
must be part of another set. 1 indicates that the current report set is
not yet complete and there is at least one more report expected.
Bits 2-7
Reserved
Set to 0.
In general, iAP packets can be packed into HID reports in any manner, given the following limitations:
All unused space within any HID report must be set to 0x00.
If there is more than one iAP packet in the same HID report, there must be no unused space between
them.
138
If an iAP packet is split across multiple HID reports, all component reports must be in the same logical set
of reports.
iAP packet
iAP packet
0x01
iAP P1
iAP P1 (continued)
23.3 Serial
Serial connections may make sense for low-cost accessories that do not need to transmit audio, or for
device-powered accessories which emphasize low power draw over high data transmission rates. Otherwise,
USB Host Mode is recommended.
Apple devices support serial communication based on the RS-232 serial specification with the exception of
signaling levels. For Apple devices, a mark is 2.500 V through 3.465 V and a space is 0 V through 0.8 V.
Table 23-4
Description
Conditions
MIN
MAX
Units
2.500
3.465
0.000
0.800
30
Accessory TX Current
2.500
3.465
0.000
0.500
139
Accessories must communicate over the serial transport at 57600 bps and maintain their baud rates within
2% of the chosen rate over the entire temperature range of the accessory. Accessories must not change baud
rate once a Serial communication has started.
The accessory must not rely on the Apple device to hold the Device TX level to the mark state when the Serial
transport is idle. When idle, Device TX line must be pulled up to Accessory Power through a 100 k resistor.
Accessories that use an open-collector or open-drain UART driver on Accessory TX must include a pull-up
resistor to Accessory Power. The pull-up resistor value must be chosen to meet the baud rate requirements
described above. The maximum mark voltage must be measured with the Apple device not connected, and
mark signals must be sent only after Accessory Power goes high.
All serial communications use 8 data bits, no parity bits, and one stop bit (8-N-1). Serial hardware flow controls
(RTS/CTS and DTR/DSR) are not used and will be ignored by the Apple device. In addition, the accessory must
not use software flow control (XON/XOFF). The accessory must not use bit averaging to produce a mean bit
rate not directly achievable from its system clock. All bits transmitted by the accessory must have the same
nominal duration.
23.4 Bluetooth
Accessories that communicate with iOS devices using Bluetooth must meet the requirements specified in the
Apple document Bluetooth Accessory Design Guidelines for Apple Products. That document covers the Bluetooth
profiles for various iOS devices and other aspects of accessory design that are not specifically related to iAP.
The information presented there is crucial for obtaining satisfactory Bluetooth communication between
accessories and Bluetooth-capable iOS devices. When incorporating that document in this specification,
substitute 'must' for 'should' throughout.
The following requirements apply to all accessories that implement iAP2 over the Bluetooth transport:
The SDP data Maximum Transmission Unit (MTU) must be at least 672 bytes.
The EIR Device Name must be the same as the Name parameter in the 26.2.2
IdentificationInformation (page 184) message.
Unlike iAP1, there is no requirement for a specific Class of Device (CoD) or Major Service.
140
Implement Bluetooth Sniff Mode, or Sniff Subrating if Bluetooth 2.1 is being used.
For large packet transfers, stay within a Maximum Transmission Unit (MTU) size of 1000 bytes and a
minimum of 658 bytes at the iAP layer.
The iOS device may refuse a Bluetooth connection under these circumstances:
There are too many Bluetooth connections made to the iOS device. In this case, the accessory will receive
an error indicating that a resource is unavailable.
There are too many RFCOMM protocol connections to the iOS device. In this case, the accessory will receive
a Resource Denied error.
Unlike wired transports, Apple devices will enter a hibernate state regardless of how many active Bluetooth
connections are present. Bluetooth traffic from the accessory to the device will cause the device to exit the
hibernate state. Therefore, accessories must generate Bluetooth traffic to an Apple device only in response to
a direct user action. Autonomous generation of Bluetooth traffic for the purpose of keeping an Apple device
out of hibernate is grounds for failure to pass self certification.
To re-establish a Bluetooth connection to the iOS device, the accessory must make a Bluetooth SDP query to
find the RFCOMM channel associated with the UUID 0x00000000DECAFADEDECADEAFDECACAFE, then connect
to that channel. The accessory must not assume that the channel will remain the same between connections.
The iAP2 connection to be re-established if no link key is present.
The accessory must not expect that the iOS device will try to re-establish a broken Bluetooth connection.
141
Every iAP2 connection starts with the establishment of a link between an accessory and a device over a
supported transport. The link protocol provides a transport-agnostic mechanism for reliable and ordered
delivery of packetized data belonging to one or more iAP2 sessions. The protocol is also configurable on a
per-connection basis and can be optimized for best performance on any particular transport and accessory
usage profile. Certain protocol features contribute towards these goals:
142
...
Payload Data
...
Payload Checksum
The EAK bit is always set along with the ACK bit.
The RST bit is never set in conjunction with any other bit.
The SLP bit is never set in conjunction with any other bit.
iAP2 Session Payloads cannot be present when any of the SYN, EAK, or RST bits are set. Conversely, link packets
with iAP2 session payloads always have the ACK bit set.
Table 24-2
Bit
Name
Meaning
SYN
143
Bit
Name
Meaning
ACK
Packet Acknowledgement Number is valid, and iAP2 Session Payload may be present
EAK
RST
Link Reset
SLP
Device Sleep
In the rest of this specification, a link packet can be described in terms of its Control Byte bits and payload. For
example, a SYN packet refers to a link packet with the SYN bit set in the Control Byte, and a SYN+ACK packet
refers to a link packet with both the SYN and ACK bits set in the Control Byte.
144
Control Byte
Session Identifier
145
The version of the link being established. All packet payloads may vary depending on the Link Version.
Both the accessory and device must agree on the same value.
The maximum number of packets that may be sent without receiving an acknowledgement.
146
The accessory and device may propose and use different values.
The accessory and device may propose and use different values.
The timeout value in milliseconds for retransmission of unacknowledged packets. This should be set to a
value approximating the transmission time for a packet over the link transport.
Both the accessory and device must agree on the same value.
The timeout value in milliseconds for sending an acknowledgment packet if another packet is not sent.
Both the accessory and device must agree on the same value.
The maximum number of packet retransmissions attempted before the link is considered to be broken.
Both the accessory and device must agree on the same value.
The maximum number of received acknowledgments that will be accumulated before sending an
acknowledgement if another packet is not sent.
Valid values are 0 to 127 or the Maximum Number of Outstanding Packets, whichever is smaller.
147
Both the accessory and device must agree on the same value.
The iAP2 sessions that the accessory will use to communicate with the device.
Valid session types and versions are defined in 25.1.1 Type (page 167) chapter. Session identifiers must
be unique to each defined session. 0 is not a valid session identifier.
Both the accessory and device must agree on the same value.
Both the EAK and ACK bits in the Control Byte must be set.
The Packet Acknowledge Number contains the sequence number of the last packet that was received in
sequence.
The Payload Data section contains the sequence numbers of one of more packets that were received out
of sequence.
Table 24-4
148
24.5 Reset
The RST bit in the Control Byte is used by the device to reset a connection. Such a link packet does not have
a payload and may only be sent by the device.
24.6 Sleep
The SLP bit in the Control Byte is used by the device to signal that it is about to enter a sleep state. Such a link
packet does not have a payload and may only be sent by the device.
The device will stop supplying Accessory Power once it enters the sleep state. If the device exits the sleep state,
it will start supplying Accessory Power again. Once Accessory Power reappears, the accessory must wait 80 ms
before re-initializing the link.
Accessories using the Bluetooth transport will not receive a suspend packet when the Apple device enters a
sleep state.
24.7 Operation
24.7.1 Record
All link implementations must store the following variables in a record that is unique to the link. These variables
will be referred to in subsequent subsections describing iAP2 Link operation.
Table 24-5
Variable
Description
SentACKTimer
A timer that keeps track of the elapsed time (ms) since the last
ACK packet was sent
NextSentPSN
OldestSentUnacknowledgedPSN
InitialSentPSN
The Packet Sequence Number used for the very first packet sent
LastReceivedInSequencePSN
InitialReceivedPSN
149
Variable
Description
ReceivedOutOfSequencePSNs[n]
24.7.2 Initialization
Once the transport connection is established, the accessory must confirm the presence of a device that supports
iAP2 by sending the following byte sequence once a second until a response is received from the Apple device:
FF 55 02 00 EE 10
If the device supports iAP2, the accessory will receive the same byte sequence in return. If the device is not
compatible with this Specification but is compatible with the MFi Accessory Firmware Specification R46, the
accessory will receive one of the following:
An iAP1 General Lingo iPodACK packet with a command status of 0x04 (ERROR: Bad Parameter): 55 04
00 02 04 EE 08
In either case, the packet may or may not be preceded by an 0xFF sync byte.
The accessory must treat any other response from the device as final; no retries or retransmissions are allowed.
If the accessory is also backward compatible with the MFi Accessory Firmware Specification R46, it may proceed
to initiate communication with the older device using iAP1. Otherwise, the accessory must send the following
byte sequence to the device to indicate lack of backward compatibility:
FF 55 0E 00 13 FF FF FF FF FF FF FF FF FF FF FF FF EB
24.7.3 Synchronization
One notable feature of the link is support for automatic negotiation of transmission parameters over any type
of transport. This permits the link to scale according to the capabilities of both device and accessory. link
initialization has 4 main goals:
Determines mutually acceptable link configuration parameters for both device and accessory.
150
A link is initiated when an underlying transport connection and device compatibility have been established.
When this occurs, the accessory first sends a SYN packet containing desired connection parameters in the Link
Synchronization Payload, along with a randomly generated Packet Sequence Number. The device will respond
with an SYN+ACK packet acknowledging receipt of the accessory's SYN packet, its own desired connection
parameters, and its randomly generated Packet Sequence Number. If the two sets of connection parameters
match, the accessory must send a final ACK packet of the most recent SYN+ACK from the device, and the
connection is considered to be established. Otherwise, SYN+ACK packets will continue to be exchanged up to
10 times until connection parameters are agreed upon. If 10 exchanges occur without agreement on connection
parameters then the device will stop responding to any further packets sent by the accessory.
Sometimes, a device will be unable to respond immediately to the receipt of a SYN packet from an accessory.
In that situation, the accessory may resend the SYN packet with the same Payload Data and the same Packet
Sequence Number. It may continue doing so every second until the device sends a SYN+ACK response
acknowledging the previously sent Packet Sequence Number. Once this response has been received, the
accessory must ignore any subsequent incoming SYN+ACK packets with the same Packet Sequence Number.
The device will send a RST packet to reset the link if the accessory's final Link Synchronization Payload contains
an invalid non-negotiable parameter.
During synchronization, the following default link configuration parameters are assumed until synchronization
is complete:
Table 24-6
Parameter
Default Value
128 bytes
Retransmission Timeout
1000 ms
0 ms
30
The following tables contain suggested link configuration parameters for some iAP2 transports. These values
are just starting points for development and must not be used without verifying suitability for a particular
accessory.
151
Table 24-7
Suggested link parameters for USB Host Mode transport (Full Speed)
Parameter
Suggested Value
4096 bytes
Retransmission Timeout
2000 ms
21.8 ms
30
Table 24-8
Suggested link parameters for USB Device Mode transport (Full Speed)
Parameter
Suggested Value
4096 bytes
Retransmission Timeout
2000 ms
21.8 ms
30
Table 24-9
Parameter
Suggested Value
2048 bytes
Retransmission Timeout
1500 ms
72.8 ms
30
152
Table 24-10 Suggested link parameters for 57.6 kbps serial transport
Parameter
Suggested Value
256 bytes
Retransmission Timeout
1000 ms
133.3 ms
30
24.7.4 Acknowledgements
To guarantee delivery of packets, the link protocol uses both positive acknowledgement and retransmission
of packets. Each packet with Payload Data and SYN packets are acknowledged when they are correctly received
and accepted by the receiver. ACK packets are not acknowledged. Damaged packets are discarded and not
acknowledged. Packets are retransmitted by the sender when they are not acknowledged by the receiver
within the time specified by the Retransmission Timeout.
There are two types of packet acknowledgements. A cumulative acknowledgement is used to acknowledge
receipt of all in-sequence packets up to a specified Packet Sequence Number. The extended acknowledgement
allows the receiver to acknowledge packets out of sequence. The type of acknowledgement used is simply a
function of the order in which packets arrive. Whenever possible, link implementations must use the cumulative
acknowledgement and use the extended acknowledgement only when packets are received out of sequence.
Receivers must generate and send an extended acknowledgement as soon as one or more out-of-sequence
packets are received.
24.7.5 Retransmissions
Packets can get lost in transmission because of loss or damage in the underlying transport. They can also be
discarded by the receiver. The positive acknowledgement of packets requires the receiver to acknowledge a
packet only when the packet has been correctly received and accepted.
To detect missing packets, the sender must use a retransmission timer for each outgoing packet. This timer is
set to the negotiated Retransmission Timeout value. When an acknowledgement is received for a packet, the
timer is cancelled for that packet. If the timer expires before an acknowledgement is received, that packet is
retransmitted and the timer is restarted, up to the Maximum Number of Retransmissions negotiated during
link synchronization.
153
24.7.7 Reset
The device may send a RST packet to the accessory at any time. Upon receipt of this packet, the accessory
must send a SYN packet to the device within 1 second of receiving the RST packet and proceed as specified
in 24.7.3 Synchronization (page 150).
Accessories must terminate the underlying transport connection and reconnect if they wish to reset the link.
This is not possible when the serial transport is active without physically disconnecting and reconnecting the
accessory with the device's Lightning connector. Having to restart the link is a sign of poorly negotiated link
parameters and should not occur during typical operation.
154
24.8 Examples
24.8.1 Typical Link Initialization
Accessory
Device
Link
Control Session
Accessory Authentication
Session
155
Device
FF 55 02 00 EE 10
Link
SYN[100]
SYN[100]
SYN[200] ACK[100]
ACK[200]
SYN[200] ACK[100]
ACK[200]
Control Session
Accessory Authentication
Authentication Certificate
Challenge Response
Session
...
156
Accessory
Device
Link
Control Session
Accessory Authentication
Session
157
Device
Link
158
At any time, a RST packet may be sent by the Device to the Accessory. Accessory must reset the connection
and start the connection sequence again by sending the SYN packet.
Accessory
Device
Session
159
Device
Session
Link
Link
Control Session
Accessory Authentication
Session
160
Accessory
Device
DATA[100) ACK[???)
161
The accessory does not need to wait for Cumulative Acknowledgement Timeout to expire if it has additional
packets to send.
Accessory
Device
DATA[200] ACK[???]
DATA[100] ACK[200]
DATA[101] ACK[200]
DATA[102] ACK[200]
DATA[103] ACK[200]
DATA[104] ACK[200]
DATA[105] ACK[200]
DATA[106] ACK[201]
DATA[107] ACK[201]
DATA[108] ACK[201]
DATA[109] ACK[201]
162
163
Accessory
Device
DATA[99] ACK[???]
DATA[100] ACK[???]
DATA[200] ACK[100]
DATA[101] ACK[200]
lost
DATA[201] ACK[100]
DATA[102] ACK[201]
ACK[100] EAK(102]
missing ACK[101]
DATA[101] ACK[201]
DATA[202] ACK[102]
DATA[103] ACK[202]
DATA[104] ACK[202]
lost
DATA[105] ACK[202]
ACK[103] EAK(105]
DATA[104] ACK[202]
DATA[203] ACK[105]
DATA[106] ACK[203]
DATA[107] ACK[203]
lost
ACK[106]
DATA[107] ACK[203]
Retransmission Timeout
ACK[107]
164
Accessory
Device
Session
DATA[105] ACK[???]
DATA[104] ACK[???]
ACK[105]
165
166
Once an iAP2 link has been established, higher level communication between an accessory and an Apple
device is structured into one of more sessions. At the very minimum, all accessories must establish a control
session for the purposes of authentication and identification. Once initial authentication and identification are
complete, the accessory may use additional sessions.
Every session has a session identifier, session type, and session version. The session identifier is used to uniquely
identify a session within an iAP2 connection. The session identifier of 0 is reserved for link use, and all sessions
used by an accessory must have unique nonzero identifiers. The combination of both session type and session
version dictates which session protocol variant is used for all data traffic in that session. The session identifier
is part of every iAP2 link packet header.
25.1 Attributes
25.1.1 Type
Table 25-1
Session Type
Name
Control session
All link implementations must have one control session. All other sessions are optional depending on the
features implemented. Multiple sessions of the same type are not permitted.
25.1.2 Version
The session version is used to distinguish between different variants of a particular session protocol. The exact
nature of these differences depends on the session type. See the sections in the specification on each session
type for more details.
167
Notify both the device and accessory of changes in the other's state and/or configuration.
Provide the accessory with means to request changes in device state and/or configuration.
The control session protocol is a stateless protocol. Each message is an independent entity that has no
relationship to any prior message. The device does not retain any information or status about each attached
accessory from message to message. An accessory must behave the same way. Specifically, an accessory request
for a change in device state and/or configuration must be treated as a request and not a command. The device
may or may not choose to honor the request, and will either send an update message to confirm a change in
state/configuration or not send any message at all.
LSB
7
..
.
..
.
Parameter N
..
.
168
Message Length: Size of the whole message, in bytes, including the Message Length field, Message ID
and all Parameters. Start of message
Message ID: Message Identifier
Parameter: Parameters for this message (see below)
Parameters are structured as follows:
Figure 25-2 Control Session Message Parameter Structure
MSB
LSB
7
Parameter Length: Length of parameter, in bytes, including the parameter length field, parameter ID and
parameter data.
Parameter ID: Interpretation is message specific.
Parameter Data: Type of the data is determined by the parameter ID for this specific message ID.
Extra unknown parameters in a received message must be ignored and message parsing must proceed
with the remaining parameters.
169
25.2.3.1 Number
Only certain types of numbers are permitted in messages:
If a number parameter has a limited range of permitted values, the range will be specified in the parameter
notes. Otherwise, the full range of possible values is assumed to be valid.
25.2.3.2 Enumeration
Written in parameter lists as 'enum'. Unsigned 8-bit byte which corresponds to an exact listing of all of its
possible values.
25.2.3.3 Boolean
Written in parameter lists as 'bool'. Special type of Enumeration encoded as a one byte unsigned integer where
0 indicates NO and 1 means YES. All other enumeration values are invalid.
25.2.3.4 String
Written in parameter lists as 'utf8'. Null terminated UTF-8 string. Accessories that receive string parameters
must be prepared to handle any valid UTF-8 string, as Apple devices allow users to input strings in all supported
languages and character sets, such as Emoji.
25.2.3.5 Blob
Written in parameter lists as 'blob'. The contents of the binary blob will be defined in the parameter notes.
Typically, most blobs are arrays of custom data structures.
170
25.2.3.6 None
Written in parameter lists as 'none'. No parameter data. The mere existence or absence of the parameter in
the message has meaning.
25.2.3.7 Group
Written in parameter lists as 'group'. Parameters maybe grouped together as a group. Group parameter data
consists of a number of sub-parameters each having a Format consisting of Sub-parameter Length, ID, and
Data. Sub-parameters may be present in any order within a group.
Figure 25-3 Group Parameter Structure
MSB
LSB
7
171
LSB
7
LSB
7
172
25.3.1 TransferIdentifier
Setup of an file transfer takes place in the control session. The following iAP2 messages can generate a file
transfer identifier parameter:
173
To support the file transfer feature, every iAP2 connection must maintain a global unsigned 8-bit
FileTransferIdentifier that starts at 0 when the connection is established. The FileTransferIdentifier must be
incremented to the next inactive FileTransferIdentifer value once it has been used. Once the global
FileTransferIdentifier reaches 127 the accessory must immediately reset it to 0 or the lowest inactive
FileTransferIdentifier value, whichever is lower, before it initiates the next transfer.
Byte
Value
FileTransferIdentifier
0x04
25.3.3 Start
Upon receiving the Setup datagram from the sender, the receiver may send a Start datagram back to the
sender to signify that it is ready to receive file data.
174
Table 25-3
Byte
Value
FileTransferIdentifier
0x01
25.3.4 FirstData
The sender may start sending file data once it receives a Start datagram. The first datagram is unique and must
take the following format:
Table 25-4
Byte
Value
FileTransferIdentifier
0x80
Data Byte 0
Data Byte n
Only one FirstData datagram may be sent for any given assigned FileTransferIdentifier. The sender must switch
to Data datagrams for all subsequent file data until the end of the file.
25.3.5 FirstAndOnlyData
If the file is so short as to fit in one session datagram, the sender may send a FirstAndOnlyData datagram as
follows:
Table 25-5
Byte
Value
FileTransferIdentifier
0xC0
Data Byte 0
Data Byte n
175
Only one FirstAndOnlyData datagram may be sent for any given assigned FileTransferIdentifier. The file transfer
is considered complete upon receipt of the FirstAndOnlyData datagram.
25.3.6 Data
Regular file data datagrams must take the following format:
Table 25-6
Byte
Value
FileTransferIdentifier
0x00
Data Byte 0
Data Byte n
25.3.7 LastData
The last object data datagram is unique and must take the following format:
Table 25-7
Byte
Value
FileTransferIdentifier
0x40
Data Byte 0
Data Byte n
25.3.8 Cancel
The Cancel datagram may be sent at any time by either the sender or receiver after the Setup datagram is sent
or received. The FileTransferIdentifier must be marked as inactive by both the sender and receiver after it is
transmitted.
The Cancel datagram must be sent by any accessory or device if any other File Transfer Session datagram is
received with an inactive FileTransferIdentifier.
176
Table 25-8
Byte
Value
FileTransferIdentifier
0x02
25.3.9 Pause
The Pause datagram may be sent at any time by the sender or receiver after the first Start datagram has been
sent by the receiver. Unlike the Stop datagram, the FileTransferIdentifier remains active, but no FirstData, Data,
or LastData datagrams may be transmitted until the end that sent the Pause datagram sends a Start datagram
with the same FileTransferIdentifier. Data datagrams will resume from the point where the transfer left off.
Table 25-9
Byte
Value
FileTransferIdentifier
0x03
25.3.10 Success
The Success datagram must be sent by the receiver after it has received and processed all file data. The sender
may choose to delete the file or otherwise dispose of it after receiving this datagram from the receiver.
The FileTransferIdentifier must be marked as inactive by both the sender and receiver after this datagram is
transmitted.
Table 25-10 File Transfer Session Success Datagram
Byte
Value
FileTransferIdentifier
0x05
25.3.11 Failure
The Failure datagram must be sent by the receiver if it has received all file data but is unable to store it. This
sender may choose to resend the file or not, depending on the circumstances.
177
The FileTransferIdentifier must be marked as inactive by both the sender and receiver after this datagram is
transmitted.
Table 25-11 File Transfer Session Failure Datagram
Byte
Value
FileTransferIdentifier
0x06
25.3.12 Examples
In all examples, the device is playing the role of the file sender, and the accessory is the file receiver. These
roles can be reversed depending on the needs of a particular accessory interface feature
Accessory
Device
Control Session
Message(0)
178
179
Accessory
Device
Control Session
Message(0)
Setup(0)
Control Session
Message(1)
Setup(1)
Start(0)
FirstData(0)(XXX)
Data(0)(XXX)
Start(1)
Data(0)(XXX)
FirstData(1)(XXX)
EndData(0)(XXX)
Data(1)(XXX)
Data(1)(XXX)
Success(0)
EndData(1)(XXX)
Success(1)
180
25.4.1 Setup
Setup of an EA transfer takes place in the control session. The accessory will receive a 26.7.1
StartExternalAccessoryProtocolSession (page 199) message with assigned
ExternalAccessoryProtocolIdentifier and ExternalAccessoryProtocolSessionIdentifier
parameters.
The ExternalAccessoryProtocolIdentifier is defined by the accessory during identification; an accessory
may define and support multiple supported protocols.
The ExternalAccessoryTransferIdentifier is unique to each EA connection between an app and the
accessory. Accessories must use this identifier to distinguish between datagrams sent over the EA session.
Accessories that declare an EA session during link synchronization must declare support for one or more
ExternalAccessoryProtocol parameters during accessory identification as specified in 11. External
Accessory Protocol (page 69).
Accessories must not send any EA session datagrams with an unassigned transfer identifier. Conversely,
accessories must ignore any EA session datagrams with unassigned transfer identifiers.
Value
ExternalAccessoryTransferIdentifier Byte 0
ExternalAccessoryTransferIdentifier Byte 1
2+
All EA transfer datagrams must fit within a single iAP2 link packet payload.
181
26.1.1 RequestAuthenticationCertificate
Source
ID
Device
0xAA00
Table 26-1
Name
Type
Notes
26.1.2 AuthenticationCertificate
Source
ID
Accessory
0xAA01
Table 26-2
Name
ID
Type
Notes
AuthenticationCertificate
blob
26.1.3 RequestAuthenticationChallengeResponse
Source
ID
Device
0xAA02
182
Table 26-3
Name
ID
Type
Notes
AuthenticationChallenge
blob
Random #
26.1.4 AuthenticationResponse
Source
ID
Accessory
0xAA03
Table 26-4
Name
ID
Type
Notes
AuthenticationResponse
blob
26.1.5 AuthenticationFailed
Source
ID
Device
0xAA04
Table 26-5
Name
Type
Notes
26.1.6 AuthenticationSucceeded
Source
ID
Device
0xAA05
Table 26-6
Name
Type
Notes
183
26.2.1 StartIdentification
Source
ID
Device
0x1D00
Table 26-7
Name
Type
Notes
26.2.2 IdentificationInformation
Source
ID
Accessory
0x1D01
Table 26-8
Name
ID
Type
Notes
Name
utf8
ModelIdentifier
utf8
Manufacturer
utf8
SerialNumber
utf8
184
Name
ID
Type
Notes
FirmwareVersion
utf8
HardwareVersion
utf8
MessagesSentByAccessory
blob
MessagesReceivedFromDevice
blob
PowerSourceType
enum
MaximumCurrentDrawnFromDevice
uint16
SupportedExternalAccessoryProtocol
10
group
0+
See ExternalAccessoryProtocol
(Table 26-10 (page 187))
PreferredAppBundleSeedIdentifier
11
utf8
0/1
CurrentLanguage
12
utf8
185
Name
ID
Type
Notes
SupportedLanguage
13
utf8
1+
SerialTransportComponent
14
group
0/1
See SerialTransportComponent
(Table 26-15 (page 188))
USBDeviceTransportComponent
15
group
0/1
See
USBDeviceTransportComponent
(Table 26-12 (page 187))
USBHostTransportComponent
16
group
0/1
See
USBHostTransportComponent
(Table 26-14 (page 188))
BluetoothTransportComponent
17
group
0+
See
BluetoothTransportComponent
(Table 26-16 (page 189))
iAP2HIDComponent
18
group
0+
USBHostHIDComponent
19
group
0+
See USBHostHIDComponent
(Table 26-18 (page 189))
Table 26-9
PowerSourceType enum
Value
Meaning
None
Passthrough
Self powered
186
ID
Type
Notes
ExternalAccessoryProtocolIdentifier
uint8
All ExternalAccessoryProtocol
identifiers must be unique
ExternalAccessoryProtocolName
utf8
ExternalAccessoryProtocolMatchAction
enum
NativeTransportComponentIdentifier
uint16
0/1
USBHostTransportComponent
(Table 26-14 (page 188))
Meaning
The device will not attempt to find a matching app, and there will not be a Find App For This
Accessory button in Settings > General > About > 'Accessory Name'
The device will attempt to find a matching app, and there will be a Find App For This Accessory
button in Settings > General > About > 'Accessory Name'
The device will not attempt to find a matching app, but there will be a Find App For This
Accessory button in Settings > General > About > 'Accessory Name'
ID
Type
Notes
TransportComponentIdentifier
uint16
TransportComponentName
utf8
TransportSupportsiAP2Connection
none
0/1
USBDeviceSupportedAudioSampleRate
enum
0+
187
See
USBDeviceModeAudioSampleRate
(Table 26-13 (page 188))
Meaning
8000 Hz
11025 Hz
12000 Hz
16000 Hz
22050 Hz
24000 Hz
32000 Hz
44100 Hz
48000 Hz
ID
Type
Notes
TransportComponentIdentifier
uint16
TransportComponentName
utf8
TransportSupportsiAP2Connection
none
0/1
ID
Type
Notes
TransportComponentIdentifier
uint16
TransportComponentName
utf8
TransportSupportsiAP2Connection
none
0/1
188
ID
Type
TransportComponentIdentifier
uint16
TransportComponentName
utf8
TransportSupportsiAP2Connection
none
0/1
BluetoothTransportMediaAccessControlAddress
blob
Notes
ID
Type
HIDComponentIdentifier
uint16
HIDComponentName
utf8
HIDComponentFunction
enum
Notes
ID
Type
Notes
HIDComponentIdentifier
uint16
HIDComponentName
utf8
HIDComponentFunction
enum
See HIDComponentFunction
(Table 26-19 (page 190))
USBHostTransportComponentIdentifier
uint16
Must refer to a
USBHostTransportComponent
(Table 26-14 (page 188))
USBHostTransportInterfaceNumber
uint8
189
Meaning
Keyboard
AssistiveTouch Pointer
26.2.3 IdentificationAccepted
Source
ID
Device
0x1D02
ID
Type
Notes
26.2.4 IdentificationRejected
Source
ID
Device
0x1D03
ID
Type
Name
none
0/1
ModelIdentifier
none
0/1
Manufacturer
none
0/1
SerialNumber
none
0/1
FirmwareVersion
none
0/1
HardwareVersion
none
0/1
Notes
190
Name
ID
Type
Notes
MessagesSentByAccessory
blob
0/1
MessagesReceivedFromDevice
blob
0/1
PowerSourceType
none
0/1
MaximumCurrentDrawnFromDevice
none
0/1
SupportedExternalAccessoryProtocol
10
none
0/1
PreferredAppBundleSeedIdentifier
11
none
0/1
CurrentLanguage
12
none
0/1
SupportedLanguage
13
none
0/1
SerialTransportComponent
14
none
0/1
USBDeviceTransportComponent
15
none
0/1
USBHostTransportComponent
16
none
0/1
BluetoothTransportComponent
17
none
0/1
iAP2HIDComponent
18
none
0+
USBHostHIDComponent
19
none
0+
191
26.2.5 CancelIdentification
Source
ID
Accessory
0x1D05
ID
Type
Notes
26.2.6 IdentificationInformationUpdate
Source
ID
Accessory
0x1D06
ID
Type
Name
utf8
ModelIdentifier
utf8
Manufacturer
utf8
SerialNumber
utf8
FirmwareVersion
utf8
HardwareVersion
utf8
CurrentLanguage
utf8
Notes
192
26.3.1 RequestAppLaunch
Source
ID
Accessory
0xEA02
ID
Type
Notes
AppBundleID
utf8
26.4 AssistiveTouch
For more information, see 7. AssistiveTouch (page 60).
26.4.1 StartAssistiveTouch
Source
ID
Accessory
0x5400
ID
Type
Notes
26.4.2 StopAssistiveTouch
Source
ID
Accessory
0x5401
ID
Type
Notes
193
26.4.3 StartAssistiveTouchInformation
Source
ID
Accessory
0x5402
ID
Type
Notes
26.4.4 AssistiveTouchInformation
Source
ID
Device
0x5403
ID
Type
IsEnabled
bool
Notes
26.4.5 StopAssistiveTouchInformation
Source
ID
Accessory
0x5404
ID
Type
Notes
194
26.5.1 BluetoothComponentInformation
Source
ID
Accessory
0x4E01
ID
Type
Notes
BluetoothComponentStatus
group
0+
ID
Type
Notes
ComponentIdentifier
uint16
ComponentEnabled
bool
26.5.2 StartBluetoothConnectionUpdates
Source
ID
Accessory
0x4E03
ID
Type
Notes
BluetoothTransportComponentIdentifier
uint16
1+
See
BluetoothTransportComponent
(Table 26-16 (page 189))
26.5.3 BluetoothConnectionUpdate
Source
ID
Device
0x4E04
195
ID
Type
Notes
BluetoothTransportComponentIdentifier
uint16
See
BluetoothTransportComponent
(Table 26-16 (page 189))
ConnectedBluetoothProfiles
group
0/1
See
BluetoothComponentProfiles
(Table 26-34 (page 196))
ID
Type
BluetoothHandsFree
none
0/1
BluetoothPhoneBookAccess
none
0/1
BluetoothAudioVideoRemoteControl
none
0/1
BluetoothAdvancedAudioDistribution
none
0/1
BluetoothHumanInterfaceDevice
none
0/1
BluetoothiAP2Link
none
0/1
BluetoothPersonalAreaNetworkAccessPoint
none
0/1
BluetoothMessageAccess
none
0/1
BluetoothPersonalAreaNetworkClient
12
none
0/1
26.5.4 StopBluetoothConnectionUpdates
Source
ID
Accessory
0x4E05
196
Notes
ID
Type
Notes
26.6.1 RequestDeviceAuthenticationCertificate
Source
ID
Accessory
0xAA10
ID
Type
Notes
26.6.2 DeviceAuthenticationCertificate
Source
ID
Device
0xAA11
ID
Type
Notes
DeviceAuthenticationCertificate
blob
26.6.3 RequestDeviceAuthenticationChallengeResponse
Source
ID
Accessory
0xAA12
197
ID
Type
Notes
DeviceAuthenticationChallenge
blob
Random #
26.6.4 DeviceAuthenticationResponse
Source
ID
Device
0xAA13
ID
Type
Notes
DeviceAuthenticationResponse
blob
26.6.5 DeviceAuthenticationFailed
Source
ID
Accessory
0xAA14
ID
Type
Notes
26.6.6 DeviceAuthenticationSucceeded
Source
ID
Accessory
0xAA15
ID
Type
Notes
198
26.7.1 StartExternalAccessoryProtocolSession
Source
ID
Device
0xEA00
ID
Type
Notes
ExternalAccessoryProtocolIdentifier
uint8
See
ExternalAccessoryProtocol
(Table 26-10 (page 187))
ExternalAccessoryProtocolSessionIdentifier
uint16
26.7.2 StopExternalAccessoryProtocolSession
Source
ID
Device
0xEA01
ID
Type
ExternalAccessoryProtocolSessionIdentifier
uint16
26.8.1 StartHID
Source
ID
Accessory
0x6800
199
Notes
ID
Type
Notes
HIDComponentIdentifier
uint16
VendorIdentifier
uint16
ProductIdentifier
uint16
LocalizedKeyboardCountryCode
uint8
0/1
HIDReportDescriptor
blob
26.8.2 DeviceHIDReport
Source
ID
Device
0x6801
ID
Type
Notes
HIDComponentIdentifier
uint16
HIDReport
blob
HID Report
26.8.3 AccessoryHIDReport
Source
ID
Accessory
0x6802
200
ID
Type
Notes
HIDComponentIdentifier
uint16
HIDReport
blob
HID Report
26.8.4 StopHID
Source
ID
Accessory
0x6803
ID
Type
Notes
HIDComponentIdentifier
uint16
26.9 Location
For more information, see 15. Location Information (page 107).
26.9.1 StartLocationInformation
Source
ID
Device
0xFFFA
ID
Type
Notes
MinimumIntervalInMilliseconds
uint32
Minimum interval
between
LocationInformation
messages.
201
Name
ID
Type
Notes
GlobalPositioningSystemFixData
none
0/1
If present, the
accessory may
provide NMEA
GPGGA sentences.
RecommendedMinimumSpecificGPSTransitData
none
0/1
If present, the
accessory may
provide NMEA
GPRMC sentences.
GPSSatellitesInView
none
0/1
If present, the
accessory may
provide NMEA
GPGSV sentences.
26.9.2 LocationInformation
Source
ID
Accessory
0xFFFB
ID
Type
Notes
NMEASentence
utf8
1+
26.9.3 StopLocationInformation
Source
ID
Device
0xFFFC
ID
Type
Notes
202
26.10.1 StartMediaLibraryInformation
Source
ID
Accessory
0x4C00
ID
Type
Notes
26.10.2 MediaLibraryInformation
Source
ID
Device
0x4C01
ID
Type
Notes
MediaLibraryInformation
group
0+
ID
Type
MediaLibraryName
utf8
MediaLibraryUniqueIdentifier
utf8
MediaLibraryType
enum
Notes
203
Meaning
26.10.3 StopMediaLibraryInformation
Source
ID
Accessory
0x4C02
ID
Type
Notes
26.10.4 StartMediaLibraryUpdates
Source
ID
Accessory
0x4C03
ID
Type
Notes
MediaLibraryUniqueIdentifier
utf8
LastKnownMediaLibraryRevision
utf8
0/1
If no LastKnownMediaLibraryRevision
is included, a full database update will
be sent.
MediaItemProperties
group
0/1
MediaPlaylistProperties
group
0/1
204
ID
Type
MediaItemPropertyPersistentIdentifier
none
MediaItemPropertyTitle
none
0/1
MediaItemPropertyMediaType
none
0/1
MediaItemPropertyRating
none
0/1
MediaItemPropertyPlaybackDurationInMilliseconds
none
0/1
MediaItemPropertyAlbumPersistentIdentifer
none
0/1
MediaItemPropertyAlbumTitle
none
0/1
MediaItemPropertyAlbumTrackNumber
none
0/1
MediaItemPropertyAlbumTrackCount
none
0/1
MediaItemPropertyAlbumDiscNumber
none
0/1
MediaItemPropertyAlbumDiscCount
10
none
0/1
MediaItemPropertyArtistPersistentIdentifier
11
none
0/1
MediaItemPropertyArtist
12
none
0/1
MediaItemPropertyAlbumArtistPersistentIdentifier
13
none
0/1
MediaItemPropertyAlbumArtist
14
none
0/1
MediaItemPropertyGenrePersistentIdentifier
15
none
0/1
MediaItemPropertyGenre
16
none
0/1
MediaItemPropertyComposerPersistentIdentifier
17
none
0/1
MediaItemPropertyComposer
18
none
0/1
MediaItemPropertyIsPartOfCompilation
19
none
0/1
Notes
ID
Type
MediaPlaylistPropertyPersistentIdentifer
none
205
Notes
Name
ID
Type
Notes
MediaPlaylistPropertyName
none
0/1
MediaPlaylistPropertyParentPersistentIdentifer
none
0/1
MediaPlaylistPropertyIsGeniusMix
none
0/1
MediaPlaylistPropertyIsFolder
none
0/1
MediaPlaylistContainedMediaItems
none
0/1
26.10.5 MediaLibraryUpdate
Source
ID
Device
0x4C04
ID
Type
MediaLibraryUniqueIdentifier
utf8
MediaLibraryRevision
utf8
0/1
MediaItem
group
0+
MediaPlaylist
group
0+
MediaItemDeletePersistentIdentifier
uint64
0+
PersistentIdentifier of the
media item that has been
deleted
MediaPlaylistDeletePersistentIdentifier
uint64
0+
PersistentIdentifier of the
playlist that has been deleted
206
Notes
Name
ID
Type
Notes
MediaLibraryReset
none
0/1
ID
Type
MediaItemPersistentIdentifier
uint64
0/1
MediaItemTitle
utf8
0/1
MediaItemMediaType
enum
0+
MediaItemRating
uint8
0/1
Shall be 0...5
MediaItemPlaybackDurationInMilliseconds
uint32
0/1
MediaItemAlbumPersistentIdentifer
uint64
0/1
MediaItemAlbumTitle
utf8
0/1
MediaItemAlbumTrackNumber
uint16
0/1
MediaItemAlbumTrackCount
uint16
0/1
MediaItemAlbumDiscNumber
uint16
0/1
MediaItemAlbumDiscCount
10
uint16
0/1
MediaItemArtistPersistentIdentifier
11
uint64
0/1
MediaItemArtist
12
utf8
0/1
MediaItemAlbumArtistPersistentIdentifier
13
uint64
0/1
MediaItemAlbumArtist
14
utf8
0/1
MediaItemGenrePersistentIdentifier
15
uint64
0/1
207
Notes
Name
ID
Type
MediaItemGenre
16
utf8
0/1
MediaItemComposerPersistentIdentifier
17
uint64
0/1
MediaItemComposer
18
utf8
0/1
MediaItemIsPartOfCompilation
19
bool
0/1
MediaItemArtworkFileTransferIdentifier
20
uint8
0/1
Notes
ID
Type
MediaPlaylistPersistentIdentifer
uint64
0/1
MediaPlaylistName
utf8
0/1
MediaPlaylistParentPersistentIdentifer
uint64
0/1
MediaPlaylistIsGeniusMix
bool
0/1
MediaPlaylistIsFolder
bool
0/1
MediaPlaylistContainedMediaItemsFileTransferIdentifier
uint8
0/1
Meaning
MediaTypeMusic
MediaTypePodcast
208
Notes
Note that it
is entirely
possible for
this
parameter to
be sent with
an empty
blob,
indicating a
playlist with
0 contained
items.
Value
Meaning
MediaTypeAudioBook
MediaTypeiTunesU
26.10.6 StopMediaLibraryUpdates
Source
ID
Accessory
0x4C05
ID
Type
MediaLibraryUniqueIdentifier
utf8
1+
Notes
26.10.7 PlayMediaLibraryCurrentSelection
Source
ID
Accessory
0x4C06
ID
Type
Notes
MediaLibraryUniqueIdentifier
utf8
26.10.8 PlayMediaLibraryItems
Source
ID
Accessory
0x4C07
209
ID
Type
Notes
ItemsPersistentIdentifiers
blob
ItemsStartingIndex
uint32
0/1
MediaLibraryUniqueIdentifier
utf8
See 26.10.2
MediaLibraryInformation (page 203)
26.10.9 PlayMediaLibraryCollection
Source
ID
Accessory
0x4C08
ID
Type
Notes
CollectionPersistentIdentifier
uint64
CollectionType
enum
CollectionStartingIndex
uint32
0/1
MediaLibraryUniqueIdentifier
utf8
See 26.10.2
MediaLibraryInformation (page 203)
Meaning
Playlist
Artist
210
Value
Meaning
Album
Album Artist
Genre
Composer
26.11.1 StartNowPlayingUpdates
Source
ID
Accessory
0x5000
ID
Type
Notes
MediaItemAttributes
group
0/1
PlaybackAttributes
group
0/1
ID
Type
MediaItemTitle
none
0/1
MediaItemPlaybackDurationInMilliseconds
none
0/1
MediaItemAlbumTitle
none
0/1
MediaItemAlbumTrackNumber
none
0/1
MediaItemAlbumTrackCount
none
0/1
211
Notes
Name
ID
Type
Notes
MediaItemAlbumDiscNumber
none
0/1
MediaItemAlbumDiscCount
10
none
0/1
MediaItemArtist
12
none
0/1
MediaItemGenre
16
none
0/1
MediaItemComposer
18
none
0/1
MediaItemArtworkFileTransferIdentifier
20
none
0/1
ID
Type
PlaybackStatus
none
0/1
PlaybackElapsedTimeInMilliseconds
none
0/1
PlaybackQueueIndex
none
0/1
PlaybackQueueCount
none
0/1
PlaybackQueueChapterIndex
none
0/1
PlaybackShuffleMode
none
0/1
PlaybackRepeatMode
none
0/1
PlaybackAppName
none
0/1
Notes
26.11.2 NowPlayingUpdate
Source
ID
Device
0x5001
212
ID
Type
Notes
MediaItemAttributes
group
0/1
PlaybackAttributes
group
0/1
ID
Type
Notes
PlaybackStatus
enum
0/1
PlaybackElapsedTimeInMilliseconds
uint32
0/1
PlaybackQueueIndex
uint32
0/1
PlaybackQueueCount
uint32
0/1
PlaybackQueueChapterIndex
uint32
0/1
PlaybackShuffleMode
enum
0/1
PlaybackRepeatMode
enum
0/1
PlaybackAppName
utf8
0/1
Meaning
Stopped
Playing
Paused
SeekForward
SeekBackward
213
Meaning
Off
Songs
Albums
Meaning
Off
One
All
26.11.3 StopNowPlayingUpdates
Source
ID
Accessory
0x5002
ID
Type
Notes
26.12 Power
For more information, see 19. Power (page 115).
26.12.1 StartPowerUpdates
Source
ID
Accessory
0xAE00
214
ID
Type
Notes
MaximumCurrentDrawnFromAccessory
none
0/1
DeviceBatteryWillChargeIfPowerIsPresent
none
0/1
AccessoryPowerMode
none
0/1
Name
ID
Type
Notes
MaximumCurrentDrawnFromAccessory
uint16
0/1
DeviceBatteryWillChargeIfPowerIsPresent
bool
0/1
AccessoryPowerMode
enum
0/1
26.12.2 PowerUpdate
Source
ID
Device
0xAE01
Meaning
No Power
26.12.3 StopPowerUpdates
Source
ID
Accessory
0xAE02
215
See AccessoryPowerModes
(Table 26-79 (page 215))
ID
Type
Notes
26.12.4 PowerSourceUpdate
Source
ID
Accessory
0xAE03
ID
Type
Notes
AvailableCurrentForDevice
uint16
0/1
DeviceBatteryShouldChargeIfPowerIsPresent
bool
0/1
26.13.1 StartUSBDeviceModeAudio
Source
ID
Accessory
0xDA00
ID
Type
Notes
216
26.13.2 USBDeviceModeAudioInformation
Source
ID
Device
0xDA01
ID
Type
Notes
SampleRate
enum
VolumeAdjustment
int32
SoundCheckAdjustment
int32
26.13.3 StopUSBDeviceModeAudio
Source
ID
Accessory
0xDA02
ID
Type
Notes
26.14 VoiceOver
For more information, see 21. VoiceOver (page 127).
26.14.1 StartVoiceOver
Source
ID
Accessory
0x5612
217
ID
Type
Notes
26.14.2 StopVoiceOver
Source
ID
Accessory
0x5613
ID
Type
Notes
26.14.3 RequestVoiceOverMoveCursor
Source
ID
Accessory
0x5601
ID
Type
Notes
CursorDirection
enum
Meaning
Next
Previous
Escape
218
26.14.4 RequestVoiceOverActivateCursor
Source
ID
Accessory
0x5602
ID
Type
Notes
26.14.5 RequestVoiceOverScrollPage
Source
ID
Accessory
0x5603
ID
Type
Notes
ScrollDirection
enum
Meaning
Left
Right
Up
Down
26.14.6 RequestVoiceOverSpeakText
Source
ID
Accessory
0x5606
219
ID
Type
Notes
TextToSpeak
utf8
0/1
26.14.7 RequestVoiceOverPauseText
Source
ID
Accessory
0x5608
ID
Type
Notes
26.14.8 RequestVoiceOverResumeText
Source
ID
Accessory
0x5609
ID
Type
Notes
26.14.9 StartVoiceOverUpdates
Source
ID
Accessory
0x560B
ID
Type
SpeakingVolume
none
0/1
Notes
220
Name
ID
Type
SpeakingRate
none
0/1
Enabled
none
0/1
Notes
26.14.10 VoiceOverUpdate
Source
ID
Device
0x560C
ID
Type
Notes
SpeakingVolume
uint8
0/1
SpeakingRate
uint8
0/1
Enabled
bool
0/1
26.14.11 StopVoiceOverUpdates
Source
ID
Accessory
0x560D
ID
Type
Notes
26.14.12 RequestVoiceOverConfiguration
Source
ID
Accessory
0x560E
221
ID
Type
Notes
SpeakingVolume
uint8
0/1
SpeakingRate
uint8
0/1
26.14.13 StartVoiceOverCursorUpdates
Source
ID
Accessory
0x560F
ID
Type
Label
none
0/1
Value
none
0/1
Hint
none
0/1
Traits
none
0/1
Notes
26.14.14 VoiceOverCursorUpdate
Source
ID
Device
0x5610
Table
26-100
Name
ID
Type
Label
utf8
0/1
Value
utf8
0/1
Hint
utf8
0/1
Traits
blob
0/1
Notes
222
Table
26-101
VoiceOverCursorUpdate Traits
Value
Meaning
Button
Link
Search Field
Image
Selected
Sound
Keyboard Key
Static Text
Summary Element
Not Enabled
10
Updates Frequently
11
12
Adjustable
13
Back Button
14
Map
15
Delete Key
26.14.15 StopVoiceOverCursorUpdates
Source
ID
Accessory
0x5611
Table
26-102
Name
Type
Notes
223
26.15.1 RequestWiFiInformation
Source
ID
Accessory
0x5700
Table
26-103
Name
Type
Notes
26.15.2 WiFiInformation
Source
ID
Device
0x5701
Table
26-104
Name
ID
Type
Notes
RequestStatus
enum
SecurityType
enum
0/1
WiFiSSID
utf8
0/1
WiFiPassphrase
utf8
0/1
Table
26-105
WiFiRequestStatus enum
Value
Meaning
Success
User Declined
224
Value
Meaning
Table
26-106
WiFiSecurityType enum
Value
Meaning
WEP
WPA
WPA2
225
226
Table 27-1
Coprocessor signals
Signal name
Pin
I/O
Description
GND
SDA
NC
3-5
SCL
I2C clock
RST
VCC
I2C data
Must not be connected
VCC
RST
SCL
NC
SDA
NC
NC
Index marking
GND
(top view)
PG-USON-8-1 package
The thermal pad on the bottom of the CP may be left unconnected or optionally connected to GND.
RST state
0x20
0x21
227
RST state
0x22
0x23
See 27.7.3 I2C Communications Process (page 232) for the interface requirements of the CP's I2C slave
communication transport.
2.2 k
SDA
See note 1
VCC
RST
SCL
VCC
GND
0.1 F
Note: If the CP's warm reset function is not needed, RST can be tied to either VCC or GND, depending
on which of the addressing modes shown in Table 27-2 (page 227) is used. If the warm reset function
is needed, RST should be connected to a general-purpose I/O line on the accessory's controller. For
further details, see 27.7.2 I2C Startup On Warm Reset (page 230).
228
The VCC line must be supplied with power and the SDA and SCL lines must be set high during the entire
procedure.
The RST line, used to select addressing as described in 27.4 Coprocessor 2.0C Address Selection (page
227), must be kept either low or high during the entire procedure. If the RST line is kept low during the
procedure, the accessory must set it high not earlier than 10ms after the VCC line goes high but before
the first data transmission occurs.
The first data transmission may start not earlier than 10ms after the VCC line goes high. If the RST line has
been kept low and the accessory might need to perform a warm reset of the CP chip later, the accessory
must set the RST line high not earlier that 1ms after the start of the first data transmission (tH.RST interval
in Figure 27-3 (page 230)). If the option of a warm reset later is not needed, the accessory may tie RST
directly to either VCC or GND.
229
Figure 27-3 (page 230) diagrams the timing of the I2C interface when it is started up by turning power on.
Figure 27-3 Coprocessor I2C power on timing
t POWER-UP
VCC
0.4 V
t START-UP
SCL
tR
ADDR = 0x22/0x23
RST
ADDR = 0x20/0x21
t H.RST
SDA
transmission 1
transmission n
Prepare for
warm reset
Address selection
Power-up
Bus-Idle
In this diagram, tSTARTUP 10ms and tH.RST 1ms . The rise time of tR and the fall time of tF are both < 1s from
10% to 90% of the signal amplitude, and tPOWER-UP < 200s from VCC = 0.4 V until VCC = 90% of the target supply
voltage.
The VCC line must be supplied with power during the entire procedure.
The terminal must halt I2C communication, and the SDA and SCL lines must be set high before the RST
line is set low.
The RST line must be set low and kept low for at least 10 s . Not later than 1ms after the falling edge of
the RST signal, the accessory must finish its I2C address selection by either keeping RST low or driving RST
high. If the RST line is kept low during the warm reset, the accessory must set it high not earlier than 10ms
after the VCC line goes high but before the first data transmission occurs.
230
The first data transmission may start not earlier than 10ms after the falling edge of the RST signal. If the
RST line has been kept low during the warm reset, the accessory must set it high not earlier that 1ms after
the start of the first data transmission (tH.RST interval in Figure 27-4 (page 231)).
Figure 27-4 (page 231) diagrams the timing of the I2C interface when it is reset by software toggling the RST
line without a power off/on cycle.
Figure 27-4 Coprocessor I2C warm reset timing
VCC
0.4 V
t1
t START-UP
t2
SCL
tR
tF
RST
ADDR = 0x22/0x23
tR
ADDR = 0x20/0x21
t H.RST
SDA
transmission 1
Address selection
Prepare for
warm reset
Reset detection
Warm reset
In this diagram, tSTARTUP 10 ms, tH.RST 1 ms, t1 > 10 s , and t2 = 3ms . The rise time of tR and the fall time of
tF are both < 1 s from 10% to 90% of the signal amplitude.
231
A5
A4
A3
A2
A1
A0
R/nW
RST
A5
A4
A3
A2
A1
A0
R/nW
RST
In I2C mode, the CP has both a write address and a read address, as is typical for an I2C device. The I2C write
address of the CP consists of the seven bits [A6:A0] followed by 0 for the R/nW bit. The I2C read address of the
CP consists of the seven bits [A6:A0] followed by 1 for the R/nW bit. If the RST input is connected to ground,
the write and read addresses of the CP are 0x20 and 0x21 respectively; if it is pulled high, the write and read
addresses of the CP are 0x22 and 0x23.
232
Note: Registers in the same block with consecutive addresses may be read from sequentially in
increasing numerical order, except as noted in the last column of Table 27-3 (page 233). Registers
must not be written to sequentially except as noted. Multibyte numeric values are stored in big-endian
order; for example, the first byte in a two-byte register is the MSB of the stored value and the second
byte is its LSB.
Table 27-3
Address
Block
Name
Length
(bytes)
Reset Value
Access
0x00
Device Version
0x05
Read-only
0x01
Firmware Version
0x01
Read-only
0x02
Authentication Protocol
Major Version
0x02
Read-only
0x03
Authentication Protocol
Minor Version
0x00
Read-only
0x04
Device ID
0x00000200
Read-only
0x05
Error Code
0x00
Read-only
0x10
0x00
Read/write
0x11
128
Read/write
0x12
128
Undefined
Read/write
0x20
20
Read/write
0x21
Challenge Data
128
Undefined
Read/write
0x30
1280
Read-only
0x31
128
Certificate
Read-only
0x32
128
Certificate
Read-only
233
Address
Block
Name
Length
(bytes)
Reset Value
Access
0x33
128
Certificate
Read-only
0x34
128
Certificate
Read-only
0x35
128
Certificate
Read-only
0x36
128
Certificate
Read-only
0x37
128
Certificate
Read-only
0x38
128
Certificate
Read-only
0x39
128
Certificate
Read-only
0x3A
128
Certificate
Read-only
0x40
0x00
Read/write
0x41-0x4C
Reserved
0x4D
Undefined
Read-only
0x50
0x0000
Read-only
0x51
128
Undefined
Read/write
0x52
128
Undefined
Read/write
0x53
128
Undefined
Read/write
0x54
128
Undefined
Read/write
234
Address
Block
Name
Length
(bytes)
Reset Value
Access
0x55
128
Undefined
Read/write
0x56
128
Undefined
Read/write
0x57
128
Undefined
Read/write
0x58
128
Undefined
Read/write
Note: Normally, reading register 0x05 will clear it. However, register 0x05 can be read sequentially
only as part of a sequence that begins with a register in the range 0x00-0x04, in which case the read
operation does not clear it.
Note: Registers 0x11 and 0x20 may each be written sequentially with registers 0x12 and 0x21,
respectively.
235
27.8.2.4 Device ID
The Device ID read-only register is not used by accessories that implement iAP2.
Error Code
Description
0x00
No error
0x01
0x02
0x03
0x04
0x05
0x06
0x07
0x08
0x09
0x0A
0x0B
0x0C-0xFF
Reserved
236
ERR_SET
Table 27-5
PROC_RESULTS
ERR_SET
Value
Description
The Error Code register does not contain a code generated by the most recent command
execution. However, it may still contain the most recent error code (greater than 0x00)
generated by an earlier command.
The Error Code register contains the most recent process or communication error. Both
this bit and the Error Code register contents are cleared after the Error Code register is
next read. This bit is also cleared after every successful command execution.
Table 27-6
PROC_RESULTS Value
Description
5-7
Reserved.
237
When written to, the Authentication Control and Status register controls the start of CP processes, as shown
in Figure 27-8 (page 238) and Table 27-7 (page 238).
Figure 27-8 Coprocessor Authentication Control and Status register, write-only bits
7
PROC_CONTROL
Note: Attempts to write to other bits in the Coprocessor Authentication Control and Status register
are ignored.
Table 27-7
PROC_CONTROL
Value
Description
Notes
No operation
No operation
6-7
Reserved.
238
Before a challenge response-generation process begins, this register should contain 0x80, the maximum
allowable challenge response length. After completion of the challenge response-generation process, the CP
updates this register to contain the actual length of the generated challenge response. This updated value
should be read in order to determine how much of the Challenge Response Data register contains valid
challenge response bytes.
Before a challenge response-verification process begins, this register should hold the actual length of the
challenge response being verified.
239
PROC_CONTROL
Table 27-8
PROC_CONTROL Value
Description
None
2-7
Reserved
When read from, bits 7-4 of the Self-Test Control and Status register report the results of the X.509 certificate
and private key tests, as shown in Figure 27-10 (page 240) and Table 27-9 (page 241). The CP detects a read
cycle and resets the Control and Status register to 0x00 after it; hence bits 7-4 must all be retrieved in one
operation.
Figure
27-10
PROC_RESULTS
240
Table 27-9
Test
Meaning If 0
Meaning If 1
X.509 Certificate
Private key
5-4
Reserved
Note: The X.509 and private key tests only verify that these elements are present in Flash memory;
no authentication is performed.
241
2.
3.
Check for an ACK from the slave; if a NACK is received, wait 500 s and then loop back to Step 1.
4.
5.
6.
242
2.
3.
Check for an ACK from the slave; if a NACK is received, wait 500 s and then loop back to Step 1.
4.
5.
6.
7.
8.
Check for an ACK from the slave; if a NACK is received, wait 500 s and then loop back to Step 6.
9.
Any additional reads after an I2C read stop sequence continue with the byte following the previous byte read
until an invalid register address or an end of block is reached, at which point the slave returns 0xFF in response
to all further reads.
243
Coprocessor package
2X
0.1
2X
2.5
1.2 0.05
A
0.1
0.2 0.05
0.1 C
2.5
0.25 0.05
5
8X
0.1 M A B C
0.05 M C
CODE
R0.1
Index marking (lasered)
0.2
0.4 0.05
0.5
Index marking
3X 0.5 = 1.5
0.6 Max
C
Seating plane
0.05 Max standoff
244
8X
0.05
(0.152)
Figure 27-12 (page 245), Figure 27-13 (page 246), and Figure 27-14 (page 247) describe how the CP is delivered
to accessory manufacturing facilities.
Figure
27-12
245
Figure
27-13
246
Figure
27-14
247
Maximum Range
-0.3 V to +7.0 V
Storage temperature
-40 C to +125 C
Recommended Range
-25 to +85 C
1.62 to 5.5 V
Required Range
10 to 400 kHz
Maximum 100 pF
248
Test
Conditions
Minimum
Typical
Maximum
Unit
7.5
mA
35
80
(authentication process
running)
I(sleep) Sleep mode
TA =25 C
Parameter
Minimum
VIH
VIL
Ii
Typical
Maximum
Unit
VCC 0.7
VCC + 0.3
-0.3
VCC 0.2
Input current
-10
10
Parameter
Test Conditions
Minimum
Maximum
Unit
VOL
IOL(max) = -1 mA
VSS
VSS + 0.4
249
Figure 27-15 (page 250) illustrates the CP's typical I/O port input signal timing and voltage limits. Table
27-16 (page 250) lists the parameter values in Figure 27-15 (page 250).
Figure
27-15
I/O port
(input)
VCC x 0.9
VCC x 0.1
VCC x 0.9
VCC x 0.1
TF
TR
Description
Maximum Value
TF
Fall time
1.0 s
TR
Rise time
1.0 s
250
This table describes the changes to MFi Accessory Interface Specification for Apple Devices .
Date
Notes
2012-10-30
2012-09-23
251
Apple Inc.
2012 Apple Inc.
All rights reserved.
No part of this publication may be reproduced,
stored in a retrieval system, or transmitted, in any
form or by any means, mechanical, electronic,
photocopying, recording, or otherwise, without
prior written permission of Apple Inc., with the
following exceptions: Any person is hereby
authorized to store documentation on a single
computer for personal use only and to print
copies of documentation for personal use
provided that the documentation contains
Apples copyright notice.
No licenses, express or implied, are granted with
respect to any of the technology described in this
document. Apple retains all intellectual property
rights associated with the technology described
in this document. This document is intended to
assist application developers to develop
applications only for Apple-labeled computers.
Apple Inc.
1 Infinite Loop
Cupertino, CA 95014
408-996-1010
Apple, the Apple logo, iBook, iBooks, iPad, iPhone,
iPod, iPod nano, iPod touch, iTunes, Mac, Mac OS,
Numbers, OS X, Pages, Spotlight, and Xcode are
trademarks of Apple Inc., registered in the U.S.
and other countries.
Multi-Touch is a trademark of Apple Inc.
Genius is a service mark of Apple Inc., registered
in the U.S. and other countries.
DEC is a trademark of Digital Equipment
Corporation.
iOS is a trademark or registered trademark of
Cisco in the U.S. and other countries and is used
under license.
Even though Apple has reviewed this document,
APPLE MAKES NO WARRANTY OR REPRESENTATION,
EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS
DOCUMENT, ITS QUALITY, ACCURACY,
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR
PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED
AS IS, AND YOU, THE READER, ARE ASSUMING THE
ENTIRE RISK AS TO ITS QUALITY AND ACCURACY.
IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES RESULTING FROM ANY DEFECT OR
INACCURACY IN THIS DOCUMENT, even if advised of
the possibility of such damages.
THE WARRANTY AND REMEDIES SET FORTH ABOVE
ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL
OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer,
agent, or employee is authorized to make any
modification, extension, or addition to this warranty.
Some states do not allow the exclusion or limitation
of implied warranties or liability for incidental or
consequential damages, so the above limitation or
exclusion may not apply to you. This warranty gives
you specific legal rights, and you may also have other
rights which vary from state to state.