Share via


MTP Responder Stack Source Code Modification (Compact 7)

3/12/2014

You can modify or extend the provided MTP responder stack implementation to add Device Stage features that are specific to your device. For example, you can add MTP device services extensions to support device tasks for features such as credentials provisioning or device firmware upgrades. You can also create your own event handlers to report transfer progress or device connection and disconnection. In some cases, you may find it necessary to customize the MTP responder stack to make performance or resource optimizations that are unique to your device or to add support for a new MTP transport protocol. You may need to make other changes to accommodate specific device communication with Windows Media Player on host computers that are running Windows 7, Windows Vista, or Windows XP. To make modifications and extensions to the MTP responder stack for your device, see the MTP Responder common source code at the following location:

%_WINCEROOT%\Public\Mediaapps\Oak\MTP\Common\MTP

The source files in the location above are not specific to Windows Embedded Compact 7. They are derived from the MTP Responder reference implementation that is included in the Portable Device Enabling Kit. You can use these files to modify the core MTP Responder stack functionality, which includes the following:

  • MTP dispatcher
  • MTP router
  • MTP common command handler functionality
  • MTP core command handler
  • MTP command lookup table
  • Common code to support MTP transports
  • Support for USB, TCP/IP, and other transports
  • Message queue library
  • MTP format and properties library
  • MTP event manager and event handlers
  • MTP performance logger

The MTP Responder stack source code that is specific to Windows Embedded Compact 7 is available at the following location:

%_WINCEROOT%\Public\Mediaapps\Oak\MTP\Wince\Src\MTP

These source files implement MTP extensions that integrate the MTP Responder stack with Compact 7 in the following ways:

  • Functionality to report media and Device Stage information back to the MTP initiator, such as device product description, manufacturer name, serial number, model ID, device icon, and battery level.
  • Platform service layer functionality that is unique to Windows Embedded Compact 7, including atomic functions, debug utilities, memory management, thread management, timer utilities, sockets, and message queues.
  • Implementation of the MTP status service: generation of reports about battery level and storage space by calling OEM adaptation layer (OAL) functions and returning the results to the MTP initiator.
  • Implementation of the MTP device metadata service.
  • MTP transport functionality for USB and network devices that run Compact 7.

The MTP Responder source code is written in ANSI C. Depending on your objectives and the extent of the modifications or extensions that you want to make to your implementation of the MTP Responder, you can modify any or all of the source code at these two locations.

See Also

Concepts

Inside MTP Responder
MTP Responder Stack