JP2017182257A - Communication controller and communication control program - Google Patents
Communication controller and communication control program Download PDFInfo
- Publication number
- JP2017182257A JP2017182257A JP2016065388A JP2016065388A JP2017182257A JP 2017182257 A JP2017182257 A JP 2017182257A JP 2016065388 A JP2016065388 A JP 2016065388A JP 2016065388 A JP2016065388 A JP 2016065388A JP 2017182257 A JP2017182257 A JP 2017182257A
- Authority
- JP
- Japan
- Prior art keywords
- communication
- endpoint
- printer
- identification information
- usb
- 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.)
- Pending
Links
Images
Abstract
Description
本発明は、通信制御装置および通信制御プログラムに関する。 The present invention relates to a communication control device and a communication control program.
オペレーティングシステム(以下、OS)としての、Microsoft(登録商標)社が提供するWindows(登録商標)において動作するプリンタードライバーが知られている。また、XPS(XML Paper Specification)仕様で記述されたXPSファイルを処理するXPSプリンタードライバーが開示されている(特許文献1参照)。 A printer driver that operates on Windows (registered trademark) provided by Microsoft (registered trademark) as an operating system (hereinafter referred to as OS) is known. An XPS printer driver that processes an XPS file described in the XPS (XML Paper Specification) specification is disclosed (see Patent Document 1).
前記プリンタードライバーを搭載したPC(パーソナルコンピューター)等のホストと、プリンターとが、USB(Universal Serial Bus)ケーブルを介して通信する環境を想定する。この場合、共通の通信経路を用いる通信の安定性や確実性のために、排他的通信や同期的通信が求められる。ここで言う排他的通信とは、例えば、ホストからプリンターへ印刷実行に必要な印刷データを送信している期間は、当該印刷実行に必要でない他のコマンドの送受信は実行せず、逆に、当該コマンドの送受信の期間は前記印刷データの送信を実行しない、等といった制御である。また、同期的通信とは、例えば、ホストがあるコマンドをプリンターへ送信した後、続けて、当該送信したコマンドへのプリンターからの応答をホストが受信する、といった制御である。前記プリンタードライバーでは、標準的に定められた仕様等の制約があるため、このような制御を正しく行うことができないことが生じ得た。 Assume an environment in which a host such as a PC (personal computer) equipped with the printer driver communicates with a printer via a USB (Universal Serial Bus) cable. In this case, exclusive communication or synchronous communication is required for the stability and certainty of communication using a common communication path. The exclusive communication mentioned here means that, for example, during the period in which print data necessary for printing execution is transmitted from the host to the printer, other commands that are not necessary for the printing execution are not executed. In the command transmission / reception period, the print data transmission is not executed. The synchronous communication is, for example, control in which the host receives a response from the printer to the transmitted command after the host transmits a command to the printer. In the printer driver, there is a restriction such as a standardly defined specification, and thus it may occur that such control cannot be performed correctly.
本発明は上述の課題に鑑みてなされたものであり、特定のデバイスとの通信を適切に行うことができる通信制御装置および通信制御プログラムを提供する。 The present invention has been made in view of the above-described problems, and provides a communication control apparatus and a communication control program that can appropriately perform communication with a specific device.
本発明の態様の1つは、デバイスとの通信を制御する通信制御装置であって、特定のデバイスの第1エンドポイントに対する通信により、前記特定のデバイスの識別情報を取得する第1通信部と、第2エンドポイントを用いて通信可能なデバイスの前記第2エンドポイントに対する通信により、前記通信可能なデバイスの識別情報を取得する第2通信部と、前記第1通信部により取得された識別情報と、前記第2通信部により取得された識別情報とに基づいて、前記第2通信部が識別情報を取得したデバイスのうち前記特定のデバイスに該当するデバイスを選択するデバイス選択部と、を備え、前記第2通信部は、前記選択されたデバイスの前記第2エンドポイントに対する通信を実行する。 One aspect of the present invention is a communication control apparatus that controls communication with a device, and a first communication unit that acquires identification information of the specific device by communication with the first endpoint of the specific device; A second communication unit that acquires identification information of the communicable device by communication with the second endpoint of a device communicable using the second endpoint, and the identification information acquired by the first communication unit And a device selection unit that selects a device corresponding to the specific device among the devices from which the second communication unit has acquired the identification information based on the identification information acquired by the second communication unit. The second communication unit performs communication with the second endpoint of the selected device.
当該構成によれば、通信制御装置は、通信対象である特定のデバイスとの間で第2エンドポイントを用いた通信経路を確実に確保することができる。つまり、当該通信対象である特定のデバイスとの間で、第1エンドポイントを用いた通信経路と干渉しない別の通信経路が確保される。これにより、通信の安定性や確実性が担保され、特定のデバイスとの通信を適切に行うことができる。 According to the said structure, the communication control apparatus can ensure the communication path | route using a 2nd endpoint between the specific devices which are communication objects. That is, another communication path that does not interfere with the communication path using the first endpoint is secured with the specific device that is the communication target. Thereby, the stability and certainty of communication are ensured, and communication with a specific device can be performed appropriately.
本発明の態様の1つは、前記第1エンドポイントは、プリンタークラスによる通信で用いるエンドポイントであり、前記第2エンドポイントは、ベンダークラスによる通信で用いるエンドポイントであり、前記第1通信部および前記第2通信部は、通信先のUSBデバイスが有するステータス情報に含まれている前記識別情報を取得するとしてもよい。
当該構成によれば、第1、第2エンドポイントそれぞれを用いたUSBデバイス(プリンター)との通信により取得可能なステータス情報の中から、識別情報を得ることができる。
In one aspect of the present invention, the first end point is an end point used for communication by a printer class, the second end point is an end point used for communication by a vendor class, and the first communication unit The second communication unit may acquire the identification information included in the status information of the USB device that is the communication destination.
According to this configuration, identification information can be obtained from status information that can be acquired by communication with a USB device (printer) using each of the first and second endpoints.
本発明の態様の1つは、通信制御装置は、前記第2エンドポイントを用いた通信に対応するUSBデバイスのグループを定義するグループIDを予め有し、前記第2通信部は、認識可能なUSBデバイスのうち前記グループIDが定義するグループに属するUSBデバイスから前記識別情報を取得するとしてもよい。
当該構成によれば、前記第2エンドポイントを用いた通信に対応する各USBデバイスから容易に識別情報を得ることができる。
One of the aspects of the present invention is that the communication control apparatus has in advance a group ID that defines a group of USB devices corresponding to communication using the second endpoint, and the second communication unit is recognizable. The identification information may be acquired from USB devices belonging to a group defined by the group ID among USB devices.
According to this configuration, identification information can be easily obtained from each USB device that supports communication using the second endpoint.
本発明の態様の1つは、前記第1通信部は、プリンターである前記特定のデバイスの前記第1エンドポイントに対する通信により、前記特定のデバイスに印刷を実行させるための印刷データを送信し、前記第2通信部は、前記選択されたデバイスであるUSBデバイスの前記第2エンドポイントに対する通信により、前記選択されたUSBデバイスの機能設定にかかわるコマンドを送信するとしてもよい。
当該構成によれば、通信制御装置とプリンターとの間で、印刷実行にかかわる通信と、前記コマンドの送受信とを、互いに干渉することなく独立して実行することができる。
In one aspect of the present invention, the first communication unit transmits print data for causing the specific device to execute printing by communication with the first endpoint of the specific device that is a printer. The second communication unit may transmit a command related to the function setting of the selected USB device through communication with the second endpoint of the USB device that is the selected device.
According to this configuration, it is possible to independently execute communication related to print execution and transmission / reception of the command between the communication control device and the printer without interfering with each other.
本発明の技術的思想は、通信制御装置以外によっても実現される。例えば、通信制御装置の各部に上述したような各処理を実行させるプログラム(通信制御プログラム)や、当該プログラムを記憶したコンピューター読み取り可能な記憶媒体や、通信制御装置の各部による上述したような各処理を含んだ方法等を、それぞれ発明として捉えることができる。 The technical idea of the present invention is also realized by a device other than the communication control device. For example, a program (communication control program) that causes each unit of the communication control device to execute each process as described above, a computer-readable storage medium that stores the program, or each process as described above by each unit of the communication control device Each of these methods can be regarded as an invention.
以下、図面を参照しながら本発明の実施形態を説明する。各図は、本実施形態を説明するための例示に過ぎない。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. Each figure is only an example for explaining the present embodiment.
図1は、本実施形態にかかるホスト10の構成等を示すブロック図である。ホスト10は、PCやPCに相当する能力を有する装置である。ホスト10は、USBデバイスなどのデバイスとの通信を制御する通信制御装置の具体例である。ホスト10は、USBデバイスの1つであるプリンター30と接続してプリンター30を制御する。従って、ホスト10を、印刷制御装置と呼んでもよい。また、ホスト10の全体を通信制御装置や印刷制御装置と捉えるだけでなく、ホスト10が有する構成の一部(例えば、制御部11を含む構成)を通信制御装置や印刷制御装置と捉えることも可能である。
FIG. 1 is a block diagram showing the configuration of the
ホスト10は、例えば、RAM、ROM、CPU等を備えるICやその他の記憶媒体等による制御部11を備える。また、ホスト10は、例えばハードディスクドライブにより構成される記憶装置12や、操作受付部13や、USBインターフェイス(I/F)14や、表示部15等を備える。操作受付部13は、外部(ユーザー)からの入力操作を受け付けるための手段であり、マウス、キーボード、タッチパネル、各種入力キーやボタン等が該当し得る。表示部15は、制御部11による制御下で種々の画像を表示するディスプレイである。前記タッチパネルは、表示部15に表示される。
The
USBIF14は、1つ以上のUSBポートを含んでおり、当該USBポートおよびUSBケーブル40を介してプリンター30と接続している。つまり本実施形態では、ホスト10‐プリンター30間の通信は、USBケーブル40を介して実行される。プリンター30は、図示は省略しているが、公知のプリンターが有するあらゆる構成を有し得る。プリンター30は、プリンターとしての機能だけでなく、例えば、スキャナーやファクシミリやネットワーク端末といった複数の機能を併せ持つ複合機であってもよい。プリンター30は、特定のデバイスの一例に該当する。図示していないが、ホスト10のUSBIF14に対しては、プリンター30とは別の1台以上のUSBデバイスが、複数のUSBポートやUSBハブ等を介して接続していてもよい。
The USBIF 14 includes one or more USB ports, and is connected to the
制御部11では、CPUが、ROMやその他の記憶媒体や記憶装置12に記憶された各プログラムに従った処理をOS20の下で実行することにより、これらプログラムの一種であるアプリケーション21や、プリンタードライバー22や、通信制御モジュール23等の機能を実現する。OS20は、Microsoft社が提供するWindowsであり、プリンタードライバー22は、このようなOS20の下で動作可能な、例えばXPS Version4に対応するプリンタードライバーであるとする。通信制御モジュール23は、後述するプリンタークラス24やベンダークラス25へアクセスするためのI/Fを有する。通信制御モジュール23は、通信制御プログラムに該当する。また、通信制御モジュール23をプリンタードライバー22が有する拡張機能の一種と捉えてもよい。
In the
USBデバイスがUSBIF14に接続されると、ホスト10は、プラグアンドプレイにより、当該USBデバイスの種類に対応するクラスドライバーを呼び出す。図1のように、USBIF14にプリンター30が接続された場合は、通信制御モジュール23は、プリンター30からディスクリプターを取得し、このディスクリプターにより、接続しているUSBデバイスがプリンターであることを認識する。この結果、通信制御モジュール23は、プリンターとの通信を実現するためのクラスドライバーであるプリンタークラス24を呼び出す。このように、USBIF14に接続されたUSBデバイスの自動検知から始まる一連の標準的な初期動作を、エニュメレーションとも呼ぶ。プリンタークラス24は、通信先のUSBデバイスの種類(この場合プリンター)に応じて標準化されている通信プロトコル(USB通信におけるデータ転送の手順)およびエンドポイントを用いて通信を実現する。
When the USB device is connected to the USBIF 14, the
アプリケーション21は、例えば、表計算、文書作成、描画あるいはその他の特定の機能を有する様々なソフトウェアである。ユーザーは、ホスト10において、アプリケーション21を起動させた状態で、表示部15に表示させた所定のユーザーインターフェイス(UI)画面に対する操作受付部13による入力により、印刷先のデバイスとしてプリンター30を選択し、印刷指示を行うことができる。当該印刷指示により、当該選択されたプリンター30に対応するプリンタードライバー22が起動する。
The
プリンタードライバー22は、アプリケーション21が生成したデータに基づいて、印刷データを生成する。アプリケーション21が生成するデータは、XPSのフォーマットに対応したファイルが想定されるが、これ以外のフォーマットに対応したデータであってもよい。印刷データは、プリンター30に印刷を実行させるためのデータ(プリンター30が解釈可能なデータ)である。印刷データのフォーマットは種々考えられるが、プリンター30が例えばインクジェットプリンターであれば、画素毎のドットのオン・オフを規定したビットマップデータであったりする。
The
プリンタードライバー22によって生成された印刷データは、通信制御モジュール23によって、スプーラー26が管理する、前記選択された印刷先のデバイス(プリンター30)に対応したキュー(以下、対応プリンターキュー)に加えられる。スプーラー26は、ホスト10とプリンター30等との間の複数の通信の順序等を管理するソフトウェアであり、OS20が有する一機能であるとも言える。プリンタークラス24は、前記対応プリンターキューに並んだデータをプリンター30へ送信する。このとき、プリンタークラス24は、プリンター30が有するエンドポイントのうち決められたエンドポイントに対する通信を行う。
The print data generated by the
エンドポイントとは、USB通信において知られているように、通信端点の一種である。個々のエンドポイントは、バッファを含んで構成される。ホスト10とプリンター30とを繋ぐUSBケーブル40は、物理的には共通のケーブルであるが、プリンター30が複数のエンドポイントを有することで、ホスト10は、それぞれを独立した通信経路として認識する。図1の例では、プリンター30は、少なくともエンドポイントEP1,EP2を含む複数のエンドポイントを有する。
An end point is a type of communication end point as is known in USB communication. Each endpoint is configured to include a buffer. The USB cable 40 that connects the
エンドポイントEP1は、プリンタークラス24による通信に用いられるエンドポイント(第1エンドポイント)である。プリンタークラス24は、USBI/F14からプリンター30に向けて何らかのデータ(例えば、印刷データを含んだパケット)を送信する際、エンドポイントEP1に一義的に対応するエンドポイントアドレスを付加して送信する。当該エンドポイントEP1に対応するエンドポイントアドレスを有するパケットが、エンドポイントEP1に一時的に保持される。プリンター30側の制御部31は、エンドポイントEP1に対して送信されたデータに応じて、印刷等の処理を実行する。このような、エンドポイントEP1に対応するエンドポイントアドレスのOS20上での設定登録は、例えば、通信制御モジュール23をOS20にインストールするとき、あるいは前記エニュメレーションの過程で実行される。
The end point EP1 is an end point (first end point) used for communication by the
アプリケーション21は、プリンター30と通信するために、前記対応プリンターキューを指定する。例えば、上述したようにユーザーがUI画面に対する入力により印刷先のデバイスとしてプリンター30を選択する操作が、アプリケーション21にとっては前記対応プリンターキューを指定する処理となる。上述したように前記対応プリンターキューに加えられたデータは、プリンタークラス24によって、プリンター30のエンドポイントEP1に対して送信される。つまり、前記対応プリンターキューとプリンター30のエンドポイントEP1とは実質的に紐付けられていると言える。従って、アプリケーション21は、前記対応プリンターキューを指定することにより、確実にプリンター30のエンドポイントEP1に対する通信を行うことができる。
The
一方、エンドポイントEP2は、汎用的なエンドポイント(第2エンドポイント)である。USBデバイスは、当該USBデバイスのベンダーが独自に定めた通信プロトコルを用いるクラスドライバー(ベンダークラス25)との通信のために、このような汎用的なエンドポイントEP2を有することができる。ベンダークラス25は、USBI/F14からUSBデバイス(例えば、プリンター30)に向けて何らかのデータ(当該データを含んだパケット)を送信する際、エンドポイントEP2に一義的に対応するエンドポイントアドレスを付加して送信する。当該エンドポイントEP2に対応するエンドポイントアドレスを有するパケットが、送信先のUSBデバイスのエンドポイントEP2に一時的に保持される。プリンター30側の制御部31は、エンドポイントEP2に対して送信されたデータに応じた処理を実行する。
On the other hand, the end point EP2 is a general-purpose end point (second end point). The USB device can have such a general-purpose endpoint EP2 for communication with a class driver (vendor class 25) that uses a communication protocol uniquely determined by the vendor of the USB device. The
しかし、ベンダークラス25は、プリンタークラス24とは異なり、前記対応プリンターキューとの対応付けがOS20によって当然に実行されるものではない。そのため、前記対応プリンターキューとプリンター30のエンドポイントEP2とは紐付けられておらず、従来、アプリケーション21は、前記対応プリンターキューを指定してもプリンター30のエンドポイントEP2に対する通信を行うことはできなかった。このような課題を鑑みて、本実施形態では、以下に説明する通信制御処理を行う。
However, unlike the
図2は、本実施形態にかかる通信制御処理を示すフローチャートである。図2では、アプリケーション21によって実現される処理と、主に通信制御モジュール23によって実現される処理とを併せて示している。
FIG. 2 is a flowchart showing communication control processing according to the present embodiment. In FIG. 2, processing realized by the
アプリケーション21は、前記対応プリンターキューを指定した上で、通信制御モジュール23に所定のコマンドの送信を依頼する(ステップS100)。当該コマンドは、例えば、プリンター30の機能設定にかかわるコマンドである。具体的には、プリンター30が有する種々の機能のうちいずれを有効化していずれを無効化するかといった設定や、当該設定の変更のためにホスト10とプリンター30との間でやり取りが必要なコマンドの一種である。また、当該コマンドは、プリンター30におけるインクや用紙といった消耗品の状態をホスト10が問い合わせるためのコマンドであったり、プリンター30に印字ヘッドのクリーニング等のメンテナンス処理を実行させるためのコマンドであったりする。
The
前記依頼を受けた通信制御モジュール23は、前記指定された前記対応プリンターキューにステータス情報要求を加えることにより、プリンタークラス24に、プリンター30のステータス情報を取得するための通信を実行させる(ステップS200)。プリンタークラス24は、プリンター30のエンドポイントEP1に対してステータス情報要求を送信する。プリンター30側では、エンドポイントEP1を介してステータス情報要求を受信した制御部31が、プリンター30のステータス情報をプリンタークラス24に対して送信する。この結果、通信制御モジュール23は、プリンター30のステータス情報を得ることができる。
Upon receiving the request, the
一般に、USBデバイスのステータス情報には、当該USBデバイスの状態(プリンターであれば「印刷中」等の状態)の他、各種オプション機能の有無など、デバイス独自の様々な情報が含まれている。また本実施形態では、プリンター30のステータス情報には、当該プリンター30の個体識別IDが含まれているものとする。個体識別IDとは、1台の製品に1つ割り当てられたユニークな識別情報である。従って、量産される同型のプリンターであっても、それぞれが異なる個体識別IDを有する。
In general, the status information of a USB device includes various information unique to the device, such as the presence or absence of various optional functions, in addition to the status of the USB device (“printing” status for a printer). In this embodiment, it is assumed that the status information of the
通信制御モジュール23は、ステップS200で取得したプリンター30のステータス情報の中から個体識別IDを抽出し、当該抽出した個体識別IDを所定の記憶領域に保持する(ステップS210)。このようなステップS200,S210によれば、通信制御モジュール23およびプリンタークラス24は、特定のUSBデバイス(プリンター30)のエンドポイントEP1に対する通信により当該特定のUSBデバイスの識別情報を取得する第1通信部、として機能すると言える。
The
次に、通信制御モジュール23は、OS20がUSBI/F14を介して認識可能なUSBデバイスのうち、前記エンドポイントEP2を用いたUSB通信(ベンダークラス25によるUSB通信)に対応するUSBデバイスのリストを取得する(ステップS220)。プリンター30は、当然、前記エンドポイントEP2を用いたUSB通信に対応するUSBデバイスである。本実施形態では、ホスト10は、エンドポイントEP2に対応するエンドポイントアドレスと、当該エンドポイントEP2を用いたUSB通信に対応するUSBデバイスのグループを定義する一意のグループIDとを、予め有しているものとする。このようなエンドポイントアドレスやグループIDのOS20上での設定登録は、例えば、通信制御モジュール23をOS20にインストールするとき、あるいは前記エニュメレーションの過程で実行される。
Next, the
ステップS220について、具体的に説明する。通信制御モジュール23は、前記認識可能なUSBデバイス毎のデバイスパスの中から前記グループIDを含んでいるデバイスパスを抽出し、前記リストとして、当該抽出したデバイスパスのリスト(デバイスパスリスト)を生成する。デバイスパスは、OS20が接続している各USBデバイスを認識するために内部的に保持している情報である。
Step S220 will be specifically described. The
図3は、デバイスパスリスト50の一例を示している。デバイスパスリスト50では、インデックス(例えば、番号1,2,3…で表現される見出し)毎にデバイスパスが記されている。あるUSBデバイスのデバイスパス(インデックス番号1のデバイスパス)は、例えば、以下のように表される。
\\?\usb#vid_04zz&pid_1104&mi_03#6&145699dd&0&0003#{2826B7BA-16B3-4EBA-B5A6-28684BC0A1DD}
FIG. 3 shows an example of the device path list 50. In the device path list 50, a device path is described for each index (for example, headings expressed by
\\? \ usb # vid_04zz & pid_1104 & mi_03 # 6 & 145699dd & 0 & 0003 # {2826B7BA-16B3-4EBA-B5A6-28684BC0A1DD}
このようなデバイスパスにおいて“vid_04zz” の“04zz”が、ベンダーIDに該当する。ベンダーIDとは、デバイスを製造するベンダー毎に与えられたIDであり、同じベンダーが製造した製品の全てに同じベンダーIDが与えられる。本実施形態においては、デバイスパスリスト50に含まれる各デバイスパスにおけるベンダーIDは、当然、プリンター30を製造したベンダーに対応するベンダーIDである。また、前記デバイスパスにおいて“pid_1104” の“1104”が、プロダクトIDに該当する。プロダクトIDは、同じベンダーの同じ製品に共通して与えられるIDである。デバイスパスリスト50に含まれる各デバイスパスにおけるプロダクトIDは、同じであったり違っていたりする。また、前記デバイスパスにおいて“2826B7BA-16B3-4EBA-B5A6-28684BC0A1DD”は、前記グループIDに該当する。つまり、デバイスパスリスト50は、あるベンダーが製造する製品群の中で前記グループIDを共通して持つグループに属するUSBデバイスの(デバイスパスの)リストであると言える。
In such a device path, “04zz” of “vid_04zz” corresponds to the vendor ID. The vendor ID is an ID given to each vendor that manufactures a device, and the same vendor ID is given to all products manufactured by the same vendor. In the present embodiment, the vendor ID in each device path included in the device path list 50 is naturally a vendor ID corresponding to the vendor that manufactured the
ホスト10に接続するUSBデバイスが、仮に、図1が示すようにプリンター30の1台のみであれば、デバイスパスリスト50に含まれるデバイスパスは、プリンター30のデバイスパスのみとなる。一方、ホスト10に接続するUSBデバイスが、プリンター30を含めて複数存在していれば、デバイスパスリスト50には複数のデバイスパスが列記され得る。
If only one USB device is connected to the
次に、通信制御モジュール23は、ステップS220で生成した前記リストに含まれるUSBデバイスを1つ指定し、ベンダークラス25に、この指定したUSBデバイス(指定USBデバイス)のステータス情報を取得するための通信を実行させる(ステップS230)。図3の例を参照した場合、通信制御モジュール23は、例えば、デバイスパスリスト50におけるインデックス番号が若い方から順にデバイスパスを1つ指定する。ベンダークラス25は、当該指定されたデバイスパスが示す指定USBデバイスのエンドポイントEP2に対してステータス情報要求を送信する。当該送信を受ける側の指定USBデバイスは、エンドポイントEP2を介してステータス情報要求を受信し、この要求に応じてステータス情報をベンダークラス25に対して送信する。この結果、通信制御モジュール23は、指定USBデバイスのステータス情報を得ることができる。
Next, the
通信制御モジュール23は、ステップS230で取得した指定USBデバイスのステータス情報の中から個体識別IDを抽出するとともに、当該抽出した指定USBデバイスの個体識別IDと、ステップS210で保持したプリンター30の個体識別IDとを比較する(ステップS240)。そして、通信制御モジュール23は、指定USBデバイスの個体識別IDと、プリンター30の個体識別IDとが一致するか否かに応じて処理を分岐する(ステップS250)。通信制御モジュール23は、それら個体識別IDが一致する場合(ステップS250において“Yes”)、ステップS250からステップS260へ進み、一方、それら個体識別IDが一致しない場合(ステップS250において“No”)、ステップS250からステップS230へ戻る。
The
指定USBデバイスの個体識別IDと、プリンター30の個体識別IDとが一致する場合、ステップS200でプリンタークラス24が通信した特定のUSBデバイスであるプリンター30と、ステップS230でベンダークラス25が通信したUSBデバイス(指定USBデバイス)とが同じ機体ということになる。一方、それら個体識別IDが一致しない場合は、ステップS200でプリンタークラス24が通信したプリンター30とは別のUSBデバイスと、ステップS230でベンダークラス25が通信したということになる。ステップS250から進んだステップS230では、通信制御モジュール23は、ステップS220で生成した前記リストに含まれるUSBデバイスのうち現時点で未指定のUSBデバイスを次の指定USBデバイスとし、上述の処理(ステップS230〜S250)を繰り返す。
If the individual identification ID of the designated USB device matches the individual identification ID of the
このようなステップS220〜S240によれば、通信制御モジュール23およびベンダークラス25は、エンドポイントEP2を用いて通信可能なUSBデバイスのエンドポイントEP2に対する通信により、当該通信可能なUSBデバイスの識別情報を取得する第2通信部、として機能すると言える。また、ステップS240,S250によれば、通信制御モジュール23は、第1通信部により取得された識別情報(特定のUSBデバイス(プリンター30)の個体識別ID)と、第2通信部により取得された識別情報(指定USBデバイスの個体識別ID)とに基づいて、第2通信部が識別情報を取得したUSBデバイスのうち特定のUSBデバイスに該当するUSBデバイスを選択するデバイス選択部、として機能すると言える。
According to such steps S220 to S240, the
ステップS260では、通信制御モジュール23は、ベンダークラス25に、前記特定のUSBデバイスに該当するとして選択したUSBデバイス、つまり指定USBデバイスへのコマンド送信を実行させる。言うまでもなく、ステップS260の段階での指定USBデバイスの実体はプリンター30である。ベンダークラス25は、指定USBデバイスのエンドポイントEP2に対してコマンドを送信する。当該コマンドは、ステップS100でアプリケーション21が通信制御モジュール23に送信を依頼したコマンドである。ステップ260によれば、第2通信部は、前記選択されたUSBデバイスのエンドポイントEP2に対する通信を実行する、と言える。
In step S260, the
ステップS260によるコマンド送信を受ける側の指定USBデバイス(=プリンター30)は、エンドポイントEP2を介して前記コマンドを受信し、受信したコマンドに応じた応答内容を表した応答データをベンダークラス25に対して送信する。これにより、通信制御モジュール23は、前記送信したコマンドに対する応答データを受信する(ステップS270)。そして、通信制御モジュール23は、ステップS270で受信した応答データをアプリケーション21へ送る。つまり、アプリケーション21からのコマンド送信の依頼(ステップS100)に対して、応答データを返す(ステップS280)。この結果、アプリケーション21は、当該応答データを受信する(ステップS110)。
The designated USB device (= printer 30) on the side that receives the command transmission in step S260 receives the command via the end point EP2, and sends response data representing the response content corresponding to the received command to the
このように本実施形態によれば、ホスト10は、通信対象である特定のUSBデバイスとの間でエンドポイントEP2を用いた通信経路を確実に確保することができる。つまり、通信対象であるプリンター30との間で、通常確保されるエンドポイントEP1を用いた通信経路に加え、当該通信経路と干渉しないエンドポイントEP2を用いた別の通信経路が確保される。
As described above, according to the present embodiment, the
具体的には、ホスト10において、アプリケーション21が、プリンター30に前記コマンドを送信するために前記対応プリンターキューを指定し、コマンド送信を通信制御モジュール23に依頼すると(ステップS100)、通信制御モジュール23は、ステップS200〜S280を実行する。つまり、アプリケーション21は、前記ステップS100を実行するだけで、ベンダークラス25によるエンドポイントEP2を用いた通信を介して前記コマンドに対するプリンター30からの応答データを得ることができる。従って、USB接続したホスト10とプリンター30との間では、例えば、プリンタークラス24によるエンドポイントEP1を用いた通信で、ホスト10からプリンター30へ印刷データを送信し、ベンダークラス25によるエンドポイントEP2を用いた通信で、ホスト10からプリンター30へのコマンド送信および応答データの返信を行うことができる。すなわち、印刷データに関わる通信と前記コマンドに関わる通信とが、混線することなく互いに独立して実行されるため、上述したような排他的通信や同期的通信と同様の効果が実質的に確保され、通信の安定性および確実性が確保される。
Specifically, in the
また上述したように、通信制御モジュール23は、そのとき通信対象とする特定のUSBデバイスからエンドポイントEP1を用いた通信の結果得た個体識別IDと、当該特定のUSBデバイスである可能性があるUSBデバイスからエンドポイントEP2を用いた通信の結果得た個体識別IDとの一致・不一致を見ることで、特定のUSBデバイスに対するエンドポイントEP2を用いた通信経路を確保する。従って本実施形態によれば、前記プロダクトIDが共通する複数のUSBデバイス(例えば、プロダクトIDが共通する複数のプリンター)がホスト10にUSB接続されている環境においても、その中の1台の特定のUSBデバイスとの間で、エンドポイントEP2を用いた通信経路を確実に確保することができる。
Further, as described above, the
また、通信制御装置が実行する本発明にかかる通信の相手先となるデバイスは、USBデバイスに限定されない。つまり、本発明は、上述したようなエンドポイントを用いた通信全般に適用することができる。 Further, a device that is a communication partner of the present invention executed by the communication control apparatus is not limited to a USB device. That is, the present invention can be applied to communication in general using the above-described endpoint.
10…ホスト(通信制御装置)、11…制御部、12…記憶装置、13…操作受付部、14…USBI/F、15…表示部、20…OS、21…アプリケーション、22…プリンタードライバー、23…通信制御モジュール、24…プリンタークラス、25…ベンダークラス、26…スプーラー、30…プリンター、31…制御部、40…USBケーブル、50…デバイスパスリスト、EP1,EP2…エンドポイント
DESCRIPTION OF
Claims (5)
特定のデバイスの第1エンドポイントに対する通信により、前記特定のデバイスの識別情報を取得する第1通信部と、
第2エンドポイントを用いて通信可能なデバイスの前記第2エンドポイントに対する通信により、前記通信可能なデバイスの識別情報を取得する第2通信部と、
前記第1通信部により取得された識別情報と、前記第2通信部により取得された識別情報とに基づいて、前記第2通信部が識別情報を取得したデバイスのうち前記特定のデバイスに該当するデバイスを選択するデバイス選択部と、を備え、
前記第2通信部は、前記選択されたデバイスの前記第2エンドポイントに対する通信を実行する、ことを特徴とする通信制御装置。 A communication control device for controlling communication with a device,
A first communication unit that acquires identification information of the specific device by communication with the first endpoint of the specific device;
A second communication unit that acquires identification information of the communicable device by communication with the second endpoint of a device communicable using the second endpoint;
Based on the identification information acquired by the first communication unit and the identification information acquired by the second communication unit, the second communication unit corresponds to the specific device among the devices from which the identification information has been acquired. A device selection unit for selecting a device,
The communication control apparatus, wherein the second communication unit executes communication with the second endpoint of the selected device.
前記第2エンドポイントは、ベンダークラスによる通信で用いるエンドポイントであり、
前記第1通信部および前記第2通信部は、通信先のUSBデバイスが有するステータス情報に含まれている前記識別情報を取得することを特徴とする請求項1に記載の通信制御装置。 The first endpoint is an endpoint used in communication by a printer class,
The second endpoint is an endpoint used for communication by a vendor class,
The communication control apparatus according to claim 1, wherein the first communication unit and the second communication unit acquire the identification information included in status information included in a communication destination USB device.
前記第2通信部は、認識可能なUSBデバイスのうち前記グループIDが定義するグループに属するUSBデバイスから前記識別情報を取得することを特徴とする請求項1または請求項2に記載の通信制御装置。 It has in advance a group ID that defines a group of USB devices corresponding to communication using the second endpoint,
3. The communication control apparatus according to claim 1, wherein the second communication unit acquires the identification information from a USB device belonging to a group defined by the group ID among recognizable USB devices. .
前記第2通信部は、前記選択されたデバイスであるUSBデバイスの前記第2エンドポイントに対する通信により、前記選択されたUSBデバイスの機能設定にかかわるコマンドを送信することを特徴とする請求項1〜請求項3のいずれかに記載の通信制御装置。 The first communication unit transmits print data for causing the specific device to execute printing by communication with the first endpoint of the specific device that is a printer,
The said 2nd communication part transmits the command regarding the function setting of the said selected USB device by communication with respect to the said 2nd endpoint of the USB device which is the said selected device, The said 1st communication part is characterized by the above-mentioned. The communication control apparatus according to claim 3.
特定のデバイスの第1エンドポイントに対する通信により、前記特定のデバイスの識別情報を取得する第1通信機能と、
第2エンドポイントを用いて通信可能なデバイスの前記第2エンドポイントに対する通信により、前記通信可能なデバイスの識別情報を取得する第2通信機能と、
前記第1通信機能により取得された識別情報と、前記第2通信機能により取得された識別情報とに基づいて、前記第2通信機能が識別情報を取得したデバイスのうち前記特定のデバイスに該当するデバイスを選択するデバイス選択機能と、を前記装置に実行させ、
前記第2通信機能は、前記選択されたデバイスの前記第2エンドポイントに対する通信を前記装置に実行させる、ことを特徴とする通信制御プログラム。 A communication control program for controlling an apparatus that communicates with a device,
A first communication function for acquiring identification information of the specific device by communication with the first endpoint of the specific device;
A second communication function for acquiring identification information of the communicable device by communication with the second endpoint of a device communicable using the second endpoint;
Based on the identification information acquired by the first communication function and the identification information acquired by the second communication function, the second communication function corresponds to the specific device among the devices from which the identification information has been acquired. A device selection function for selecting a device;
The communication control program, wherein the second communication function causes the apparatus to execute communication with the second endpoint of the selected device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016065388A JP2017182257A (en) | 2016-03-29 | 2016-03-29 | Communication controller and communication control program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016065388A JP2017182257A (en) | 2016-03-29 | 2016-03-29 | Communication controller and communication control program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2017182257A true JP2017182257A (en) | 2017-10-05 |
Family
ID=60007010
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016065388A Pending JP2017182257A (en) | 2016-03-29 | 2016-03-29 | Communication controller and communication control program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2017182257A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7463117B2 (en) | 2020-01-31 | 2024-04-08 | キヤノン株式会社 | Information processing device and program |
-
2016
- 2016-03-29 JP JP2016065388A patent/JP2017182257A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7463117B2 (en) | 2020-01-31 | 2024-04-08 | キヤノン株式会社 | Information processing device and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20100328689A1 (en) | Host device and image forming apparatus controlled by host device, and peripheral device control method | |
US8947708B2 (en) | Information processing apparatus, method for controlling an information processing apparatus, and image forming system | |
US11334301B2 (en) | Information-processing device executing renaming process to modify print queue name | |
JP7196494B2 (en) | programs and communication systems | |
JP2017182257A (en) | Communication controller and communication control program | |
JP6582830B2 (en) | Monitor program, communication program, information processing apparatus, image forming apparatus, and image forming system | |
KR102051276B1 (en) | Printing control device, printing system, and printing control method | |
JP6486233B2 (en) | Peripheral device, method thereof, and program | |
JP2006243840A (en) | Print information processor, print information processing method, print information processing program, and computer-readable storage medium | |
JP4040396B2 (en) | Notification method, information processing apparatus, and control program | |
US10976972B2 (en) | System including information processing device, and multiple devices connected to information processing device via a network, and information processing device and non-transitory computer-readable recording medium for setting connection destination of information processing device | |
US11334300B2 (en) | Non-transitory storage medium storing program readable by computer of information processing apparatus, non-transitory storage medium storing program set, and information processing apparatus | |
JP6962116B2 (en) | Computer programs and communication equipment for communication equipment | |
EP2423802B1 (en) | Print control device | |
JP4726250B2 (en) | Information processing apparatus, control method therefor, and computer program | |
JP7375391B2 (en) | Programs and information processing equipment | |
JP2016181103A (en) | Printing control device, printing system, and printing control method | |
US8762582B2 (en) | Data processing apparatus capable of communicating with external device via a plurality of logical lines, data processing system, data processing device storing data processing program, and device driver | |
JP5045966B2 (en) | Image forming system | |
JP5745935B2 (en) | Printing system, print data conversion apparatus, print data conversion method, computer program, and recording medium | |
US11055041B2 (en) | Information-processing device acquiring wireless identification information via wired communication for setting up command program | |
US20210334051A1 (en) | Non-transitory storage medium storing plurality of instructions readable by computer of information processing apparatus and information processing apparatus | |
JP2022184201A (en) | Program, program set, information processing apparatus, and method | |
JP4133226B2 (en) | Printing apparatus and OEMID information control method | |
JP6265053B2 (en) | Printing control apparatus, printing system, and printing control method |