question: How does your computer know the difference between USB-C accessories like headphones, storage etc?
comment: This [answer]( URL_0 ) from a year back on a similar question explains how: > USB is more than just a connector, it's a whole set of protocols. One of the functions a USB device must support is the "Get Descriptor" request. The computer sends the Get Descriptor request through the USB, and the device must respond to it with a variety of information that identifies itself. The computer then looks up that information in a database and decides whether to treat the device as a keyboard, as speakers, or whatever.
passages: For external memory and the USB flash drive, appropriate software, e.g., the Unix command "dd", is needed to make the bit-level copy. Furthermore, USB flash drives with memory protection do not need special hardware and can be connected to any computer. Many USB drives and memory cards have a write-lock switch that can be used to prevent data changes, while making a copy.
   A DOLLx8 embedded network uses its own specific interface system named DOLLx8 Dataport that via DOLLx8 eMaster unit connects to external RS-232 and from there to USB directly, but requires the installation of a separate DOLLx8 driver. DOLLx8 runs on its own internal clock system that allows the DOLLx8 Dataport bus speed to be independent of the RS-232 baud speed set on the PC side, and can thus be determined by the user. With DOLLx8, USB works as a virtual communication port and can be set to a maximum speed of 128,000 Kbps.
  
  Section::::MISOLIMA.
   Examples of such active adapters include external USB sound cards/DACs that do not require special drivers, and USB-C to 3.5 mm headphone jack adapters by Apple, Google, Essential, Razer, HTC.
   For the computer to be able to detect and process the data signals drivers must be installed on the computer. Some chip models have drivers installed by default, including FTDI, while drivers for other chip models must be manually installed (e.g. for Windows and MacOS, WCH CH340 , Silicon Labs 210x.
   The program, when installed, prompts the user to create a whitelist of devices that are allowed to connect to the computer via its USB ports, which it checks at a default sample rate, a rate which can be adjusted. The user may also choose what actions the computer will take if it detects a USB device not on the whitelist (by default, it shuts down and erases data from the RAM and swap file). Users need to be logged in as root. Hephaest0s cautions users they must be using at least partial disk encryption along with USBKill to fully prevent attackers from gaining access; Gizmodo suggests using a virtual machine that will not be present when the computer reboots.
   Specifications listed on technology web sites (such as GSMArena, PDAdb.net, PhoneScoop, and others) can help determine compatibility. Using GSMArena as an example, one would locate the page for a given device, and examine the verbiage under "Specifications → Comms → USB". If "USB Host" is shown, the device should be capable of supporting OTG-type external USB accessories.
  
  In many of the above implementations, the host device has only a micro-B receptacle rather than a micro-AB receptacle. Although non-standard, micro-B to micro-A receptacle adapters are widely available and used in place of the mandated micro-AB receptacle on these devices.
  
  Section::::Backward compatibility.
   Devices may be hosts (DFP: downstream-facing port) or peripherals (UFP: upstream-facing port). Some, such as mobile phones, can take either role depending on what kind is detected on the other end. These types of ports are called Dual-Role-Data (DRD) ports, which was known as USB On-The-Go in the previous specification. When two such devices are connected, the roles are randomly assigned but a swap can be commanded from either end, although there are optional path and role detection methods that would allow devices to select a preference for a specific role. Furthermore, dual-role devices that implement USB Power Delivery may independently and dynamically swap data and power roles using the Data Role Swap or Power Role Swap processes. This allows for charge-through hub or docking station applications where the USB-C device acts as a USB data host while acting as a power consumer rather than a source.
   A brief hardware roundup in July 2010 by SemiAccurate found that Gigabyte Technology had introduced working UAS drivers for their boards using NEC/Renesas chips, and that—on the hardware level at least—"the LucidPort USB 300 and USB302, Symwave SW6315, Texas Instruments TUSB9260 and the VLI VL700 controllers all support UASP, while as far as we could find, the ASMedia ASM1051 and ASM1051E as well as the Fujitsu MB86C30A doesn’t."
   In order to uniquely identify each instance of each device that is installed, Windows assigns an "Instance ID" to each device. This ID contains location information, or a serial number if supported.
  
  Combining the Device ID with the Instance ID gives a string which uniquely identifies an individual device in a system. This is the "Device Instance ID". An example of a string from a PCI device is:
  
  When Windows discovers a new device, it stores the Device Instances in the Registry from:
   The host periodically polls the device's interrupt IN endpoint during operation. When the device has data to send it forms a report and sends it as a reply to the poll token. Common devices such as keyboards and mice send reports that are compliant with standards set by the USB Implementers Forum (USB-IF). When a vendor makes a custom USB HID class device, the reports formed by the device need to match the report description given during enumeration and the driver installed on the host system. In this way it is possible for the USB HID class to be extremely flexible.
   Hardware detection operates somewhat differently depending on whether or not Advanced Configuration and Power Interface (ACPI) is supported by the hardware. It passes on the hardware details gathered from the BIOS onto the OS. If ACPI is supported, the list of found devices is handed to the kernel, Windows will take responsibility for assigning each device some resources. On older hardware, where ACPI is not supported, the BIOS takes responsibility for assigning resources, not the operating system, so this information is passed to the kernel as well.
   Apple Computer's Mac OS 9 and X support USB mass storage; Mac OS 8.5.1 supported USB mass storage through an optional driver.
  
  Section::::Operating system support.:Linux.
   A recent development for the use of a USB Flash Drive as an application carrier is to carry the Computer Online Forensic Evidence Extractor (COFEE) application developed by Microsoft. COFEE is a set of applications designed to search for and extract digital evidence on computers confiscated from suspects. Forensic software is required not to alter, in any way, the information stored on the computer being examined. Other forensic suites run from CD-ROM or DVD-ROM, but cannot store data on the media they are run from (although they can write to other attached devices, such as external drives or memory sticks).
   BULLET::::- Bogus USB ports will be detected by desktop PCHs equipped with 6 USB ports (3420, H55) on the first EHCI controller. This can happen when AC power is removed after entering ACPI S4. Applying AC power back and resuming from S4 may result in non detected or even non functioning USB device (erratum 12)
   After entering debug accessory mode, optional orientation detection via the CC1 and CC2 is done via setting CC1 as a pullup of Rd resistance and CC2 pulled to ground via Ra resistance (From the test system type-c plug). While optional, orientation detection is required if you want usb power delivery communication to be functional. 
   USB OTG introduces the concept of a device performing both master and slave roles whenever two USB devices are connected and one of them is a USB OTG device, they establish a communication link. The device controlling the link is called the master or host, while the other is called the slave or peripheral.
   Section::::Compatibility.
  
  For purposes of discussing compatibility, remember that SCSI devices include both host adapters and peripherals such as disk drives. When you ask whether you can cable a certain host adapter to a certain disk drive, you are asking whether you can attach those two SCSI devices to the same SCSI bus.
  
  Different SCSI transports, which are not compatible with each other, usually have unique connectors
   When applied to a IEEE 1394 (also known as FireWire; i.LINK or Lynx) card, OHCI means that the card supports a standard interface to the PC and can be used by the OHCI IEEE 1394 drivers that come with all modern operating systems. Because the card has a standard OHCI interface, the OS does not need to know in advance exactly who makes the card or how it works; it can safely assume that the card understands the set of well-defined commands that are defined in the standard protocol.
  
  Section::::USB.
  
  Section::::USB.:Open Host Controller Interface.
   Another kind of profile is the device link profile. Instead of mapping between a device color space and a PCS, it maps between two specific device spaces. While this is less flexible, it allows for a more accurate or purposeful conversion of color between devices. For example, a conversion between two CMYK devices could ensure that colors using only black ink convert to target colors using only black ink.
  
  Section::::References in standards.
   The W-USB host tries to mitigate the unreliability of wireless mediums (a 10% error rate is considered acceptable for 1 kB packets; in wired media this value is usually around 10) maintaining counters and statistics for each device and possible requesting information from them. It can also access and modify the "transmit power control" functions of each device, as well as change transmission parameters such as data payload size and bandwidth adjustments.
   USB OTG recognizes that a device can perform both master and slave roles, and so subtly changes the terminology. With OTG, a device can be either a host when acting as a link master, or a "peripheral" when acting as a link slave. The choice between host and peripheral roles is handled entirely by which end of the cable the device is connected to. The device connected to the "A" end of the cable at start-up, known as the "A-device", acts as the default host, while the "B" end acts as the default peripheral, known as the "B-device".
   When an active set of USB-C headphones or adapter is used, digital audio is sent through the USB-C port. The conversion by the DAC and amplifier is done inside of the headphones or adapter, instead of on the phone. The sound quality is dependent on the headphones/adapter's DAC. Active adapters with a built-in DAC have near-universal support for devices that output digital and analog audio, adhering to the Audio Device Class 3.0 and Audio Adapter Accessory Mode specifications.
   Section::::Storage.:Datel Data Transfer Kit.
  
  Datel's Transfer Kit for Xbox 360 allows users to transfer data from their Xbox 360 memory cards to a PC.
  
  Section::::Storage.:USB Storage Devices.
  
  The Xbox 360 can read USB storage devices such as thumb drives, Zunes, iPods (except iPod Touch and iPhone), MP3 players, PSPs, and hard drives, however an Optional Media Update is required to play music and other files from certain music players, this is available from the Xbox Live Marketplace.
   While the master-slave arrangement works for some devices, many devices can act either as master or as slave depending on what else shares the bus. For instance, a computer printer is normally a slave device, but when a USB flash drive containing images is plugged into the printer's USB port with no computer present (or at least turned off), it would be useful for the printer to take on the role of host, allowing it to communicate with the flash drive directly and to print images from it.
   BULLET::::- Bogus USB ports will be detected by mobile PCH equipped with 6 USB ports (HM55) on the first EHCI controller. This can happen when AC power and battery are removed after entering ACPI S4. Applying AC power or battery back and resuming from S4 may result in non detected or even non functioning USB device (erratum 13)
  
  BULLET::::- Reading the HPET comparator timer immediately after a write returns the old value (erratum 14)
  
  BULLET::::- SATA 6Gbit/s devices may not be detected at cold boot or after ACPI S3, S4 resume (erratum 21)
  
  Section::::Langwell.
  