JP2008027213A - Electronic apparatus and response transfer method - Google Patents

Electronic apparatus and response transfer method Download PDF

Info

Publication number
JP2008027213A
JP2008027213A JP2006199362A JP2006199362A JP2008027213A JP 2008027213 A JP2008027213 A JP 2008027213A JP 2006199362 A JP2006199362 A JP 2006199362A JP 2006199362 A JP2006199362 A JP 2006199362A JP 2008027213 A JP2008027213 A JP 2008027213A
Authority
JP
Japan
Prior art keywords
response
usb
transferred
mass storage
usb host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2006199362A
Other languages
Japanese (ja)
Inventor
Mitsufumi Fukushima
充史 福島
Eiji Minami
栄二 南
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2006199362A priority Critical patent/JP2008027213A/en
Publication of JP2008027213A publication Critical patent/JP2008027213A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an electronic apparatus and a response transfer method which allow a state of a USB device connected to a USB host interface to be normally monitored from a USB host connected to a USB device interface. <P>SOLUTION: The electronic apparatus includes: the USB device interface for connection to the USB host; the USB host interface for connection of the USB device; a transfer means which transfers a response to a command transmitted from the USB host interface to the USB device, to the USB device interface in response to reception of the command from the USB host by the USB device interface; and a determination means which determines whether there is possibility that a response to be next transferred is inconsistent with communication procedures because of transfer of the response or not and causes the transfer means to transfer the response when there is no possibility of inconsistency, and transfers the transferred response again till elimination of possibility of inconsistency when there is possibility of inconsistency and transfers the response after elimination of possibility of inconsistency. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、電子機器および応答転送方法に関する。   The present invention relates to an electronic device and a response transfer method.

USBホストに接続するためのUSBデバイスインタフェースを備えるプリンタ(電子機器)が知られている(例えば特許文献1参照)。
ところで、USBホストに接続するためのUSBデバイスインタフェースとUSBデバイスを接続するためのUSBホストインタフェースとを電子機器に備えると、電子機器をUSBホストに対してUSBデバイスとして動作させることができるとともに、電子機器をUSBデバイスに対してUSBホストとして動作させることができる。
A printer (electronic device) having a USB device interface for connecting to a USB host is known (see, for example, Patent Document 1).
By the way, if an electronic device is provided with a USB device interface for connecting to a USB host and a USB host interface for connecting a USB device, the electronic device can be operated as a USB device with respect to the USB host, and electronic The device can be operated as a USB host for the USB device.

電子機器をこのように構成した場合、USBホストから受信したコマンドをUSBデバイスに転送するとともに、USBデバイスから受信した応答をUSBホストに転送することにより、USBホストに対してあたかもUSBデバイスが直に接続されているかのように見せかけることができる。これにより、電子機器に加えてUSBホストもUSBデバイスを利用することが可能になる。   When the electronic device is configured in this way, the command received from the USB host is transferred to the USB device, and the response received from the USB device is transferred to the USB host. It can appear to be connected. Thereby, in addition to the electronic device, the USB host can also use the USB device.

上述した構成の場合、USBホストは電子機器を介してUSBデバイスの状態を監視することになる。しかしながら、電子機器が単にUSBホストとUSBデバイスとの間でコマンドとそれに対する応答とを転送するのみでは、USBホストはUSBデバイスの状態を正常に監視できないという問題がある。   In the case of the configuration described above, the USB host monitors the state of the USB device via the electronic device. However, there is a problem that the USB host cannot normally monitor the state of the USB device when the electronic device merely transfers a command and a response to the command between the USB host and the USB device.

特開2002−236562号公報JP 2002-236562 A

本発明は、上述の問題に鑑みて創作されたものであって、USBデバイスインタフェースに接続されているUSBホストから、USBホストインタフェースに接続されているUSBデバイスの状態を正常に監視できる電子機器および応答転送方法を提供することを目的とする。   The present invention has been created in view of the above-described problems, and an electronic device that can normally monitor the state of a USB device connected to the USB host interface from a USB host connected to the USB device interface, and It is an object to provide a response transfer method.

(1)上記目的を達成するための電子機器は、USBホストに接続するためのUSBデバイスインタフェースと、USBデバイスを接続するためのUSBホストインタフェースと、前記USBデバイスインタフェースが前記USBホストからコマンドを受信すると、前記USBホストインタフェースが前記USBデバイスに送信したコマンドに対する応答を前記USBデバイスインタフェースに転送する転送手段と、前記応答を転送すると次に転送する応答が通信手順に整合しなくなる可能性があるかを判定し、整合しなくなる可能性がない場合は前記転送手段に前記応答を転送させ、整合しなくなる可能性がある場合は整合しなくなる可能性がなくなるまで前回転送した応答を再転送させ、整合しなくなる可能性がなくなった後に前記応答を転送させる判定手段と、を備える。
本発明によると、応答を転送するとき、その応答を転送すると次に転送する応答が通信手順に整合しなくなる可能性があるかを判定し、整合しなくなる可能性がある場合は整合しなくなる可能性がなくなるまで前回転送した応答を再転送させ、整合しなくなる可能性がなくなった後に前記応答を転送させるので、通信手順に整合しなくなることを確実に防止できる。よって本発明によると、USBデバイスインタフェースに接続されているUSBホストから、USBホストインタフェースに接続されているUSBデバイスの状態を正常に監視できる。
(1) An electronic device for achieving the above object includes a USB device interface for connecting to a USB host, a USB host interface for connecting a USB device, and the USB device interface receiving a command from the USB host. Then, there is a possibility that the transfer means for transferring the response to the command transmitted from the USB host interface to the USB device to the USB device interface and the response to be transferred next may not match the communication procedure when the response is transferred. If there is no possibility of being inconsistent, the transfer means transfers the response, and if there is a possibility of inconsistency, the previous transferred response is retransmitted until there is no possibility of being inconsistent. Said response after the possibility of not And a determination means for forwarding.
According to the present invention, when a response is transferred, if the response is transferred, it is determined whether or not the next transferred response may be inconsistent with the communication procedure. Since the response that was transferred last time is re-transferred until there is no longer a possibility and the response is transferred after there is no possibility of being inconsistent, it is possible to reliably prevent the communication procedure from being inconsistent. Therefore, according to the present invention, the state of the USB device connected to the USB host interface can be normally monitored from the USB host connected to the USB device interface.

(2)前記転送手段は、前記USBホストインタフェースが前記USBホストから前回転送した応答の次の応答を未だ受信していない場合は前回転送した応答を再転送してもよい。前記判定手段は、前記応答が連続して送信できない応答であり且つ前記USBホストインタフェースが前記USBデバイスから前記応答の次の応答を未だ受信していない場合は前記通信手順に整合しなくなる可能性があると判定し、前記USBホストインタフェースが前記USBデバイスから次の応答を受信するまで前回転送した応答を再転送させ、前記USBホストインタフェースが次の応答を受信した後に前記応答を転送させてもよい。
本発明によると、電子機器はUSBホストからコマンドを受信したとき、前回転送した応答の次の応答をUSBデバイスから未だ受信していない場合は前回転送した応答を再転送するので、受信したコマンドに対して確実に応答を返すことができる。
また、本発明では転送対象の応答が連続して送信できない応答であり且つUSBホストインタフェースがUSBデバイスから当該転送対象の応答の次の応答を未だ受信していない場合は、USBホストインタフェースが次の応答を受信した後に当該転送対象の応答を転送させる。このため、連続して送信できない応答を転送した後、USBデバイスインタフェースがUSBホストから次のコマンドを受信したときに、USBホストインタフェースがUSBデバイスから次の応答を未だ受信していないという状況は起き得ない。従って、連続して送信できない応答が再転送されることを確実に防止できる。これにより、連続して送信できない応答を連続して送信してしまうことによって通信手順に整合しなくなることを防止できる。
(2) If the USB host interface has not yet received a response next to the response previously transferred from the USB host, the transfer means may retransfer the response transferred last time. The determination means may be inconsistent with the communication procedure when the response is a response that cannot be continuously transmitted and the USB host interface has not yet received a response next to the response from the USB device. It may be determined that there is, and the previously transferred response is retransferred until the USB host interface receives the next response from the USB device, and the response may be transferred after the USB host interface receives the next response. .
According to the present invention, when the electronic device receives a command from the USB host, if the response next to the previously transferred response has not been received from the USB device, the electronic device retransfers the previously transferred response. A response can be surely returned.
Also, in the present invention, when the response to be transferred is a response that cannot be continuously transmitted and the USB host interface has not yet received the response next to the response to be transferred from the USB device, the USB host interface After receiving the response, the response to be transferred is transferred. For this reason, after transferring a response that cannot be transmitted continuously, when the USB device interface receives the next command from the USB host, the USB host interface has not yet received the next response from the USB device. I don't get it. Therefore, it is possible to reliably prevent a response that cannot be continuously transmitted from being retransmitted. As a result, it is possible to prevent a response that cannot be continuously transmitted from being continuously transmitted and thereby being inconsistent with the communication procedure.

(3)前記USBホストはUSBマスストレージ・ホストであり、前記USBデバイスはUSBマスストレージ・デバイスであり、前記コマンドは、前記USBマスストレージ・デバイスの状態を問い合わせる問い合わせコマンドであってもよい。   (3) The USB host may be a USB mass storage host, the USB device may be a USB mass storage device, and the command may be an inquiry command that inquires about the state of the USB mass storage device.

(4)前記連続して送信できない応答は、記憶メディアの状態が変化した可能性があることを示す応答であってもよい。   (4) The response that cannot be continuously transmitted may be a response indicating that the state of the storage medium may have changed.

(5)前記転送手段は、転送対象の応答が記憶メディアを起動中でアクセスできないことを示す応答である場合は転送せずに読み飛ばしてもよい。
記憶メディアを起動中でアクセスできない場合はいずれ別の状態に変化するので、読み飛ばしても問題はなく、読み飛ばすことによって通信量を低減できる。
(5) If the response to be transferred is a response indicating that the storage medium is being activated and cannot be accessed, the transfer means may skip reading without transferring.
When the storage medium is activated and cannot be accessed, the state changes to another state. Therefore, there is no problem even if skipping, and the amount of communication can be reduced by skipping.

(6)前記転送手段は、転送対象の応答の後に記憶メディアがセットされていないことを示す応答を受信済みの場合は、前記記憶メディアがセットされていないことを示す応答の前に受信した応答を転送せずに読み飛ばしてもよい。
記憶メディアがセットされていないことを示す応答を受信している場合は、記憶メディアがセットされていないことを示す応答の前に受信した応答を転送しても無意味である。従って、それらの応答を読み飛ばすことによって通信量を低減できる。
(6) If the transfer means has received a response indicating that the storage medium is not set after the response to be transferred, the response received before the response indicating that the storage medium is not set You may skip reading without transferring.
When the response indicating that the storage medium is not set is received, it is meaningless to transfer the received response before the response indicating that the storage medium is not set. Therefore, the amount of communication can be reduced by skipping these responses.

(7)前記記憶メディアはリムーバブルメディアであってもよい。   (7) The storage medium may be a removable medium.

(8)前記USBマスストレージ・デバイスに記憶されている画像データを前記USBホストインタフェースを介して取得し、取得した前記画像データを印刷媒体に印刷する印刷手段を更に備えてもよい。   (8) The image processing apparatus may further include a printing unit that acquires image data stored in the USB mass storage device via the USB host interface and prints the acquired image data on a print medium.

(9)原稿に形成されている画像を読み取って画像データを生成し、生成した前記画像データを前記USBホストインタフェースを介して前記USBマスストレージ・デバイスに書き込む画像読み取り手段を更に備えてもよい。   (9) An image reading unit that reads an image formed on a document to generate image data and writes the generated image data to the USB mass storage device via the USB host interface may be further provided.

(10)上記目的を達成するための応答転送方法は、USBホストに接続するためのUSBデバイスインタフェースと、USBデバイスを接続するためのUSBホストインタフェースとを備える電子機器を用いた応答転送方法であって、前記USBデバイスインタフェースが前記USBホストからコマンドを受信すると、前記USBホストインタフェースが前記USBデバイスに送信したコマンドに対する応答を前記USBデバイスインタフェースに転送する転送段階と、前記応答を転送すると次に転送する応答が通信手順に整合しなくなる可能性があるかを判定し、整合しなくなる可能性がない場合は前記転送手段に前記応答を転送させ、整合しなくなる可能性がある場合は整合しなくなる可能性がなくなるまで前回転送した応答を再転送させ、整合しなくなる可能性がなくなった後に前記応答を転送させる判定段階と、を含む。
本発明によると、USBデバイスインタフェースに接続されているUSBホストから、USBホストインタフェースに接続されているUSBデバイスの状態を正常に監視できる。
(10) A response transfer method for achieving the above object is a response transfer method using an electronic device having a USB device interface for connecting to a USB host and a USB host interface for connecting a USB device. When the USB device interface receives a command from the USB host, the USB host interface transfers a response to the command transmitted to the USB device to the USB device interface. It is determined whether there is a possibility that the response to be inconsistent with the communication procedure, and if there is no possibility that the response will not be consistent, the response is transferred to the transfer means. Retransmit previously forwarded response until lost Thereby, including a determination step of forwarding the response after the lost potential to become consistent.
According to the present invention, the state of the USB device connected to the USB host interface can be normally monitored from the USB host connected to the USB device interface.

尚、本発明に備わる複数の手段の各機能は、構成自体で機能が特定されるハードウェア
資源、プログラムにより機能が特定されるハードウェア資源、又はそれらの組み合わせに
より実現される。また、これら複数の手段の各機能は、各々が物理的に互いに独立したハ
ードウェア資源で実現されるものに限定されない。
The functions of the plurality of means provided in the present invention are realized by hardware resources whose functions are specified by the configuration itself, hardware resources whose functions are specified by a program, or a combination thereof. The functions of the plurality of means are not limited to those realized by hardware resources that are physically independent of each other.

以下、本発明の実施の形態を実施例に基づいて説明する。
図2は、本発明の一実施例に係る電子機器としてのマルチファンクションプリンタ(MFP)10のハードウェア構成を示すブロック図である。MFP10は、USBマスストレージ・デバイス11、原稿に形成されている画像を読み取って画像データを生成し、PC(Personal Computer)12やUSBマスストレージ・デバイス11に出力するスキャンユニット13、PC12から入力される画像データやUSBマスストレージ・デバイス11に記憶されている画像データを印刷媒体に印刷するプリントユニット14などを有している。MFP10は、PC12に制御されて動作することも、PC12に制御されずに単体で動作することも可能に構成されている。
Hereinafter, embodiments of the present invention will be described based on examples.
FIG. 2 is a block diagram showing a hardware configuration of a multifunction printer (MFP) 10 as an electronic apparatus according to an embodiment of the present invention. The MFP 10 is input from a USB mass storage device 11, a scan unit 13 that reads an image formed on a document, generates image data, and outputs the image data to a PC (Personal Computer) 12 or the USB mass storage device 11. And a print unit 14 for printing image data stored in the USB mass storage device 11 on a print medium. The MFP 10 is configured to operate under the control of the PC 12 or to operate independently without being controlled by the PC 12.

スキャンユニット13は、照明部15、イメージセンサ17、スキャン処理部16、キャリッジ駆動部18などを備える。イメージセンサ17は、照明部15によって照明され図示しない結像光学系により受光面に結像される原稿の光学像の濃淡に相関する電気信号を出力する。スキャン処理部16はイメージセンサ17を駆動するとともにイメージセンサ17から出力されるアナログ信号をディジタル化してRAM26に出力する。キャリッジ駆動部18は、主走査方向に垂直にイメージセンサ17又は結像光学系を往復移動させる。   The scan unit 13 includes an illumination unit 15, an image sensor 17, a scan processing unit 16, a carriage driving unit 18, and the like. The image sensor 17 outputs an electrical signal that is illuminated by the illuminating unit 15 and correlates with the density of the optical image of the original image formed on the light receiving surface by an imaging optical system (not shown). The scan processing unit 16 drives the image sensor 17 and digitizes an analog signal output from the image sensor 17 and outputs the digitized signal to the RAM 26. The carriage drive unit 18 reciprocates the image sensor 17 or the imaging optical system perpendicular to the main scanning direction.

プリントユニット14は、インクジェット方式の印字ヘッド21、ヘッドキャリッジ駆動部20、送紙部22、これらを制御する印刷制御部19などを備える。印刷制御部19は、RAM26に格納された印刷データに基づいて、送紙部22に用紙を印字ヘッド21の移動方向軸線と垂直な方向に搬送させ、ヘッドキャリッジ駆動部20に用紙の搬送方向と垂直に印字ヘッド21を往復移動させ、印字ヘッド21からインクを噴射させることにより、用紙に画像を形成する。   The print unit 14 includes an inkjet print head 21, a head carriage drive unit 20, a paper feed unit 22, and a print control unit 19 that controls them. Based on the print data stored in the RAM 26, the print control unit 19 causes the paper feeding unit 22 to convey the paper in a direction perpendicular to the movement head axis of the print head 21, and causes the head carriage drive unit 20 to convey the paper conveyance direction. By vertically reciprocating the print head 21 and ejecting ink from the print head 21, an image is formed on the paper.

ディジタル画像処理部23は、解像度変換、アンシャープ処理、階調補正、二値化、分版処理等の画像処理をCPU28と協働して実行し、印刷対象の画像データから印刷データを生成するDSPなどの専用プロセッサである。
操作部24は、メニューを表示するための表示装置や、メニューを操作するためのボタン、印刷や原稿の読み取りを指示するための指示ボタンなどのユーザがMFP10を操作するための各種の操作ボタンを備えている。
The digital image processing unit 23 executes image processing such as resolution conversion, unsharp processing, gradation correction, binarization, and color separation processing in cooperation with the CPU 28, and generates print data from image data to be printed. A dedicated processor such as a DSP.
The operation unit 24 includes various operation buttons for the user to operate the MFP 10 such as a display device for displaying a menu, buttons for operating the menu, and instruction buttons for instructing printing or reading of an original. I have.

USBデバイスインタフェース29は、PC12などの外部のUSBマスストレージ・ホストにUSB接続するための通信インタフェース回路である。USBデバイスインタフェース29には、アップストリームポート32(図3参照)やUSBバスインタフェースなどのUSBプロトコルにおけるハードウェア層と、プリンタファンクション・ドライバ45(図3参照)やマスストレージファンクション・ドライバ46(図3参照)などのソフトウェア層とが実装されている。なお、ソフトウェア層の一部は制御部25で実行されてもよい。アップストリームポート32は例えばPC12のUSBホストインタフェース42(図3参照)に設けられているダウンストリームポート33(図3参照)にUSBケーブル34で接続される。   The USB device interface 29 is a communication interface circuit for USB connection to an external USB mass storage host such as the PC 12. The USB device interface 29 includes a hardware layer in the USB protocol such as an upstream port 32 (see FIG. 3) and a USB bus interface, a printer function driver 45 (see FIG. 3), and a mass storage function driver 46 (see FIG. 3). And other software layers are implemented. A part of the software layer may be executed by the control unit 25. The upstream port 32 is connected to the downstream port 33 (see FIG. 3) provided in the USB host interface 42 (see FIG. 3) of the PC 12 by a USB cable 34, for example.

USBホストインタフェース31は、USBマスストレージ・デバイス11にUSB接続するための通信インタフェース回路である。USBホストインタフェース31には、USBホストコントローラやUSBバスインタフェースなどのUSBプロトコルにおけるハードウェア層と、マスストレージクラス・ドライバ47(図3参照)などのソフトウェア層とが実装されている。なお、ソフトウェア層の一部は制御部25で実行されてもよい。   The USB host interface 31 is a communication interface circuit for USB connection to the USB mass storage device 11. The USB host interface 31 includes a hardware layer in a USB protocol such as a USB host controller and a USB bus interface, and a software layer such as a mass storage class driver 47 (see FIG. 3). A part of the software layer may be executed by the control unit 25.

USBマスストレージ・デバイス11は、USBマスストレージ・ホストに接続するためのUSBデバイスインタフェース51(図3参照)、およびマスストレージ50(図3参照)を備えている。
USBマスストレージ・デバイス11が備えるUSBデバイスインタフェース51は、MFP10の内部でUSBホストインタフェース31に固定でUSB接続されている。
The USB mass storage device 11 includes a USB device interface 51 (see FIG. 3) for connecting to a USB mass storage host, and a mass storage 50 (see FIG. 3).
A USB device interface 51 included in the USB mass storage device 11 is fixedly connected to the USB host interface 31 inside the MFP 10 by USB.

マスストレージ50としては、リムーバブルメディアを記憶メディアとして用いるリムーバブルメディアドライブ、内蔵ハードディスクを記憶メディアとして用いるハードディスクドライブなどを用いることができる。
USBマスストレージ・デバイス11は記憶メディアから読み出したデータをRAM26に転送するとともに、RAM26から転送されたデータを記憶メディアに書き込む。
As the mass storage 50, a removable media drive using a removable medium as a storage medium, a hard disk drive using an internal hard disk as a storage medium, or the like can be used.
The USB mass storage device 11 transfers the data read from the storage medium to the RAM 26 and writes the data transferred from the RAM 26 to the storage medium.

記憶メディアとしてリムーバブルメディアを用いる場合、カード型フラッシュメモリ(以下「リムーバブルメモリ」という)、CD−ROM、CD−R、CD−RW、DVD−R、DVD−RW、DVD−RAM、DAT、フレキシブルディスクなどの脱着可能な任意のリムーバブルメディアを用いることができる。本実施例ではUSBマスストレージ・デバイス11としてカード型フラッシュメモリを記憶メディアとして用いるリムーバブルメモリドライブを例に説明する。   When using removable media as storage media, card-type flash memory (hereinafter referred to as “removable memory”), CD-ROM, CD-R, CD-RW, DVD-R, DVD-RW, DVD-RAM, DAT, flexible disk Any removable media such as removable media can be used. In this embodiment, a removable memory drive using a card type flash memory as a storage medium will be described as an example of the USB mass storage device 11.

転送手段および判定手段としての仮想マスストレージ30は、USBデバイスインタフェース29に対して仮想のマスストレージとして動作するとともに、USBホストインタフェース31に対して上位アプリケーションとして動作するASICである。なお、仮想マスストレージ30を制御部25で実行するプログラムとして構成してもよい。また、本実施例では転送手段と判定手段とを仮想マスストレージ30として一体に構成しているが、転送手段と判定手段とは物理的に互いに独立に構成されていてもよい。   The virtual mass storage 30 serving as a transfer unit and a determination unit is an ASIC that operates as a virtual mass storage with respect to the USB device interface 29 and operates as a higher-level application with respect to the USB host interface 31. The virtual mass storage 30 may be configured as a program executed by the control unit 25. In this embodiment, the transfer unit and the determination unit are integrally configured as the virtual mass storage 30, but the transfer unit and the determination unit may be physically configured independently of each other.

制御部25は、RAM26、フラッシュメモリ27及びCPU28を備える。CPU28はフラッシュメモリ27に格納されている制御プログラムを実行してMFP10の各部を制御する。フラッシュメモリ27は、制御プログラムを格納している不揮発性メモリである。RAM26は、PC12、リムーバブルメモリドライブ11、スキャンユニット13などから入力される画像データや制御プログラムが一時的に格納される揮発性メモリである。制御プログラムは遠隔地のサーバからネットワークを経由してフラッシュメモリ27に格納してもよいし、リムーバブルメモリ等のコンピュータ読み取り可能な記録媒体を経由してフラッシュメモリ27に格納してもよい。   The control unit 25 includes a RAM 26, a flash memory 27, and a CPU 28. The CPU 28 executes a control program stored in the flash memory 27 to control each unit of the MFP 10. The flash memory 27 is a nonvolatile memory that stores a control program. The RAM 26 is a volatile memory that temporarily stores image data and control programs input from the PC 12, the removable memory drive 11, the scan unit 13, and the like. The control program may be stored in the flash memory 27 from a remote server via a network, or may be stored in the flash memory 27 via a computer-readable recording medium such as a removable memory.

次に、MFP10の論理的な構成と代表的な作動とについて説明する。
図3は、MFP10の論理的な構成を示すブロック図である。図示する例ではUSBが備えるマルチインタフェース機能を利用することによりMFP10はPC12に対してUSBプリンタ・デバイスおよびUSBマスストレージ・デバイスとしてUSB接続されている。ここでマルチインタフェース機能とは、物理的に一つのUSBを論理的に複数のUSBとして用いる機能である。なお、MFP10はPC12に対して更にUSBスキャナ・デバイスとしてUSB接続されることもできる。
Next, the logical configuration and typical operation of the MFP 10 will be described.
FIG. 3 is a block diagram showing a logical configuration of the MFP 10. In the illustrated example, the MFP 10 is USB-connected to the PC 12 as a USB printer device and a USB mass storage device by using a multi-interface function provided in the USB. Here, the multi-interface function is a function that physically uses one USB as a plurality of USB logically. The MFP 10 can be further connected to the PC 12 by USB as a USB scanner device.

(1)PC12がMFP10をプリンタとして用いる場合
PC12のUSBホストインタフェース42に実装されているプリンタクラス・ドライバ43は、プリンタドライバ41からの命令に応じたコマンドをMFP10に送信する。MFP10のUSBデバイスインタフェース29に実装されているプリンタファンクション・ドライバ45は、受信したコマンドをプリントユニット14に転送する。プリントユニット14からの応答はこの経路を逆に辿ってPC12に転送される。
PC12は、MFP10をプリンタとして用いることにより、MFP10に画像データを印刷させることができる。
(1) When the PC 12 Uses the MFP 10 as a Printer The printer class driver 43 mounted on the USB host interface 42 of the PC 12 transmits a command corresponding to a command from the printer driver 41 to the MFP 10. The printer function driver 45 installed in the USB device interface 29 of the MFP 10 transfers the received command to the print unit 14. The response from the print unit 14 is transferred to the PC 12 by following this path in reverse.
The PC 12 can cause the MFP 10 to print image data by using the MFP 10 as a printer.

(2)PC12がMFP10をリムーバブルメモリドライブとして用いる場合
PC12のUSBホストインタフェース42に実装されているマスストレージクラス・ドライバ44は、ファイルシステム40からの命令に応じたコマンドをMFP10に送信する。MFP10のUSBデバイスインタフェース29に実装されているマスストレージファンクション・ドライバ46は、受信したコマンドを仮想マスストレージ30に転送する。仮想マスストレージ30は、転送されたコマンドをUSBホストインタフェース31に実装されているマスストレージクラス・ドライバ47に転送する。マスストレージクラス・ドライバ47は、転送されたコマンドをリムーバブルメモリドライブ11のUSBデバイスインタフェース51に実装されているマスストレージファンクション・ドライバ49に転送する。マスストレージファンクション・ドライバ49は、転送されたコマンドをマスストレージ50に転送する。マスストレージ50からの応答はこの経路を逆に辿ってファイルシステム40に転送される。
(2) When the PC 12 Uses the MFP 10 as a Removable Memory Drive The mass storage class driver 44 mounted on the USB host interface 42 of the PC 12 transmits a command corresponding to a command from the file system 40 to the MFP 10. The mass storage function driver 46 mounted on the USB device interface 29 of the MFP 10 transfers the received command to the virtual mass storage 30. The virtual mass storage 30 transfers the transferred command to the mass storage class driver 47 mounted on the USB host interface 31. The mass storage class driver 47 transfers the transferred command to the mass storage function driver 49 mounted on the USB device interface 51 of the removable memory drive 11. The mass storage function driver 49 transfers the transferred command to the mass storage 50. The response from the mass storage 50 is transferred to the file system 40 by following this path in reverse.

この転送において、仮想マスストレージ30はUSBデバイスインタフェース29から受信するコマンドを通信手順に整合するように適宜修正してUSBホストインタフェース31に変換して転送する。USBホストインタフェース31は仮想マスストレージ30から受信したコマンドのコマンド番号をUSBホストインタフェース31で管理する番号に書き換える等の処理を行う。逆に、仮想マスストレージ30はUSBホストインタフェース31から受信する応答を通信手順に整合するように適宜修正してUSBデバイスインタフェース29に転送する。   In this transfer, the virtual mass storage 30 appropriately modifies the command received from the USB device interface 29 so as to match the communication procedure, converts the command to the USB host interface 31, and transfers it. The USB host interface 31 performs processing such as rewriting the command number of the command received from the virtual mass storage 30 to a number managed by the USB host interface 31. Conversely, the virtual mass storage 30 appropriately modifies the response received from the USB host interface 31 to match the communication procedure and transfers the response to the USB device interface 29.

仮想マスストレージ30がUSBデバイスインタフェース29から受信したコマンドをUSBホストインタフェース31に転送し、USBホストインタフェース31から受信した応答をUSBデバイスインタフェース29に転送することにより、PC12に対してリムーバブルメモリドライブ11があたかもPC12に直に接続されているかのように見せかけることができる。これにより、PC12は例えばリムーバブルメモリドライブ11に記憶されている画像データを取得することや、任意のデータをリムーバブルメモリドライブ11に記憶させることができる。   The virtual mass storage 30 transfers the command received from the USB device interface 29 to the USB host interface 31, and the response received from the USB host interface 31 is transferred to the USB device interface 29, so that the removable memory drive 11 is connected to the PC 12. It can appear as if it is directly connected to the PC 12. As a result, the PC 12 can acquire, for example, image data stored in the removable memory drive 11 or can store arbitrary data in the removable memory drive 11.

PC12がリムーバブルメモリドライブ11を用いる場合、PC12はリムーバブルメモリドライブ11の状態を常時監視する必要がある。このため、PC12はリムーバブルメモリドライブ11の状態を問い合わせる問い合わせコマンドを繰り返し送信する。USBデバイスインタフェース29はこの問い合わせコマンドを受信して仮想マスストレージ30に送信する。しかしながら、仮想マスストレージ30はUSBデバイスインタフェース29からこの問い合わせコマンドを受信してもUSBホストインタフェース31に転送しない。問い合わせコマンドはPC12のマスストレージクラス・ドライバ44とMFP10のマスストレージクラス・ドライバ47とがそれぞれ非同期に自発的に繰り返し送信するコマンドであり、転送しなくてもマスストレージクラス・ドライバ47からリムーバブルメモリドライブ11に送信されるからである。   When the PC 12 uses the removable memory drive 11, the PC 12 needs to constantly monitor the state of the removable memory drive 11. For this reason, the PC 12 repeatedly transmits an inquiry command for inquiring about the state of the removable memory drive 11. The USB device interface 29 receives this inquiry command and transmits it to the virtual mass storage 30. However, the virtual mass storage 30 does not transfer the inquiry command from the USB device interface 29 to the USB host interface 31. The inquiry command is a command that the mass storage class driver 44 of the PC 12 and the mass storage class driver 47 of the MFP 10 each independently and repeatedly transmits asynchronously, and the mass storage class driver 47 can remove the removable memory drive without transfer. This is because it is transmitted to 11.

マスストレージクラス・ドライバ47は、リムーバブルメモリドライブ11から問い合わせコマンドに対する応答を受信すると、受信した応答を仮想マスストレージ30に送信する。
仮想マスストレージ30は、マスストレージクラス・ドライバ47から応答を受信すると、受信した応答を受信順に蓄積する。この蓄積にはRAM26を用いてもよいし、仮想マスストレージ30に記憶用のRAMを設けて蓄積してもよい。
When the mass storage class driver 47 receives a response to the inquiry command from the removable memory drive 11, the mass storage class driver 47 transmits the received response to the virtual mass storage 30.
When receiving a response from the mass storage class driver 47, the virtual mass storage 30 accumulates the received responses in the order of reception. For this accumulation, the RAM 26 may be used, or the virtual mass storage 30 may be provided with a storage RAM.

仮想マスストレージ30は、PC12が送信した一の問い合わせコマンドをUSBデバイスインタフェース29から受信すると、マスストレージクラス・ドライバ47から受信した一の応答をUSBデバイスインタフェース29に転送する。応答が転送される順序は受信順である。USBデバイスインタフェース29に転送した応答はUSBデバイスインタフェース29からPC12に送信される。各応答はUSBデバイスインタフェース29に転送されるとRAMから破棄される。   When the virtual mass storage 30 receives one inquiry command transmitted from the PC 12 from the USB device interface 29, the virtual mass storage 30 transfers the one response received from the mass storage class driver 47 to the USB device interface 29. The order in which responses are transferred is the order of reception. The response transferred to the USB device interface 29 is transmitted from the USB device interface 29 to the PC 12. Each response is discarded from the RAM when transferred to the USB device interface 29.

(3)MFP10がリムーバブルメモリドライブ11を用いる場合
MFP10のUSBホストインタフェース31に実装されているマスストレージクラス・ドライバ47は、ファイルシステム48からの命令に応じたコマンドを、リムーバブルメモリドライブ11のUSBデバイスインタフェース51に実装されているマスストレージファンクション・ドライバ49に転送する。ここでファイルシステム48は制御部25によって実行されている上位アプリケーションプログラムである。マスストレージファンクション・ドライバ49は、転送されたコマンドをマスストレージ50に転送する。マスストレージ50からの応答はこの経路を逆に辿ってファイルシステム48に転送される。
(3) When the MFP 10 Uses the Removable Memory Drive 11 The mass storage class driver 47 mounted on the USB host interface 31 of the MFP 10 sends a command corresponding to an instruction from the file system 48 to the USB device of the removable memory drive 11 The data is transferred to the mass storage function driver 49 mounted on the interface 51. Here, the file system 48 is a higher-level application program executed by the control unit 25. The mass storage function driver 49 transfers the transferred command to the mass storage 50. The response from the mass storage 50 is transferred to the file system 48 by following this path in reverse.

次に、PC12がリムーバブルメモリドライブ11の状態を問い合わせるために送信する問い合わせコマンドと、それに対してリムーバブルメモリドライブ11が返信する応答とについて説明する。ここではリムーバブルメモリドライブ11を制御するコマンドのコマンド体系としてSCSIコマンド体系を例に説明する。本実施例ではSCSIコマンド体系で規定されている通信手順に従ってコマンドや応答の送受信を行う。
なお、USBではSCSIコマンド体系の他にもATAPI、UFI、SFF−8070iなどのコマンド体系を用い得る。これらのコマンド体系はSCSIコマンド体系に類似したコマンド体系であり、以下に説明する内容はこれらのコマンド体系に置き換えることもできる。
Next, an inquiry command transmitted by the PC 12 to inquire about the state of the removable memory drive 11 and a response returned by the removable memory drive 11 in response thereto will be described. Here, a SCSI command system will be described as an example of a command system for commands for controlling the removable memory drive 11. In this embodiment, commands and responses are transmitted / received according to a communication procedure defined by the SCSI command system.
In addition to the SCSI command system, USB can use a command system such as ATAPI, UFI, or SFF-8070i. These command systems are command systems similar to the SCSI command system, and the contents described below can be replaced with these command systems.

PC12は、リムーバブルメモリドライブ11の状態を監視するため、状態を問い合わせる「Test Unit Ready」コマンドを繰り返し送信する。リムーバブルメモリドライブ11は「Test Unit Ready」を受信すると、リムーバブルメモリドライブ11の状態に応じた応答を返信する。以下に応答の一例を示す。応答(1)〜(4)は連続して送信できる応答であり、応答(5)は連続して送信できない応答である。
(1)No Sense
(2)Medium Not Present
(3)Medium Not Ready
(4)エラーコード
(5)Medium May Have Changed
In order to monitor the state of the removable memory drive 11, the PC 12 repeatedly transmits a “Test Unit Ready” command for inquiring about the state. When the removable memory drive 11 receives “Test Unit Ready”, it returns a response according to the state of the removable memory drive 11. An example of a response is shown below. Responses (1) to (4) are responses that can be transmitted continuously, and response (5) is a response that cannot be transmitted continuously.
(1) No Sense
(2) Medium Not Present
(3) Medium Not Ready
(4) Error code (5) Medium May Have Changed

「No Sense」は、リムーバブルメモリ32に直ぐにアクセス可能な状態であることを示す応答である。
「Medium Not Present」は、リムーバブルメモリ32にアクセス不可能な状態であることを示す応答である。例えばリムーバブルメモリ32がセットされていなければ「Medium Not Present」を送信する。
“No Sense” is a response indicating that the removable memory 32 is immediately accessible.
“Medium Not Present” is a response indicating that the removable memory 32 is inaccessible. For example, if the removable memory 32 is not set, “Medium Not Present” is transmitted.

「Medium Not Ready」は、リムーバブルメモリ32を起動中でアクセスできないことを示す応答である。リムーバブルメモリ32にアクセスできない点では「Medium Not Present」と同じであるが、リムーバブルメモリ32自体はセットされているので「Medium Not Present」とは区別される。
エラーコードは、リムーバブルメモリドライブ11に何等かのエラーが発生したときに返信される応答であり、発生したエラーに対応するエラーコードが返信される。
“Medium Not Ready” is a response indicating that the removable memory 32 is being activated and cannot be accessed. Although it is the same as “Medium Not Present” in that the removable memory 32 cannot be accessed, it is distinguished from “Medium Not Present” because the removable memory 32 itself is set.
The error code is a response returned when any error occurs in the removable memory drive 11, and an error code corresponding to the generated error is returned.

「Medium May Have Changed」は、リムーバブルメモリドライブ11の状態が変化した可能性があることを示す応答である。例えば、前回の「Test Unit Ready」を受信したときには「Medium Not Present」の状態であり、今回の「Test Unit Ready」を受信したときには「No Sense」の状態であるとする。この場合、今回の「Test Unit Ready」に対して直ぐに「No Sense」を送信するのではなく、今回の「Test Unit Ready」に対しては「Medium May Have Changed」を送信し、次回の「Test Unit Ready」に対して「No Sense」を送信する。   “Medium May Have Changed” is a response indicating that the state of the removable memory drive 11 may have changed. For example, it is assumed that the state is “Medium Not Present” when the previous “Test Unit Ready” is received, and the state is “No Sense” when the current “Test Unit Ready” is received. In this case, instead of sending “No Sense” immediately to this “Test Unit Ready”, send “Medium May Have Changed” to this “Test Unit Ready” Send “No Sense” to “Unit Ready”.

次に、PC12がリムーバブルメモリドライブ11の状態を監視するときのMFP10の作動の一例を説明する。
図1は、MFP10のコマンド転送の流れを示すシーケンスチャートである。図示する例は、USBデバイスインタフェース29がPC12から「Test Unit Ready」を受信する周期よりも、USBホストインタフェース31がリムーバブルメモリドライブ11に「Test Unit Ready」を送信する周期の方が長い場合の例である。
Next, an example of the operation of the MFP 10 when the PC 12 monitors the state of the removable memory drive 11 will be described.
FIG. 1 is a sequence chart showing a command transfer flow of the MFP 10. The illustrated example is an example in which the cycle in which the USB host interface 31 transmits “Test Unit Ready” to the removable memory drive 11 is longer than the cycle in which the USB device interface 29 receives “Test Unit Ready” from the PC 12. It is.

仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」51を受信する。この場合、仮想マスストレージ30はUSBホストインタフェース31から最初に受信した応答である「Medium Not Present」74をUSBデバイスインタフェース29に転送する。   The virtual mass storage 30 receives “Test Unit Ready” 51 from the USB device interface 29. In this case, the virtual mass storage 30 transfers a “Medium Not Present” 74 that is a response first received from the USB host interface 31 to the USB device interface 29.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」53を受信する。この時、仮想マスストレージ30は前回転送した「Medium Not Present」74の次の応答をUSBホストインタフェース31から未だ受信していない。この場合、仮想マスストレージ30は前回転送した「Medium Not Present」74をUSBデバイスインタフェース29に再転送する。「Test Unit Ready」55についても同様である。   Next, the virtual mass storage 30 receives “Test Unit Ready” 53 from the USB device interface 29. At this time, the virtual mass storage 30 has not yet received from the USB host interface 31 the next response of the “Medium Not Present” 74 transferred last time. In this case, the virtual mass storage 30 retransfers the previously transferred “Medium Not Present” 74 to the USB device interface 29. The same applies to “Test Unit Ready” 55.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」57を受信する。この場合、仮想マスストレージ30はUSBホストインタフェース31から「Medium Not Present」76を受信しているので、「Medium Not Present」76を転送する。「Test Unit Ready」59および61については前回転送した「Medium Not Present」76をUSBデバイスインタフェース29に再転送する。   Next, the virtual mass storage 30 receives “Test Unit Ready” 57 from the USB device interface 29. In this case, since the virtual mass storage 30 has received “Medium Not Present” 76 from the USB host interface 31, it transfers “Medium Not Present” 76. For “Test Unit Ready” 59 and 61, the previously transferred “Medium Not Present” 76 is retransferred to the USB device interface 29.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」63を受信する。この場合、受信順からすると次の転送対象の応答は「Medium May Have Changed」78である。しかしながら、このとき仮想マスストレージ30はUSBホストインタフェース31から「Medium May Have Changed」78の次の応答を未だ受信していない。   Next, the virtual mass storage 30 receives “Test Unit Ready” 63 from the USB device interface 29. In this case, the next transfer target response is “Medium May Have Changed” 78 in the order of reception. However, at this time, the virtual mass storage 30 has not yet received the next response of “Medium May Have Changed” 78 from the USB host interface 31.

この場合、仮想マスストレージ30は「Medium May Have Changed」78を転送すると次に転送する応答が通信手順に整合しなくなる可能性があると判定する。なぜなら、「Medium May Have Changed」78を転送した後に、USBホストインタフェース31から次の応答を受信するより前にUSBデバイスインタフェース29から「Test Unit Ready」を受信してしまう可能性があり、その場合には連続して送信できない応答である「Medium May Have Changed」を再転送することになってしまうからである。「Medium May Have Changed」を再転送すると、通信手順に整合せず、PC12で通信エラーが発生してしまうからである。   In this case, when the virtual mass storage 30 transfers “Medium May Have Changed” 78, it determines that there is a possibility that the response to be transferred next may not match the communication procedure. This is because there is a possibility of receiving “Test Unit Ready” from the USB device interface 29 after receiving the “Medium May Have Changed” 78 and before receiving the next response from the USB host interface 31. This is because “Medium May Have Changed”, which is a response that cannot be transmitted continuously, is retransmitted. This is because if “Medium May Have Changed” is retransmitted, the communication procedure does not match and a communication error occurs in the PC 12.

そこで、仮想マスストレージ30は通信手順に整合しなくなる可能性がなくなるまで前回転送した応答を再転送させる。具体的には、USBホストインタフェース31から次の応答を受信するまで「Medium May Have Change」78の転送を保留し、前回転送した応答である「Medium Not Present」76を再転送する。次の応答を受信するまで「Medium May Have Change」78の転送を保留する理由は、USBホストインタフェース31から次の応答を受信すれば、「Medium May Have Change」78を送信した後に「Test Unit Ready」を受信したときに、確実に「Medium May Have Changed」以外の応答を転送できるので、「Medium May Have Change」の再転送を防止できるからである。すなわち、USBホストインタフェース31から次の応答を受信すれば、通信手順に整合しなくなる可能性がなくなるからである。ここで「Medium Not Present」は連続して送信できる応答なので、「Medium Not Present」を再転送しても通信手順に整合しなくなることはない。   Therefore, the virtual mass storage 30 retransfers the previously transferred response until there is no possibility that the communication procedure becomes inconsistent. Specifically, the transfer of “Medium May Have Change” 78 is suspended until the next response is received from the USB host interface 31, and the previously transferred response “Medium Not Present” 76 is retransferred. The reason for deferring the transfer of “Medium May Have Change” 78 until the next response is received is that if the next response is received from the USB host interface 31, “Test Unit Ready after transmitting“ Medium May Have Change ”78. This is because a response other than “Medium May Have Changed” can be reliably transmitted when “Medium May Have Change” is received, so that retransmission of “Medium May Have Change” can be prevented. That is, if the next response is received from the USB host interface 31, there is no possibility that the communication procedure will not be matched. Here, “Medium Not Present” is a response that can be transmitted continuously, so even if “Medium Not Present” is retransmitted, it does not become inconsistent with the communication procedure.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」65を受信する。この場合も仮想マスストレージ30はUSBホストインタフェース31から「Medium May Have Changed」78の次の応答を未だ受信していないので、「Medium May Have Change」78の転送を保留し、代わりに「Medium Not Present」76をUSBデバイスインタフェース29に転送する。   Next, the virtual mass storage 30 receives “Test Unit Ready” 65 from the USB device interface 29. Also in this case, the virtual mass storage 30 has not yet received the next response of “Medium May Have Changed” 78 from the USB host interface 31, so the transfer of “Medium May Have Change” 78 is suspended, and instead of “Medium Not Have”. “Present” 76 is transferred to the USB device interface 29.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」67を受信する。この時、仮想マスストレージ30はUSBホストインタフェース31から「Medium May Have Changed」78の次の応答「No Sense」80を受信している。この場合、仮想マスストレージ30は通信手順に整合しなくなる可能性はなくなったと判定し、保留していた「Medium May Have Change」78をUSBデバイスインタフェース29に転送する。   Next, the virtual mass storage 30 receives “Test Unit Ready” 67 from the USB device interface 29. At this time, the virtual mass storage 30 receives the next response “No Sense” 80 of “Medium May Have Changed” 78 from the USB host interface 31. In this case, the virtual mass storage 30 determines that there is no possibility of being inconsistent with the communication procedure, and transfers the held “Medium May Have Change” 78 to the USB device interface 29.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」69を受信する。この場合、仮想マスストレージ30は転送順を本来の受信順に戻し、前回送信した応答「Medium May Have Changed」78の次の応答「No Sense」80をUSBデバイスインタフェース29に転送する。   Next, the virtual mass storage 30 receives “Test Unit Ready” 69 from the USB device interface 29. In this case, the virtual mass storage 30 returns the transfer order to the original reception order, and transfers the response “No Sense” 80 next to the response “Medium May Have Changed” 78 transmitted last time to the USB device interface 29.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」71を受信する。この場合、仮想マスストレージ30は前回転送した応答「No Sense」80の次の応答「No Sense」82をUSBデバイスインタフェース29に転送する。   Next, the virtual mass storage 30 receives “Test Unit Ready” 71 from the USB device interface 29. In this case, the virtual mass storage 30 transfers the response “No Sense” 82 next to the previously transferred response “No Sense” 80 to the USB device interface 29.

なお、上記の例ではUSBホストインタフェース31から「No Sense」を受信した場合を例に説明したが、USBホストインタフェース31から「Medium Not Present」または「エラーコード」を受信した場合も同様である。ただし、「Medium Not Ready」の場合は仮想マスストレージ30の対応が異なる。「Medium Not Ready」の場合、仮想マスストレージ30は「Medium Not Ready」を読み飛ばして転送せず、その次に受信した応答を転送する。リムーバブルメモリ32を起動中でアクセスできない場合はいずれ別の状態に変化するので、読み飛ばしても問題はなく、読み飛ばすことによって通信量を低減できる。   In the above example, the case where “No Sense” is received from the USB host interface 31 has been described as an example, but the same applies when “Medium Not Present” or “error code” is received from the USB host interface 31. However, in the case of “Medium Not Ready”, the correspondence of the virtual mass storage 30 is different. In the case of “Medium Not Ready”, the virtual mass storage 30 skips “Medium Not Ready” and does not transfer it, and transfers the response received next. If the removable memory 32 is activated and cannot be accessed, the state changes to another state. Therefore, there is no problem even if skipping, and the amount of communication can be reduced by skipping.

次に、PC12がリムーバブルメモリドライブ11の状態を監視するときのMFP10の作動の別の例を説明する。
図4は、MFP10のコマンド転送の流れを示すシーケンスチャートである。図示する例は、USBデバイスインタフェース29がPC12から「Test Unit Ready」を受信する周期の方が、USBホストインタフェース31がリムーバブルメモリドライブ11に「Test Unit Ready」を送信する周期よりも長い場合の例である。
Next, another example of the operation of the MFP 10 when the PC 12 monitors the state of the removable memory drive 11 will be described.
FIG. 4 is a sequence chart showing a command transfer flow of the MFP 10. In the illustrated example, the period in which the USB device interface 29 receives “Test Unit Ready” from the PC 12 is longer than the period in which the USB host interface 31 transmits “Test Unit Ready” to the removable memory drive 11. It is.

仮想マスストレージ30はUSBデバイスインタフェース29から「Test Unit Ready」85を受信する。この場合、仮想マスストレージ30はUSBホストインタフェース31から最初に受信した応答である「Medium Not Present」90をUSBデバイスインタフェース29に転送する。   The virtual mass storage 30 receives “Test Unit Ready” 85 from the USB device interface 29. In this case, the virtual mass storage 30 transfers “Medium Not Present” 90, which is a response first received from the USB host interface 31, to the USB device interface 29.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」86を受信する。この場合、仮想マスストレージ30はUSBホストインタフェース31から「Medium Not Present」92を受信しているので、「Medium Not Present」92を転送する転送する。   Next, the virtual mass storage 30 receives “Test Unit Ready” 86 from the USB device interface 29. In this case, since the virtual mass storage 30 has received the “Medium Not Present” 92 from the USB host interface 31, the virtual mass storage 30 transfers the “Medium Not Present” 92.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」87を受信する。この場合、転送の順序からすると転送対象の応答は「Medium May Have Changed」94である。この時、仮想マスストレージ30はUSBホストインタフェース31から既に次の応答「No Sense」を受信している。この場合、仮想マスストレージ30は「Medium May Have Changed」94を転送しても次に転送する応答が通信手順に整合しなくなる可能性はないと判定する。そこで、仮想マスストレージ30は「Medium May Have Change」94の転送を保留せず、USBデバイスインタフェース29に「Medium May Have Change」94を転送する。   Next, the virtual mass storage 30 receives “Test Unit Ready” 87 from the USB device interface 29. In this case, according to the transfer order, the response to be transferred is “Medium May Have Changed” 94. At this time, the virtual mass storage 30 has already received the next response “No Sense” from the USB host interface 31. In this case, even if the virtual mass storage 30 transfers “Medium May Have Changed” 94, it determines that there is no possibility that the response to be transferred next will not match the communication procedure. Therefore, the virtual mass storage 30 does not hold the transfer of “Medium May Have Change” 94 and transfers “Medium May Have Change” 94 to the USB device interface 29.

次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」88を受信する。この場合、次の応答「No Sense」96をUSBデバイスインタフェース29に転送する。
上記の例においても「Medium May Have Change」は連続して送信されないので、「Medium May Have Change」を連続して送信してしまうことによる通信エラーの発生を防止できる。
Next, the virtual mass storage 30 receives “Test Unit Ready” 88 from the USB device interface 29. In this case, the next response “No Sense” 96 is transferred to the USB device interface 29.
Also in the above example, “Medium May Have Change” is not transmitted continuously, so that it is possible to prevent the occurrence of a communication error caused by continuously transmitting “Medium May Have Change”.

次に、仮想マスストレージ30がUSBホストインタフェース31から「Test Unit Ready」を受信したときの処理の詳細について説明する。
図5は、仮想マスストレージ30の処理の流れを示すフローチャートである。
S105では、仮想マスストレージ30はUSBホストインタフェース31から受信した応答のうち前回USBデバイスインタフェース29に転送した応答の次の応答を転送対象の応答として取得する。ただし、前回転送した応答の後に次の応答を受信していなければ前回転送した応答を再び転送対象の応答とする。
Next, details of processing when the virtual mass storage 30 receives “Test Unit Ready” from the USB host interface 31 will be described.
FIG. 5 is a flowchart showing a processing flow of the virtual mass storage 30.
In S <b> 105, the virtual mass storage 30 acquires a response next to the response transferred to the USB device interface 29 among the responses received from the USB host interface 31 as a response to be transferred. However, if the next response has not been received after the previous transfer response, the previous transfer response is set as the transfer target response again.

S110では、仮想マスストレージ30は転送対象の応答が「Medium Not Ready」であれば転送せずに読み飛ばす。
S115では、仮想マスストレージ30は転送対象の応答の後に「Medium Not Present」を受信済みであるかを判定する。仮想マスストレージ30は転送対象の応答の後に「Medium Not Present」を受信済みであればS120に進み、受信していなければS125に進む。
In S110, if the response to be transferred is “Medium Not Ready”, the virtual mass storage 30 skips without reading.
In S115, the virtual mass storage 30 determines whether “Medium Not Present” has been received after the response to be transferred. The virtual mass storage 30 proceeds to S120 if “Medium Not Present” has been received after the response to be transferred, and proceeds to S125 if not received.

S120では、仮想マスストレージ30は「Medium Not Present」までの応答を読み飛ばし、「Medium Not Present」を送信対象の応答とする。「Medium Not Present」を受信している場合は、「Medium Not Present」の前に受信した応答を転送しても無意味だからである。具体的には、例えば「Medium Not Present」の前に「No Sense」を受信していた場合、その後にリムーバブルメモリ32にアクセスできなくなっているので、「No Sense」を送信しても実際にはアクセスすることはできず、「No Sense」を送信することに意味がなくなるからである。この場合、「Medium Not Present」の前に受信していた応答を全て読み飛ばすことにより、通信量を低減できる。   In S120, the virtual mass storage 30 skips responses up to “Medium Not Present” and sets “Medium Not Present” as a response to be transmitted. This is because, when “Medium Not Present” is received, it is meaningless to forward the response received before “Medium Not Present”. Specifically, for example, when “No Sense” is received before “Medium Not Present”, the removable memory 32 is not accessible after that, so even if “No Sense” is transmitted, it is actually This is because it cannot be accessed, and it makes no sense to send “No Sense”. In this case, the communication amount can be reduced by skipping all responses received before “Medium Not Present”.

S125では、仮想マスストレージ30は転送対象の応答が「Medium May Have Changed」であるか否かを判定する。仮想マスストレージ30は転送対象の応答が「Medium May Have Changed」でなければ当該転送対象の応答を転送しても次に転送する応答が通信手順に整合しなくなる可能性はないと判定してS130に進み、「Medium May Have Changed」であればS135に進む。   In S125, the virtual mass storage 30 determines whether or not the response to be transferred is “Medium May Have Changed”. If the response to be transferred is not “Medium May Have Changed”, the virtual mass storage 30 determines that there is no possibility that the response to be transferred next will not match the communication procedure even if the response to be transferred is transferred. If “Medium May Have Changed”, proceed to S135.

S130では、仮想マスストレージ30はUSBデバイスインタフェース29に転送対象の応答を転送する。
S135では、仮想マスストレージ30は「Medium May Have Changed」の後に次の応答を受信しているかを判定する。仮想マスストレージ30は、次の応答を受信している場合は、「Medium May Have Changed」を転送しても次に転送する応答が通信手順に整合しなくなる可能性はないと判定し、S140に進む。次の応答を受信していない場合は、「Medium May Have Changed」を転送すると次に転送する応答が通信手順に整合しなくなる可能性があると判定し、S145に進む。
In S 130, the virtual mass storage 30 transfers the transfer target response to the USB device interface 29.
In S135, the virtual mass storage 30 determines whether the next response is received after “Medium May Have Changed”. If the virtual mass storage 30 has received the next response, the virtual mass storage 30 determines that there is no possibility that the response to be transferred next does not match the communication procedure even if “Medium May Have Changed” is transferred, move on. If the next response has not been received, if “Medium May Have Changed” is transferred, it is determined that the next transferred response may not match the communication procedure, and the process proceeds to S145.

S140では、仮想マスストレージ30はUSBデバイスインタフェース29に「Medium May Have Changed」を転送する。
S145では、仮想マスストレージ30は「Medium May Have Changed」の転送を保留し、前回転送した応答をUSBデバイスインタフェース29に再転送する。ただし、「Medium May Have Changed」を送信する直前には必ず「Medium Not Present」の状態になるので、実質的には「Medium May Have Changed」の保留中に再転送される応答は常に「Medium Not Present」である。
In S <b> 140, the virtual mass storage 30 transfers “Medium May Have Changed” to the USB device interface 29.
In S145, the virtual mass storage 30 suspends the transfer of “Medium May Have Changed”, and retransfers the previously transferred response to the USB device interface 29. However, immediately before sending “Medium May Have Changed”, it will always be in the “Medium Not Present” state, so in effect the response that is retransmitted while “Medium May Have Changed” is held is always “Medium Not Have”. Present ".

以上説明した本発明の一実施例に係るMFP10によると、通信手順に整合しなくなることを確実に防止できるので、USBデバイスインタフェースに接続されているUSBホストから、USBホストインタフェースに接続されているUSBデバイスの状態を正常に監視できる。
なお、本実施例では電子機器としてMFP10を例に説明したが、本発明はUSBデバイスインタフェースとUSBホストインタフェースとを備える任意の機器に適用可能である。
According to the MFP 10 according to the embodiment of the present invention described above, it is possible to reliably prevent the communication procedure from being inconsistent, so that the USB host connected to the USB device interface is connected to the USB host interface connected to the USB host interface. The device status can be monitored normally.
In this embodiment, the MFP 10 is described as an example of the electronic device. However, the present invention is applicable to any device having a USB device interface and a USB host interface.

また、本発明は上記の実施例に限定されるものではなく、その要旨を逸脱しない範囲で種々の実施例に適用可能である。   Further, the present invention is not limited to the above-described embodiments, and can be applied to various embodiments without departing from the gist thereof.

本発明の一実施例に係るシーケンスチャート。The sequence chart which concerns on one Example of this invention. 本発明の一実施例に係る電子機器のブロック図。1 is a block diagram of an electronic device according to an embodiment of the present invention. 本発明の一実施例に係る電子機器の論理構成を示すブロック図。1 is a block diagram showing a logical configuration of an electronic device according to an embodiment of the present invention. 本発明の一実施例に係るシーケンスチャート。The sequence chart which concerns on one Example of this invention. 本発明の一実施例に係るフローチャート。The flowchart which concerns on one Example of this invention.

符号の説明Explanation of symbols

10 マルチファンクションプリンタ(電子機器)、11 リムーバブルメモリドライブ(USBマスストレージ・デバイス)、12 PC(USBマスストレージ・ホスト)、13 スキャンユニット(画像読み取り手段)、14 プリントユニット(印刷手段)、29 USBデバイスインタフェース、30 仮想マスストレージ(転送手段、判定手段)、31 USBホストインタフェース、32 リムーバブルメモリ(記憶メディア) DESCRIPTION OF SYMBOLS 10 Multifunction printer (electronic device), 11 Removable memory drive (USB mass storage device), 12 PC (USB mass storage host), 13 Scan unit (image reading means), 14 Print unit (printing means), 29 USB device Interface, 30 virtual mass storage (transfer means, determination means), 31 USB host interface, 32 removable memory (storage media)

Claims (10)

USBホストに接続するためのUSBデバイスインタフェースと、
USBデバイスを接続するためのUSBホストインタフェースと、
前記USBデバイスインタフェースが前記USBホストからコマンドを受信すると、前記USBホストインタフェースが前記USBデバイスに送信したコマンドに対する応答を前記USBデバイスインタフェースに転送する転送手段と、
前記応答を転送すると次に転送する応答が通信手順に整合しなくなる可能性があるかを判定し、整合しなくなる可能性がない場合は前記転送手段に前記応答を転送させ、整合しなくなる可能性がある場合は整合しなくなる可能性がなくなるまで前回転送した応答を再転送させ、整合しなくなる可能性がなくなった後に前記応答を転送させる判定手段と、
を備える電子機器。
A USB device interface for connecting to a USB host;
A USB host interface for connecting a USB device;
When the USB device interface receives a command from the USB host, transfer means for transferring a response to the command transmitted by the USB host interface to the USB device to the USB device interface;
When the response is transferred, it is determined whether there is a possibility that a response to be transferred next does not match the communication procedure. If there is no possibility that the response does not match, the transfer means may transfer the response and may not match. A determination means for retransmitting the previously transferred response until there is no possibility of being inconsistent if there is, and for transferring the response after there is no possibility of being inconsistent;
Electronic equipment comprising.
前記転送手段は、前記USBホストインタフェースが前記USBホストから前回転送した応答の次の応答を未だ受信していない場合は前回転送した応答を再転送し、
前記判定手段は、前記応答が連続して送信できない応答であり且つ前記USBホストインタフェースが前記USBデバイスから前記応答の次の応答を未だ受信していない場合は前記通信手順に整合しなくなる可能性があると判定し、前記USBホストインタフェースが前記USBデバイスから次の応答を受信するまで前回転送した応答を再転送させ、前記USBホストインタフェースが次の応答を受信した後に前記応答を転送させる請求項1に記載の電子機器。
The transfer means, when the USB host interface has not yet received a response next to the response previously transferred from the USB host, retransfers the response transferred last time,
The determination means may be inconsistent with the communication procedure when the response is a response that cannot be continuously transmitted and the USB host interface has not yet received a response next to the response from the USB device. A determination is made that there is, the previously transferred response is retransferred until the USB host interface receives the next response from the USB device, and the response is transferred after the USB host interface receives the next response. The electronic device as described in.
前記USBホストはUSBマスストレージ・ホストであり、
前記USBデバイスはUSBマスストレージ・デバイスであり、
前記コマンドは、前記USBマスストレージ・デバイスの状態を問い合わせる問い合わせコマンドである請求項2に記載の電子機器。
The USB host is a USB mass storage host;
The USB device is a USB mass storage device;
The electronic device according to claim 2, wherein the command is an inquiry command that inquires about a state of the USB mass storage device.
前記連続して送信できない応答は、記憶メディアの状態が変化した可能性があることを示す応答である請求項3に記載の電子機器。   The electronic device according to claim 3, wherein the response that cannot be continuously transmitted is a response indicating that the state of the storage medium may have changed. 前記転送手段は、転送対象の応答が記憶メディアを起動中でアクセスできないことを示す応答である場合は転送せずに読み飛ばす請求項3又は4に記載の電子機器。   5. The electronic apparatus according to claim 3, wherein the transfer unit skips reading without transferring if the response to be transferred is a response indicating that the storage medium is being activated and cannot be accessed. 前記転送手段は、転送対象の応答の後に記憶メディアがセットされていないことを示す応答を受信済みの場合は、前記記憶メディアがセットされていないことを示す応答の前に受信した応答を転送せずに読み飛ばす請求項3、4又は5に記載の電子機器。   When the transfer means has received a response indicating that no storage medium is set after the response to be transferred, the transfer means transfers the response received before the response indicating that the storage medium is not set. The electronic device according to claim 3, 4 or 5 which is skipped without reading. 前記USBマスストレージ・デバイスの記憶メディアはリムーバブルメディアである請求項3〜6のいずれか一項に記載の電子機器。   The electronic device according to claim 3, wherein a storage medium of the USB mass storage device is a removable medium. 前記USBマスストレージ・デバイスに記憶されている画像データを前記USBホストインタフェースを介して取得し、取得した前記画像データを印刷媒体に印刷する印刷手段を更に備える請求項3〜7のいずれか一項に記載の電子機器。   8. The image processing apparatus according to claim 3, further comprising a printing unit that acquires image data stored in the USB mass storage device via the USB host interface and prints the acquired image data on a print medium. The electronic device as described in. 原稿に形成されている画像を読み取って画像データを生成し、生成した前記画像データを前記USBホストインタフェースを介して前記USBマスストレージ・デバイスに書き込む画像読み取り手段を更に備える請求項3〜8のいずれか一項に記載の電子機器。   The image reading unit according to claim 3, further comprising: an image reading unit that reads an image formed on a document to generate image data, and writes the generated image data to the USB mass storage device via the USB host interface. An electronic device according to any one of the above. USBホストに接続するためのUSBデバイスインタフェースと、USBデバイスを接続するためのUSBホストインタフェースとを備える電子機器を用いた応答転送方法であって、
前記USBデバイスインタフェースが前記USBホストからコマンドを受信すると、前記USBホストインタフェースが前記USBデバイスに送信したコマンドに対する応答を前記USBデバイスインタフェースに転送する転送段階と、
前記応答を転送すると次に転送する応答が通信手順に整合しなくなる可能性があるかを判定し、整合しなくなる可能性がない場合は前記転送手段に前記応答を転送させ、整合しなくなる可能性がある場合は整合しなくなる可能性がなくなるまで前回転送した応答を再転送させ、整合しなくなる可能性がなくなった後に前記応答を転送させる判定段階と、
を含む応答転送方法。



A response transfer method using an electronic device including a USB device interface for connecting to a USB host and a USB host interface for connecting a USB device,
When the USB device interface receives a command from the USB host, a transfer step of transferring a response to the command transmitted by the USB host interface to the USB device to the USB device interface;
When the response is transferred, it is determined whether there is a possibility that a response to be transferred next does not match the communication procedure. If there is no possibility that the response does not match, the transfer means may transfer the response and may not match. A determination step of re-forwarding the previously forwarded response until there is no possibility of being inconsistent, and forwarding the response after no possibility of being inconsistent; and
Response transfer method including:



JP2006199362A 2006-07-21 2006-07-21 Electronic apparatus and response transfer method Withdrawn JP2008027213A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006199362A JP2008027213A (en) 2006-07-21 2006-07-21 Electronic apparatus and response transfer method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006199362A JP2008027213A (en) 2006-07-21 2006-07-21 Electronic apparatus and response transfer method

Publications (1)

Publication Number Publication Date
JP2008027213A true JP2008027213A (en) 2008-02-07

Family

ID=39117780

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006199362A Withdrawn JP2008027213A (en) 2006-07-21 2006-07-21 Electronic apparatus and response transfer method

Country Status (1)

Country Link
JP (1) JP2008027213A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011138255A (en) * 2009-12-28 2011-07-14 Brother Industries Ltd Printing system, printer, and dedicated usb memory
JP2012137878A (en) * 2010-12-24 2012-07-19 Canon Imaging Systems Inc Client device, device control device, control method thereof and device control system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011138255A (en) * 2009-12-28 2011-07-14 Brother Industries Ltd Printing system, printer, and dedicated usb memory
US8432573B2 (en) 2009-12-28 2013-04-30 Brother Kogyo Kabushiki Kaisha Printer, dedicated USB flash drive and printing system
JP2012137878A (en) * 2010-12-24 2012-07-19 Canon Imaging Systems Inc Client device, device control device, control method thereof and device control system

Similar Documents

Publication Publication Date Title
US8223371B2 (en) Image forming apparatus, data processing method, program, and storage medium
US10594819B2 (en) Relay server and non-transitory storage medium storing instructions executable by the relay server
US20090066989A1 (en) Image forming apparatus and method, computer program product, and image forming system
US7362456B2 (en) Print job substitution in a copy job
JP2008030287A (en) Printing apparatus, printing system and program
JP5317838B2 (en) Information processing apparatus, control method therefor, program, and storage medium
JP2015061141A (en) Information processing system, information acquisition device, server, program, and information processing method
US8941866B2 (en) Print control apparatus, print control method, and storage medium storing program
US9971558B2 (en) Information processing apparatus
JP2008027213A (en) Electronic apparatus and response transfer method
JP2010124113A (en) Image processing system, information processing apparatus, image processing apparatus, method of controlling information processing apparatus, method of controlling image processing apparatus, and program
JP2005119203A (en) Image processing apparatus and image processing method
JP2008046739A (en) Image forming device, information processor and program
US8810840B2 (en) Image forming system, output management method, and program product, configured to determine type of PDL in output data
JP2004259153A (en) Information processor, method of controlling the same, and control program
JP2018073196A (en) Information processing device, control method and program
JP2006185112A (en) Printing apparatus and control method for the same
JP2007219576A (en) Printer driver selection program and recording medium
JP2005222423A (en) Information processing apparatus, printing system, control method, program and storage medium
US10628093B2 (en) Printing systems and methods for monitoring print jobs
JP2001047706A (en) Imaging system in network environment
JP2008027217A (en) Printing system with information processor and printing apparatus
JP2007199770A (en) Information processor, uninstallation method, storage medium, and program
JP2006155240A (en) Usb connecting system, usb function device, method of communication, and program and storage medium
JP2008048208A (en) Image processor, and image processing method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20091006