An electronic device can operate as an external device of an information
processing apparatus. The electronic device includes a connecting unit
for connecting to the information processing apparatus, a command
processor for processing a command sent from the information processing
apparatus through the connecting unit, a rechargeable battery, a charging
controller for controlling a charging operation of the rechargeable
battery, and an operating mode managing unit which, when the connecting
unit is connected to an interface having a power-supply function, selects
one of a normal operating mode in which the electronic device operates as
the external device of the information processing apparatus, and a
charging mode in which the electronic device stops operating as the
external device of the information processing apparatus and charges the
rechargeable battery. The command processor processes the command in
accordance with the selected operating mode.