Where is wpdmtpextensions.h?

The header file – Wpdmtpextensions.h – has been referenced in several of my posts and is needed to talk MTP to the device through WPD. The header file is not available in the Vista SDK/WDK or the WMP 11 SDK, but is planned for inclusion in the Windows Server code name “Longhorn” SDK. I’ve just…

0

MTP array properties (AINT*/AUINT*) in WPD

MTP allows for a wide range of array-based data types ranging from an array of bytes (AINT8/AUINT8) to an array of GUIDs (AINT128/AUINT128). Check out section 3.2.1 and 3.2.2 in the MTP specification for a complete list and definition. Unfortunately the WPD API is restricted in the kind of arrays it can expose. Specifically, the…

1

Accessing MTP vendor extended properties through WPD

Apart from the standard device and object properties defined in the MTP specification, device vendors are free to add their own properties. The codes for these properties must lie in the vendor-extension range as defined by the MTP spec in section 3.3.1. Specifically, the range for vendor-extended device properties is 0xD000-0xD3FF and the range for vendor-extended…

0

Sending MTP commands through WPD (Part 3 – data from device)

Let’s use the GetDevicePropValue command (MTP spec – section D.2.21) to illustrate this. GetDevicePropValue takes one parameter – the device property code that we want to retrieve the current value for. We’ll retrieve the BatteryLevel device property (MTP spec – section C.2.2) which is of type UINT8. From the WPD API, we will need this sequence of…

1

Sending MTP commands through WPD (Part 2 – data to the device)

We’ll pick the SetDevicePropValue MTP command (MTP spec – section D.2.22) to illustrate this example. This command requires the device property code as a parameter. We’ll try setting the DateTime property (MTP spec – section C.2.18). The DateTime property is of type STRING and we’ve already covered in a previous post on how MTP strings…

2

Creating an MTP string

In some of our later examples, we’ll have to send MTP strings to the device. MTP strings are defined in the MTP spec in section 3.2.3. Briefly, the first byte is the number of Unicode characters to follow (including the NULL terminator), the remaining bytes are the characters. The conversion is pretty simple and is…

1

Listening to MTP events

MTP devices can fire events as well. These events are used to educate the PC (or the initiator) about any change in device status. Think of a scenario where you connect a camera extension to an MTP cellphone. The configuration of the cellphone has now changed since it supports camera settings. The device can inform…

1

Sending MTP commands through WPD (Part 1 – without a data phase)

Most WPD API are wrappers around the SendCommand API. The documentation for the SendCommand API provides a pretty good example on how to send commands to a driver. So rather than reinvent the wheel, we’ll take a look at how we can use the SendCommand API to send a custom MTP command to an MTP…

3

What is MTP anyway?

MTP is the successor to PTP (Picture Transfer Protocol) that has been used by cameras. Since PTP was geared towards pictures (the first P in PTP), MTP was designed to be a more media-centric solution (and hence the M for media in MTP) and offers More-Than-PTP :). MTP is an extension to PTP and all PTP…

2