Enumeration process for determining a communication protocol supported by a host device
An accessory device includes a protocol analysis system that executes an enumeration process to identify whether a host device, to which the accessory device is connected, supports a first communication protocol or a second communication protocol. If the protocol analysis system initially determines the host device supports the first communication protocol, additional operations are executed to help ensure the accuracy of the determination. The accuracy of the determination is based on commands that are received from the host device. If the received commands indicate the determination is inaccurate, the protocol analysis system restarts the enumeration process using descriptors associated with the second communication protocol.
1 . A method, comprising:
initiating an enumeration process in response to detecting a power on event;
determining a type of command received from a host device;
based, at least in part, on determining the command received from the host device is a first type of command:
determining a first communication protocol is unsupported by the host device; and
advertising a second communication protocol to the host device; and
based, at least in part, on determining the command received from the host device is a second type of command:
initiating a timer;
determining whether a third type of command is received before expiration of the timer; and
based, at least in part, on expiration of the timer:
determining the first communication protocol is unsupported by the host device; and
advertising the second communication protocol to the host device.
2 . The method of claim 1 , wherein the timer is a first timer and wherein the method further comprises:
determining the third type of command is received before expiration of the first timer;
canceling the first timer; and
initiating a second timer, the second timer having a value that is less than a value of the first timer.
3 . The method of claim 2 , further comprising:
determining the first communication protocol is unsupported by the host device upon expiration of the second timer; and
advertising the second communication protocol to the host device.
4 . The method of claim 2 , further comprising:
receiving a communication from the host device over the first communication protocol prior to expiration of the second timer; and
determining the first communication protocol is supported by the host device.
5 . The method of claim 4 , further comprising:
determining whether a command associated with the second communication protocol is received before a command associated with the first communication protocol; and
based, at least in part, on determining the command associated with the first communication protocol is received before the command associated with the second communication protocol, initiating a third timer.
6 . The method of claim 5 , wherein the third timer has a value that is less than the second timer.
7 . The method of claim 5 , further comprising:
determining whether the third timer has expired; and
issuing a reset to the host device based, at least in part, on the third timer expiring.
8 . The method of claim 7 , wherein the reset causes an advertisement of the second communication protocol to the host device.
9 . The method of claim 1 , wherein advertising the second communication protocol to the host device comprises:
storing information indicating the first communication protocol is unsupported by the host device; and
issuing a reset to the host device.
10 . The method of claim 9 , wherein the reset causes an advertisement of the second communication protocol to the host device.
11 . The method of claim 1 , wherein the first communication protocol is an iPod Accessory Protocol (IAP).
12 . The method of claim 1 , wherein the second communication protocol is associated with a Universal Serial Bus (USB) protocol.
13 . An accessory device, comprising:
a controller; and
a protocol analysis system associated with the controller and operable to determine whether a host device to which the accessory device is connected supports an iPod Accessory Protocol (IAP) by:
receiving a command from the host device;
determining whether the command received from the host device is a first type of command or a second type of command;
based, at least in part, on determining the command received from the host device is the first type of command:
determining the IAP is unsupported by the host device; and
advertising a Universal Serial Bus (USB) protocol to the host device; and
based, at least in part, on determining the command received from the host device is the second type of command:
initiating a timer;
determining whether a third type of command is received before expiration of the timer; and
based, at least in part, on expiration of the timer:
determining the IAP is unsupported by the host device; and
advertising the USB protocol to the host device.
14 . The accessory device of claim 13 , wherein the timer is a first timer and wherein the protocol analysis system is further operable to:
determine the third type of command is received before expiration of the first timer; and
initiate a second timer, the second timer having a value that is less than a value of the first timer.
15 . The accessory device of claim 14 , wherein the protocol analysis system is further operable to:
determine the IAP is unsupported by the host device upon expiration of the second timer; and
advertise the USB communication protocol to the host device.
16 . The accessory device of claim 14 , wherein the protocol analysis system is further operable to:
receive a communication from the host device over the first communication protocol prior to expiration of the second timer; and
determine the first communication protocol is supported by the host device.
17 . The accessory device of claim 16 , wherein the protocol analysis system is further operable to:
determine whether a command associated with the USB protocol is received before a command associated with the IAP; and
based, at least in part, on determining the command associated with the IAP is received before the command associated with USB protocol, initiating a third timer.
18 . The accessory device of claim 17 , wherein the protocol analysis system is further operable to:
determine whether the third timer has expired; and
issue a reset to the host device based, at least in part, on the third timer expiring.
19 . The accessory device of claim 18 , wherein the reset causes an advertisement of the USB protocol to the host device.
20 . An accessory device, comprising:
means for advertising an iPod Accessory Protocol (IAP) to a host device to which the accessory device is connected;
means for receiving a command from the host device;
means for determining whether the command received from the host device is a first type of command or a second type of command;
based, at least in part, on the means for determining whether the command received from the host device is the first type of command or the second type of command determines that the command received from the host device is the first type of command:
means for determining the IAP is unsupported by the host device determines that the IAP is unsupported by the host device; and
means for advertising a Universal Serial Bus (USB) protocol to the host device advertises the USB protocol to the host device; and
based, at least in part, on the means for determining whether the command received from the host device is the first type of command or the second type of command determines that the command received from the host device is the second type of command:
means for initiating a timer initiates the timer;
means for determining whether a third type of command is received before expiration of the timer determines whether the third type of command is received before expiration of the timer; and
based, at least in part, on the means for determining whether the third type of command is received expiration of the timer determines the timer has expired:
the means for determining the IAP is unsupported by the host device determines that the IAP is unsupported by the host device; and
the means for advertising the USB protocol to the host device advertises the USB protocol to the host device.