Device Classes
195
transfer image files from a camera, another option is to use the mass-storage
class.
&QEWOGPVCVKQP
The still-image class specification uses features and commands from PIMA
15740: 2000 Picture Transfer Protocol (PTP), which describes requirements for
transferring files and controlling digital still cameras. The PIMA document is
available from the International Imaging Industry Association (I3A) at
www.i3a.org.
The USB-IF’s Media Transfer Protocol specification is an extension of the Pic-
ture Transfer Protocol for use with digital cameras and other devices that have
significant storage capacity and fulfill their primary purpose while not con-
nected to the bus. For example, a digital camera stores images, and users typi-
cally attach the camera to the bus only to transfer images.
1XGTXKGY
A still-image device has one bulk IN endpoint and one bulk OUT endpoint for
transferring both image data and non-image data. The specification also
requires an interrupt IN endpoint for event data.
In the bulk and interrupt pipes, information travels in structures called contain-
ers. The four container types are the Command Block, Data Block, Response
Block, and Event Block. The bulk OUT pipe carries Command and Data
Blocks. The bulk IN pipe carries Data and Response Blocks. The interrupt IN
pipe carries Event Blocks.
On the bulk pipes, the host communicates by using a protocol with three
phases: Command, Data, and Response. A short packet indicates the end of a
phase. In the Command phase, the host sends a Command Block that names
an operation defined in PIMA 15740. The Command Block contains an oper-
ation code that determines if the operation requires a data transfer and if so, the
direction of data transfer. In a data transfer, the data travels in a Data Block in
the Data phase. The first four bytes of the Data Block are the length in bytes of
the data being transferred. Some operations have no Data phase. The final
phase is the Response phase, where the device sends a Response Block contain-
ing completion information.
On the interrupt pipe, an Event Block can contain up to three Event Codes
with status information such as a low-battery warning or a notification that a
memory card has been removed. The Check Device Condition Event Code