JP2008027213A - Electronic apparatus and response transfer method - Google Patents
Electronic apparatus and response transfer method Download PDFInfo
- 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
Links
Images
Abstract
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.
本発明は、上述の問題に鑑みて創作されたものであって、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
スキャンユニット13は、照明部15、イメージセンサ17、スキャン処理部16、キャリッジ駆動部18などを備える。イメージセンサ17は、照明部15によって照明され図示しない結像光学系により受光面に結像される原稿の光学像の濃淡に相関する電気信号を出力する。スキャン処理部16はイメージセンサ17を駆動するとともにイメージセンサ17から出力されるアナログ信号をディジタル化してRAM26に出力する。キャリッジ駆動部18は、主走査方向に垂直にイメージセンサ17又は結像光学系を往復移動させる。
The
プリントユニット14は、インクジェット方式の印字ヘッド21、ヘッドキャリッジ駆動部20、送紙部22、これらを制御する印刷制御部19などを備える。印刷制御部19は、RAM26に格納された印刷データに基づいて、送紙部22に用紙を印字ヘッド21の移動方向軸線と垂直な方向に搬送させ、ヘッドキャリッジ駆動部20に用紙の搬送方向と垂直に印字ヘッド21を往復移動させ、印字ヘッド21からインクを噴射させることにより、用紙に画像を形成する。
The
ディジタル画像処理部23は、解像度変換、アンシャープ処理、階調補正、二値化、分版処理等の画像処理をCPU28と協働して実行し、印刷対象の画像データから印刷データを生成するDSPなどの専用プロセッサである。
操作部24は、メニューを表示するための表示装置や、メニューを操作するためのボタン、印刷や原稿の読み取りを指示するための指示ボタンなどのユーザがMFP10を操作するための各種の操作ボタンを備えている。
The digital
The
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ホストインタフェース31は、USBマスストレージ・デバイス11にUSB接続するための通信インタフェース回路である。USBホストインタフェース31には、USBホストコントローラやUSBバスインタフェースなどのUSBプロトコルにおけるハードウェア層と、マスストレージクラス・ドライバ47(図3参照)などのソフトウェア層とが実装されている。なお、ソフトウェア層の一部は制御部25で実行されてもよい。
The
USBマスストレージ・デバイス11は、USBマスストレージ・ホストに接続するためのUSBデバイスインタフェース51(図3参照)、およびマスストレージ50(図3参照)を備えている。
USBマスストレージ・デバイス11が備えるUSBデバイスインタフェース51は、MFP10の内部でUSBホストインタフェース31に固定でUSB接続されている。
The USB
A
マスストレージ50としては、リムーバブルメディアを記憶メディアとして用いるリムーバブルメディアドライブ、内蔵ハードディスクを記憶メディアとして用いるハードディスクドライブなどを用いることができる。
USBマスストレージ・デバイス11は記憶メディアから読み出したデータをRAM26に転送するとともに、RAM26から転送されたデータを記憶メディアに書き込む。
As the
The USB
記憶メディアとしてリムーバブルメディアを用いる場合、カード型フラッシュメモリ(以下「リムーバブルメモリ」という)、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
転送手段および判定手段としての仮想マスストレージ30は、USBデバイスインタフェース29に対して仮想のマスストレージとして動作するとともに、USBホストインタフェース31に対して上位アプリケーションとして動作するASICである。なお、仮想マスストレージ30を制御部25で実行するプログラムとして構成してもよい。また、本実施例では転送手段と判定手段とを仮想マスストレージ30として一体に構成しているが、転送手段と判定手段とは物理的に互いに独立に構成されていてもよい。
The
制御部25は、RAM26、フラッシュメモリ27及びCPU28を備える。CPU28はフラッシュメモリ27に格納されている制御プログラムを実行してMFP10の各部を制御する。フラッシュメモリ27は、制御プログラムを格納している不揮発性メモリである。RAM26は、PC12、リムーバブルメモリドライブ11、スキャンユニット13などから入力される画像データや制御プログラムが一時的に格納される揮発性メモリである。制御プログラムは遠隔地のサーバからネットワークを経由してフラッシュメモリ27に格納してもよいし、リムーバブルメモリ等のコンピュータ読み取り可能な記録媒体を経由してフラッシュメモリ27に格納してもよい。
The
次に、MFP10の論理的な構成と代表的な作動とについて説明する。
図3は、MFP10の論理的な構成を示すブロック図である。図示する例ではUSBが備えるマルチインタフェース機能を利用することによりMFP10はPC12に対してUSBプリンタ・デバイスおよびUSBマスストレージ・デバイスとしてUSB接続されている。ここでマルチインタフェース機能とは、物理的に一つのUSBを論理的に複数のUSBとして用いる機能である。なお、MFP10はPC12に対して更にUSBスキャナ・デバイスとしてUSB接続されることもできる。
Next, the logical configuration and typical operation of the
FIG. 3 is a block diagram showing a logical configuration of the
(1)PC12がMFP10をプリンタとして用いる場合
PC12のUSBホストインタフェース42に実装されているプリンタクラス・ドライバ43は、プリンタドライバ41からの命令に応じたコマンドをMFP10に送信する。MFP10のUSBデバイスインタフェース29に実装されているプリンタファンクション・ドライバ45は、受信したコマンドをプリントユニット14に転送する。プリントユニット14からの応答はこの経路を逆に辿ってPC12に転送される。
PC12は、MFP10をプリンタとして用いることにより、MFP10に画像データを印刷させることができる。
(1) When the
The
(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
この転送において、仮想マスストレージ30はUSBデバイスインタフェース29から受信するコマンドを通信手順に整合するように適宜修正してUSBホストインタフェース31に変換して転送する。USBホストインタフェース31は仮想マスストレージ30から受信したコマンドのコマンド番号をUSBホストインタフェース31で管理する番号に書き換える等の処理を行う。逆に、仮想マスストレージ30はUSBホストインタフェース31から受信する応答を通信手順に整合するように適宜修正してUSBデバイスインタフェース29に転送する。
In this transfer, the
仮想マスストレージ30がUSBデバイスインタフェース29から受信したコマンドをUSBホストインタフェース31に転送し、USBホストインタフェース31から受信した応答をUSBデバイスインタフェース29に転送することにより、PC12に対してリムーバブルメモリドライブ11があたかもPC12に直に接続されているかのように見せかけることができる。これにより、PC12は例えばリムーバブルメモリドライブ11に記憶されている画像データを取得することや、任意のデータをリムーバブルメモリドライブ11に記憶させることができる。
The
PC12がリムーバブルメモリドライブ11を用いる場合、PC12はリムーバブルメモリドライブ11の状態を常時監視する必要がある。このため、PC12はリムーバブルメモリドライブ11の状態を問い合わせる問い合わせコマンドを繰り返し送信する。USBデバイスインタフェース29はこの問い合わせコマンドを受信して仮想マスストレージ30に送信する。しかしながら、仮想マスストレージ30はUSBデバイスインタフェース29からこの問い合わせコマンドを受信してもUSBホストインタフェース31に転送しない。問い合わせコマンドはPC12のマスストレージクラス・ドライバ44とMFP10のマスストレージクラス・ドライバ47とがそれぞれ非同期に自発的に繰り返し送信するコマンドであり、転送しなくてもマスストレージクラス・ドライバ47からリムーバブルメモリドライブ11に送信されるからである。
When the
マスストレージクラス・ドライバ47は、リムーバブルメモリドライブ11から問い合わせコマンドに対する応答を受信すると、受信した応答を仮想マスストレージ30に送信する。
仮想マスストレージ30は、マスストレージクラス・ドライバ47から応答を受信すると、受信した応答を受信順に蓄積する。この蓄積にはRAM26を用いてもよいし、仮想マスストレージ30に記憶用のRAMを設けて蓄積してもよい。
When the mass
When receiving a response from the mass
仮想マスストレージ30は、PC12が送信した一の問い合わせコマンドをUSBデバイスインタフェース29から受信すると、マスストレージクラス・ドライバ47から受信した一の応答をUSBデバイスインタフェース29に転送する。応答が転送される順序は受信順である。USBデバイスインタフェース29に転送した応答はUSBデバイスインタフェース29からPC12に送信される。各応答はUSBデバイスインタフェース29に転送されるとRAMから破棄される。
When the
(3)MFP10がリムーバブルメモリドライブ11を用いる場合
MFP10のUSBホストインタフェース31に実装されているマスストレージクラス・ドライバ47は、ファイルシステム48からの命令に応じたコマンドを、リムーバブルメモリドライブ11のUSBデバイスインタフェース51に実装されているマスストレージファンクション・ドライバ49に転送する。ここでファイルシステム48は制御部25によって実行されている上位アプリケーションプログラムである。マスストレージファンクション・ドライバ49は、転送されたコマンドをマスストレージ50に転送する。マスストレージ50からの応答はこの経路を逆に辿ってファイルシステム48に転送される。
(3) When the
次に、PC12がリムーバブルメモリドライブ11の状態を問い合わせるために送信する問い合わせコマンドと、それに対してリムーバブルメモリドライブ11が返信する応答とについて説明する。ここではリムーバブルメモリドライブ11を制御するコマンドのコマンド体系としてSCSIコマンド体系を例に説明する。本実施例ではSCSIコマンド体系で規定されている通信手順に従ってコマンドや応答の送受信を行う。
なお、USBではSCSIコマンド体系の他にもATAPI、UFI、SFF−8070iなどのコマンド体系を用い得る。これらのコマンド体系はSCSIコマンド体系に類似したコマンド体系であり、以下に説明する内容はこれらのコマンド体系に置き換えることもできる。
Next, an inquiry command transmitted by the
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
(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
“Medium Not Present” is a response indicating that the
「Medium Not Ready」は、リムーバブルメモリ32を起動中でアクセスできないことを示す応答である。リムーバブルメモリ32にアクセスできない点では「Medium Not Present」と同じであるが、リムーバブルメモリ32自体はセットされているので「Medium Not Present」とは区別される。
エラーコードは、リムーバブルメモリドライブ11に何等かのエラーが発生したときに返信される応答であり、発生したエラーに対応するエラーコードが返信される。
“Medium Not Ready” is a response indicating that the
The error code is a response returned when any error occurs in the
「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
次に、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
FIG. 1 is a sequence chart showing a command transfer flow of the
仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」51を受信する。この場合、仮想マスストレージ30はUSBホストインタフェース31から最初に受信した応答である「Medium Not Present」74をUSBデバイスインタフェース29に転送する。
The
次に仮想マスストレージ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
次に仮想マスストレージ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
次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」63を受信する。この場合、受信順からすると次の転送対象の応答は「Medium May Have Changed」78である。しかしながら、このとき仮想マスストレージ30はUSBホストインタフェース31から「Medium May Have Changed」78の次の応答を未だ受信していない。
Next, the
この場合、仮想マスストレージ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
そこで、仮想マスストレージ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
次に仮想マスストレージ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
次に仮想マスストレージ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
次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」69を受信する。この場合、仮想マスストレージ30は転送順を本来の受信順に戻し、前回送信した応答「Medium May Have Changed」78の次の応答「No Sense」80をUSBデバイスインタフェース29に転送する。
Next, the
次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」71を受信する。この場合、仮想マスストレージ30は前回転送した応答「No Sense」80の次の応答「No Sense」82をUSBデバイスインタフェース29に転送する。
Next, the
なお、上記の例では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
次に、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
FIG. 4 is a sequence chart showing a command transfer flow of the
仮想マスストレージ30はUSBデバイスインタフェース29から「Test Unit Ready」85を受信する。この場合、仮想マスストレージ30はUSBホストインタフェース31から最初に受信した応答である「Medium Not Present」90をUSBデバイスインタフェース29に転送する。
The
次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」86を受信する。この場合、仮想マスストレージ30はUSBホストインタフェース31から「Medium Not Present」92を受信しているので、「Medium Not Present」92を転送する転送する。
Next, the
次に仮想マスストレージ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
次に仮想マスストレージ30は、USBデバイスインタフェース29から「Test Unit Ready」88を受信する。この場合、次の応答「No Sense」96をUSBデバイスインタフェース29に転送する。
上記の例においても「Medium May Have Change」は連続して送信されないので、「Medium May Have Change」を連続して送信してしまうことによる通信エラーの発生を防止できる。
Next, the
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
FIG. 5 is a flowchart showing a processing flow of the
In S <b> 105, the
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
In S115, the
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
S125では、仮想マスストレージ30は転送対象の応答が「Medium May Have Changed」であるか否かを判定する。仮想マスストレージ30は転送対象の応答が「Medium May Have Changed」でなければ当該転送対象の応答を転送しても次に転送する応答が通信手順に整合しなくなる可能性はないと判定してS130に進み、「Medium May Have Changed」であればS135に進む。
In S125, the
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
In S135, the
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
In S145, the
以上説明した本発明の一実施例に係るMFP10によると、通信手順に整合しなくなることを確実に防止できるので、USBデバイスインタフェースに接続されているUSBホストから、USBホストインタフェースに接続されているUSBデバイスの状態を正常に監視できる。
なお、本実施例では電子機器としてMFP10を例に説明したが、本発明はUSBデバイスインタフェースとUSBホストインタフェースとを備える任意の機器に適用可能である。
According to the
In this embodiment, the
また、本発明は上記の実施例に限定されるものではなく、その要旨を逸脱しない範囲で種々の実施例に適用可能である。 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.
10 マルチファンクションプリンタ(電子機器)、11 リムーバブルメモリドライブ(USBマスストレージ・デバイス)、12 PC(USBマスストレージ・ホスト)、13 スキャンユニット(画像読み取り手段)、14 プリントユニット(印刷手段)、29 USBデバイスインタフェース、30 仮想マスストレージ(転送手段、判定手段)、31 USBホストインタフェース、32 リムーバブルメモリ(記憶メディア)
DESCRIPTION OF
Claims (10)
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ホストインタフェースが次の応答を受信した後に前記応答を転送させる請求項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マスストレージ・デバイスの状態を問い合わせる問い合わせコマンドである請求項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.
前記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:
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)
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 |
-
2006
- 2006-07-21 JP JP2006199362A patent/JP2008027213A/en not_active Withdrawn
Cited By (3)
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 |