Improved techniques for performing data transfer with respect to a
portable electronic device are disclosed. The improved techniques enable
the rate of data transfer to be dependent on at least one battery
attribute of a battery utilized by the portable electronic device. As an
example, the at least one battery attribute can be associated with a
charge level of the battery. In one embodiment, when the charge level of
the battery is deemed low, the rate of data transfer can be restricted,
thereby reducing the rate of power consumption. Typically, data transfer
is performed between the portable electronic device and a host device via
a cable. The cable also provides power from the host device to the
portable electronic device. Hence, by reducing the rate of data transfer
when the charge level of the battery is low, power consumption of the
portable electronic device can be controlled so that it is not more than
the amount of power capable of being supplied to the portable electronic
device over the cable. The portable electronic device can, for example,
be a portable data storage device (e.g., portable disk drive) or a
portable media device (e.g., portable media player).