Close

A Mac and an iPad walk into a bar, Part 3

marco-tabiniMarco Tabini wrote 05/03/2026 at 20:55 • 6 min read • Like

Over the last several months, I have been working on Dr. PD, an open-source USB Power Delivery analyzer and programmable sink. Diving deep into the world of USB-PD and USB-C has given me a unique appreciation for these rich technologies, and I want to share some of the things I have learned.

As we saw in the previous part, it has taken 35 messages for the Mac and the iPad to set up a basic power contract and establish USB serial communications. There still remains an important task: negotiating a long-term power arrangement.

Recall that both devices are Dual-Role Ports, meaning that they can act as either source or sink based on demand. In practice, the Mac will usually act as the source — though not always, since there are ways to charge the Mac from an iPad, which is quite cool — but that does not diminish the need for a more thorough inspection of the iPad’s power requirements.

After all, there might be multiple devices connected to the Mac’s four USB-C ports, and the Mac itself has a limited amount of power available to charge other devices, even when it is connected to mains power. Therefore, its power-management system needs to understand the needs of each connected device so it can better balance the amount of power sent to each port.

Phase 5: I've got the power

The power negotiation begins with the Mac asking the iPad about its identity and battery setup:

Get Battery Cap

Source

Sink

Battery capability request:

  • Requested battery reference: 0

Battery Capabilities

Sink

Source

Battery capabilities:

  • USB Vendor ID: 0x05AC
  • Product ID: 0x0000
  • Design capacity: 40Wh
  • Last full-charge capacity: 40Wh
  • Battery reference: valid

Get Battery Status

Source

Sink

Battery status request:

  • Requested battery reference: 0

Battery Status

Sink

Source

Battery status:

  • Battery is present.
  • Present capacity: 40Wh
  • Charging state: charging.

Get Status

Source

Sink

Status

Sink

Source

Port status:

  • Internal temperature: unsupported
  • Present inputs: none
  • Present battery input: none
  • Event flags: none
  • Temperature status: not supported
  • Power status: not limited
  • Power state change: not present in 6-byte SDB

Get Manufacturer Info

Source

Sink

Manufacturer information request:

  • Target: 0
  • Reference: 0

Manufacturer Info

Sink

Source

Manufacturer information:

  • USB Vendor ID: 0x05AC
  • Product ID: 0x7109
  • Manufacturer string: iPad

In this exchange, the Mac first asks the iPad for information about its battery. Recall from Part 1 that the Mac learned the iPad has one battery from the Sink_Capabilities_Extended message. The iPad replies that it has a 40 Wh capacity, and that the last full charge also brought the battery to 40 Wh. This, incidentally, is a lie: this iPad’s battery is on its last legs and barely reaches 80% capacity.

Next, the Mac asks for the status of the iPad’s battery. The iPad replies that it is full and that it is charging. That is true on both counts, since the battery was at maximum charge and the iPad was topping it up with power from the Mac.

The Mac then asks for the iPad’s status so that it can determine whether there are any conditions, such as an overtemperature warning, that could affect the power profile. The iPad’s response is entirely unremarkable—to the point that it is probably perfunctory rather than a reflection of its actual status.

Finally, the Mac asks for the iPad's manufacturer information, and the iPad replies with its name, VID, and PID.

Phase 6: My turn

We're finally getting into the home stretch now. 

Get Source Cap Extended                                                          

Sink                 

Source            

Source Capabilities Extended

Source

Sink

Source capabilities extended information:

  • USB Vendor ID: 0x05AC
  • Product ID: 0x7308
  • XID value: 0x00000000
  • Firmware version: 0
  • Hardware version: 0
  • Voltage regulation: 150 mA/µs load step; 25% IoC load step magnitude
  • Holdup time: 0 ms
  • Compliance: No asserted compliance flags
  • Touch current: No asserted touch-current flags
  • Peak current 1: 0% overload for 0 ms at 0% duty cycle; VBUS voltage droop not allowed
  • Peak current 2: 0% overload for 0 ms at 0% duty cycle; VBUS voltage droop not allowed
  • Peak current 3: 0% overload for 0 ms at 0% duty cycle; VBUS voltage droop not allowed
  • Touch temperature: IEC 60950-1
  • Source inputs: external supply present, external supply unconstrained, internal battery present
  • Fixed batteries: 1
  • Hot-swappable battery slots: 0
  • Standard Power Range source power data profile rating: 7W
  • Extended Power Range source power data profile rating: unavailable (legacy 24-byte SCEDB)

Could not decode all source capability data: Legacy 24-byte Source Capabilities Extended Data Block: missing EPR Source PDP Rating byte required by USB PD 3.2.

Get Sink Cap Extended

Sink

Source

Sink Capabilities Extended

Source

Sink

Sink capabilities extended information:

  • USB Vendor ID: 0x05AC
  • Product ID: 0x7308
  • XID value: 0x00000000
  • Firmware version: 0
  • Hardware version: 0
  • Sink capabilities extended data block version: Version 1.0
  • Load step: 150 mA/µs load step
  • Sink load characteristics: 0% overload for 0 ms at 0% duty cycle; VBUS voltage droop not tolerated
  • Compliance: No asserted compliance requirements
  • Touch temperature: Not applicable
  • Fixed batteries: 1
  • Hot-swappable battery slots: 0
  • Sink modes: VBUS powered, battery powered
  • Standard Power Range sink power data profile: minimum 5W, operational 30W, maximum 94W
  • Extended Power Range sink power data profile: unavailable (legacy 21-byte SKEDB)

Could not decode all sink capability data: Legacy 21-byte Sink Capabilities Extended Data Block: missing EPR Sink PDP bytes required by USB PD 3.2.

Get Battery Cap

Sink

Source

Battery capability request:

  • Requested battery reference: 0

Battery Capabilities

Source

Sink

Battery capabilities:

  • USB Vendor ID: 0x05AC
  • Product ID: 0x0000
  • Design capacity: 700
  • Last full-charge capacity: 700
  • Battery reference: valid

Get Battery Status

Sink

Source

Battery status request:

  • Requested battery reference: 0

Battery Status

Source

Sink

Battery status:

  • Battery is present.
  • Present capacity: 70Wh
  • Charging state: charging.

Get Status

Sink

Source

Status

Source

Sink

Port status:

  • Internal temperature: unsupported
  • Present inputs: none
  • Present battery input: none
  • Event flags: none
  • Temperature status: not supported
  • Power status: not limited
  • Power state change: not present in 6-byte SDB

Get Manufacturer Info

Sink

Source

Manufacturer information request:

  • Target: 0
  • Reference: 0

Manufacturer Info

Source

Sink

Manufacturer information:

  • USB Vendor ID: 0x05AC
  • Product ID: 0x7308
  • Manufacturer string: Macintosh

Vendor Defined

Sink

Source

Structured Vendor Defined Message: DISCOVER_IDENTITY REQ

  • Meaning: Requests identity information from the partner, including product type, USB VID/PID, certification ID, and product-type VDOs.
  • Standard or Vendor ID: 0xFF00
  • Structured Vendor Defined Message version: 1.0

Vendor Defined

Source

Sink

Structured Vendor Defined Message: DISCOVER_IDENTITY ACK

  • Meaning: Returns identity information such as product type, USB VID/PID, certification ID, and product-type VDOs.
  • Standard or Vendor ID: 0xFF00
  • Structured Vendor Defined Message version: 1.0

Discover Identity data:

  • USB Vendor ID: 0x05AC
  • Capabilities: USB host, USB device, modal operation
  • Certification identifier: 0x00000000
  • USB Product ID: 0x7308
  • Device release number: 0x2170
  • Upstream-facing port Vendor Data Object:
    • Device capability bits: 0b1101
    • VCONN required: no
    • VBUS required: yes
    • Alternate mode bits: 0b111
    • Highest USB speed: USB4 Gen3
  • Upstream-facing port Vendor Data Object:
    • Device capability bits: 0b0111
    • VCONN required: no
    • VBUS required: yes
    • Alternate mode bits: 0b000
    • Highest USB speed: USB 2.0 only

These are essentially the same messages that the Mac sent to the iPad, only in reverse. Note how the iPad asks the Mac for both its source and sink capabilities. This is necessary to determine whether it should request a role swap, which, if accepted by the Mac, would cause the source and sink roles to reverse.

In this case, no role swap takes place, because there is no reason for one. Instead, the two devices finally decide that it is time to speak in their own dialect.

Phase 7: Secret lovers

With power negotiations out of the way, the Mac and the iPad take full advantage of the Vendor_Defined message’s ability to carry arbitrary information, exchanging a flurry of opaque data:

Vendor Defined

Source

Sink

Unstructured Vendor Defined Message

  • Standard or Vendor ID: 0x05AC
  • Vendor payload: 0x101

Vendor payload Vendor Data Objects:

  • 0x00000000

Vendor Defined

Sink

Source

Unstructured Vendor Defined Message

  • Standard or Vendor ID: 0x05AC
  • Vendor payload: 0x111

Vendor payload Vendor Data Objects:

  • 0x20000002

Vendor Defined

Source

Sink

Unstructured Vendor Defined Message

  • Standard or Vendor ID: 0x05AC
  • Vendor payload: 0x101

Vendor payload Vendor Data Objects:

  • 0x00000004

Vendor Defined

Sink

Source

Unstructured Vendor Defined Message

  • Standard or Vendor ID: 0x05AC
  • Vendor payload: 0x111

Vendor payload Vendor Data Objects:

  • 0x00030029

And so on, another forty times or so. Unfortunately, there is no way to tell what the two devices are saying to each other, but it certainly looks like an interesting conversation—or, at least, a pretty detailed one.

This kind of deep exploration is just one of the many activities that a USB-PD protocol analyzer like Dr. PD enables! It also lets you troubleshoot faulty connections, characterize power supplies, and much more! If you want your own, you can join our prelaunch page on Crowd Supply for product updates, or stay tuned here for more posts on USB-C, Power Delivery, and the hardware design behind Dr. PD.

Like

Discussions