JP2004334798A - System, method, program of communication control and storage medium - Google Patents

System, method, program of communication control and storage medium Download PDF

Info

Publication number
JP2004334798A
JP2004334798A JP2003133594A JP2003133594A JP2004334798A JP 2004334798 A JP2004334798 A JP 2004334798A JP 2003133594 A JP2003133594 A JP 2003133594A JP 2003133594 A JP2003133594 A JP 2003133594A JP 2004334798 A JP2004334798 A JP 2004334798A
Authority
JP
Japan
Prior art keywords
communication
negotiation
protocol
determined
flow control
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
JP2003133594A
Other languages
Japanese (ja)
Inventor
Takashi Isoda
隆司 礒田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2003133594A priority Critical patent/JP2004334798A/en
Publication of JP2004334798A publication Critical patent/JP2004334798A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Communication Control (AREA)
  • Information Transfer Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a system, a method, a program of communication control and a storage medium of capable preventing redundancy by multiplexing of flow control. <P>SOLUTION: In the case that either of a USB1.1 and a USB2.0 is selected as a protocol of a certain layer irrespective of an intention of an upper layer of the protocol, when the USB1.1 is selected, a protocol, for example, IEEE1284.4-2000, having a flow control function is selected for the upper layer and when the USB2.0 is selected, a protocol without having the flow control function is selected. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
2つ以上の電子機器のデータ交換の際に使用されるプロトコルの選択を制御する通信制御システム、通信制御方法、通信制御用プログラム及び記憶媒体に関する。
【0002】
【従来の技術】
従来は、2つの電子機器がUSB (Universal Serial Bus) version1.0 (またはversion 1.1)か USB version 2.0でデータ交換するとき、USBプロトコルの上位層はUSBのversionを意識せずに上位のプロトコルスタックを固定的に決定していた。
【0003】
例えば、USB version 1.0(以下「version」の文字を省略する)を下位層に利用することを想定して通信プロトコルスタックを構築した場合、バスの利用効率の向上を目的としてUSB1.0の通信上位層としてIEEE1284.4等のデータのフロー制御機能を持つプロトコルを選択することがあった(例えば、特許文献1参照)。
【0004】
【特許文献1】
特開2000−215144号公報
【0005】
【発明が解決しようとする課題】
しかし、USB 1.0の上位互換性を持つUSB 2.0は、USB 1.0において規定されていなかった、データのフロー制御機能(PING、NAK、NYET)を持つ。USB 2.0では USB 2.0自体がフロー制御機能をもつため、USB 2.0の上位プロトコルとしてデータのフロー制御機能を持つプロトコルが選択された場合、フロー制御機能が2重になり、冗長性が増加し、通信効率が低下する問題がある。
【0006】
本発明は、かかる点に鑑みてなされたものであり、フロー制御の多重化による冗長性を防止することができる通信制御システム、通信制御方法、通信制御用プログラム及び記憶媒体を提供することを目的とする。
【0007】
【課題を解決するための手段】
上記目的を達成するために、請求項1の通信制御システムは、2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する決定手段と、前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むか否かを判別する判別手段と、前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルを選択する選択手段と、前記選択手段で選択されたプロトコルを用いて通信を行う通信手段とを備える通信制御システムにおいて、前記判別手段により前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、前記選択手段は前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記判別手段により前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、前記選択手段は前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択するように構成されていることを特徴とする。
【0008】
請求項2の通信制御システムは、請求項1記載の通信制御システムにおいて、前記ネゴシエーションによって決定される通信プロトコルがUSB1.0若しくはUSB1.1であるか又はUSB2.0であるときに、決定された通信プロトコルがこれらの内のいずれであるかを前記選択手段に通知する通知手段を備え、前記選択手段は、前記通知手段による通知がUSB1.0若しくはUSB1.1であるときと、USB2.0であるときとで異なるプロトコルを、前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルとして選択することを特徴とする。
【0009】
請求項3の通信制御システムは、請求項1又は2記載の通信制御システムにおいて、前記選択手段は、記通知手段による通知がUSB1.0若しくはUSB1.1であるときは、フロー制御機能を有するプロトコルを、前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルとして選択することを特徴とする。
【0010】
請求項4の通信制御システムは、請求項3記載の通信制御システムにおいて、前記フロー制御機能を有するプロトコルはIEEE1284.4であることを特徴とする。
【0011】
請求項5の通信制御システムは、請求項3記載の通信制御システムにおいて、前記ネゴシエーションによって決定される通信プロトコルがUSB1.0若しくはUSB1.1であるか又はUSB2.0であるときに、前記ネゴシエーションによって決定された通信プロトコルの上位層は、前記ネゴシエーションによって決定された通信プロトコルにより決定することを特徴とする。
【0012】
請求項6の通信制御システムは、請求項3記載の通信制御システムにおいて、前記ネゴシエーションによって決定される通信プロトコルがUSB1.0若しくはUSB1.1であるか又はUSB2.0で、前記決定された通信プロトコルの上位層が前記ネゴシエーションによって決定された通信プロトコルにより決定するとき、前記2つの機器の一方がその決定された上位層の通信プロトコルを、USB2.0が規定するvendoruniqueコマンドを用いて、前記2つの機器の他方に通知することを特徴とする。
【0013】
請求項7の通信制御システムは、請求項6記載の通信制御システムにおいて、前記2つの機器の一方が、フロー制御機能を有するプロトコルを上位層の通信プロトコルとして選択した場合に、その選択をvendoruniqueコマンドを用いて前記2つの機器の他方に通知することを特徴とする。
【0014】
請求項8の通信制御システムは、請求項3記載の通信制御システムにおいて、前記2つの機器の一方が、フロー制御機能を有する予め指定されたプロトコルを上位プロトコルの1つとして選択した場合に、前記2つの機器の他方は、前記2つの機器の一方がそのプロトコルを選択したことを、前記ネゴシエーションによって決定された通信プロトコルがUSB2.0であることによって検知することを特徴とする。
【0015】
請求項9の通信制御システムは、2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する通信制御システムにおいて、前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含む場合には、前記2つの機器の各々が前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まない場合には、前記2つの機器の各々が前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択し、前記2つの機器の各々が互いに通信を行うように構成されていることを特徴とする。
【0016】
請求項10の通信制御方法は、2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する決定ステップと、前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むか否かを判別する判別ステップと、前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルを選択する選択ステップと、前記選択ステップで選択されたプロトコルを用いて通信を行う通信ステップとを備える通信制御方法において、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択することを特徴とする。
【0017】
請求項11の通信制御用プログラムは、コンピュータが実行する通信制御用プログラムにおいて、2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する決定ステップと、前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むか否かを判別する判別ステップと、前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルを選択する選択ステップと、前記選択ステップで選択されたプロトコルを用いて通信を行う通信ステップとを前記コンピュータに実行させ、さらに、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択することを前記コンピュータに実行させることを特徴とする。
【0018】
請求項12の記憶媒体は、コンピュータが実行する通信制御用プログラムを格納することを特徴とするコンピュータで読み取り可能な記憶媒体において、2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する決定ステップと、前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むか否かを判別する判別ステップと、前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルを選択する選択ステップと、前記選択ステップで選択されたプロトコルを用いて通信を行う通信ステップとを前記コンピュータに実行させ、さらに、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択することを前記コンピュータに実行させる通信制御用プログラムを格納することを特徴とする。
【0019】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照して説明する。
【0020】
図1はUSB1.1とUSB2.0とのプロトコル構成における差異を示す図である。
【0021】
USB1.1とUSB2.0の大きな違いの一つにフロー制御機能の有無がある。USB1.xにおいてOut transactionにおけるNAK応答は、TOKEN、DATA packetの転送が終了した後にしか発行できない。このため、多数のNAK応答が必ずしもハード的又は制御的な異常ではないようなデバイス(例えば、紙なし又は紙づまり等の要因のためNAK応答の回数が多いプリンタ)が接続されると、USB busにOUT→DATA→NAKが多数繰り返し発行されることになる。このOUT→DATA→NAKは、実際にUSB Busを占有する期間が長い上、データ転送としては無効であるため、USB Busでの実際の転送レートを低下させることになり、USBバスに他のデバイスが接続されているときに、そのデバイスとホスト間の通信速度を無意味に遅くすることになる。
【0022】
ところが、USB2.0では、USB1.1では存在しなかったPINGとNYETと言う新しいパケットを仕様として追加し、このパケットでのネゴシエーションによって、USBプロトコルレベルでのフロー制御を可能にしている。
【0023】
Bulk OUTデバイスに対して、ホストはまずPINGパケットによって1パケット分のデータを受け付けるための空きBufferがBulk OUTデバイスにあるかどうかを問い合わせる。Bulk OUTデバイスはデータ受信が可能な場合にはACKで応答し、データ受信が不可能である場合にはNACで応答する。ホストはPINGパケットに対してNAK応答を受信している限り、Bulk OUTデバイスの受信Bufferの空きがないと判断し、PINGを繰り返し送り、Bulk OUTデバイスの受信Bufferの空き状況を確認し続ける。
【0024】
ホストが、PINGパケットに対するBulk OUTデバイスのACK応答を受信したら、実際に送信するデータを内包するパケットをBulk−out転送する。Bulk OUTデバイスはBulk−out転送に対してACK,NYET,NAK応答のいずれかで応答する。
【0025】
Bulk OUTデバイスのBulk−out転送に対するACK応答は、次のBulk−out転送を受信できるだけのBufferの空きがあるので、次のBulk−out転送によるデータ受信が可能なことを示す。このため、ホストは続けてBulk−out転送を行うことができる。NYET応答は、次のBulk−out転送を受信できるだけのBufferの空きがないため、次のBulk−out転送をその時点では受信できないことを示す。このため、ホストは次のBulk−out転送を行う代わりにPINGパケットを送り、Bulk OUTデバイスの受信BufferがBulk−out転送を受信できるだけの空きが生じるのを待つ。
【0026】
このPING、NYETによって無意味にUSB Busのバンド幅を消費してしまうOUT→DATA→NAKのシーケンスの発生を防ぎ、効率的なUSB Busの利用を可能にしている。
【0027】
しかし、現存のUSB機器では上述したUSB1.1の欠点をカバーするため、フロー制御機能を持つプロトコル、例えば、IEEEで規定されているIEEE1284.4−2000等を上位プロトコルを具備しているケースが多い(図1の左側のスタックを参照)。この場合ではIEEE1284.4−2000のみがフロー制御機能を受け持つことになる。しかし、このスタック構成のUSB1.1スタックの部分をUSB2.0と置き換える(図1の右側のスタックを参照)と、IEEE1284.4−2000とUSB2.0の両方がフロー制御機能を持つことにより、冗長性が発生する。そこで、本実施の形態ではUSBスタックがUSB1.1とUSB2.0において、上位にフロー制御機能を持つプロトコルを使用するかどうかを決定する方法を採用した(図2のスタックを参照)。
【0028】
具体的には、USBネゴシエーションの結果がUSB1.1であればその上位プロトコルにフロー制御機能を持つプロトコル(例えばIEEE1284.4−2000等)を必ず採用し、USBネゴシエーションの結果がUSB2.0であれば、その上位プロトコルにフロー制御機能を持たないプロトコルを採用、又は上位プロトコルとして何も採用しないようにする。
【0029】
図3は、本実施の形態に係る通信制御システムをホストコンピュータ100及びプリンタ200に適用した模式図を示す。
【0030】
図4は、図3におけるホストコンピュータ100の内部構成を示すブロック図である。
【0031】
ホストコンピュータ100は、各構成部分を制御するCPU1と、該CPU1のワークエリアを提供するRAM2と、各種プログラムを格納するハードディスク3と、ユーザーのコマンドを入力するマウスやキーボード等のユーザーコマンド入力装置4と、USBポート5と、CPU1、RAM2、ハードディスク3、ユーザーコマンド入力装置4及びUSBポート5をそれぞれ接続するメインバス8とを備えている。ハードディスク3は、プログラムを記憶できる記憶媒体であれば、どのようなものでもよく、例えば、フロッピー(登録商標)ディスク、CD−ROM、DVD、フラッシュラム等でもよい。
【0032】
図5は、図3におけるプリンタ200の内部構成を示すブロック図である。
【0033】
プリンタ200は、各構成部分を制御するCPU11と、該CPU11のワークエリアを提供するRAM12と、各種プログラムを格納するハードディスク13と、印字用紙に印字を実行する印字装置14と、USBポート15と、CPU11、RAM12、ハードディスク13、印字装置14及びUSBポート15をそれぞれ接続するメインバス18とを備えている。ハードディスク13は、プログラムを記憶できる記憶媒体であれば、どのようなものでもよく、例えば、フロッピー(登録商標)ディスク、CD−ROM、DVD、フラッシュラム等でもよい。
【0034】
尚、本発明は特に断らない限り、ホストコンピュータ100では、CPU1がメインバス8を介してRAM2、ハードディスク3、ユーザーコマンド入力装置4及びUSBポート5を制御して、本発明を実施する。プリンタ200では、CPU11がメインバス18を介してRAM12、ROM13、印字装置14及びUSBポート15を制御して、本発明を実施する。
【0035】
図6は、ホストコンピュータ100がプリンタ200とUSB回線で接続されたときに、USBスタックより上層のプロトコルススタックを構築する工程を示すフローチャートである。
【0036】
ホストコンピュータ100は常にUSBポート5上に新しいデバイス、即ち、プリンタ200が接続されたどうかを監視する(ステップS101)。そして、プリンタ200が接続されれば、U SBスタックとUSBコントローラを介してプリンタ200とネゴシエーションを行い(ステップS102)、USB通信をUSB1.1で規定する方法で行うのか又はUSB2.0で規定する方法で行うのかを決定する(ステップS103)、即ち使用するプロトコルがUSB2.0か又はUSB1.1に決定される。このネゴシエーションの方法については、Universal Serial Bus Specification Revision 2.0に記載されているが、本発明とは直接関係がないので、その詳細は省略する。
【0037】
そして、ホストコンピュータ100は、プリンタ200のUniversal Serial Bus Specification Revision 2.0又はUniversal Serial Bus Specification Revision 1.1が規定するディスクリプション(description)を読み出し(ステップS104)、ディスクリプションのクラスIDによりプリンタ200がUSBプリンタクラスをサポートすることが判明した場合には、CPU1はUSBプリンタクラスモジュールを上位のモジュールスタックの1つとすることを決定する(ステップS105)。
【0038】
次いで、CPU1はステップS103で決定したUSBプロトコルがUSB1.1であるか又はUSB2.0であるかを判別する(ステップS106)。
【0039】
ステップS106の判別の結果、ステップS103で決定したUSBプロトコルがUSB1.1である場合には、USB1.1にはフロー制御機能がないので、CPU1はUSB1.1モジュールのすぐ上位のプロトコルとしてフロー制御機能を持つIEEE1284.4−2000を使用する(ステップS107)。尚、IEEE1284.4−2000については、IEEEの規格書に記載されているが、本発明と直接には関係ないので、その説明は省略する。
【0040】
次いで、CPU1は、ステップS105で決定したUSBプリンタクラスをIEEE1284.4プロトコルのすぐ上位のプロトコルスタックのプロトコルとして使用する(ステップS108)。そして、USBプリンタクラスを司るモジュール内の1284.4FLGをONにして、USBプリンタクラスの下位プロトコルがIEEE1284.4であることを示し(ステップS109)、本処理を終了する。
【0041】
上記ステップS106の判別の結果、ステップS103で決定したUSBプロトコルがUSB2.0の場合には、USB2.0にはフロー制御機能があり、上位にはフロー制御機能を持つプロトコルは必要ないので、CPU1は、ステップS105で決定したUSBプリンタクラスのプロトコルをUSB2.0プロトコルのすぐ上位のプロトコルとして使用する(ステップS110)。そして、USBプリンタクラスを司どるスタック内の1284.4FLGをOFFにして、USBプリンタクラスの下位プロトコルがIEEE1284.4プロトコルでないことを示し(ステップS111)、本処理を終了する。
【0042】
図7〜9は、ホストコンピュータ100がプリンタ200にデータを送信する方法を示すフローチャートである。
【0043】
まず、ホストコンピュータ100において、プリンタ200にデータを送信する可能性のあるアプリケーションが起動する(ステップS201)。
【0044】
次に、CPU1は、アプリケーションにおいて、プリンタ200に対してデータ送信要求が発生したか否かを判別し(ステップS202)、プリンタ200に対してデータ送信要求が発生した場合には、送信すべきデータをUSBプリンタクラスを司るモジュールに渡す(ステップS203)。
【0045】
次いで、CPU1は、データを受け取ったUSBプリンタクラスを司るモジュール内の1284.4FLGがONであるか否かを判別する(ステップS204)。1284.4FLGがONである場合には、CPU1は、すぐ下位のプロトコルがIEEE1284.4プロトコルであると認識し、アプリケーションから受け取ったデータをIEEE1284.4を司るモジュールに渡す(ステップS205)。CPU1は、データを受け取ったIEEE1284.4を司るモジュールにおいてIEEE1284.4−2000で規定されている方法に従い、プリンタ200とネゴシエーションを行い、パケットサイズを取得し、そしてステップS205で受け取ったデータをパケットサイズに合わせてIEEE1284.4−2000で規定されている方法でパケット化する(ステップS206)。尚、この方法の詳細については、IEEEの規格書のIEEE1284.4−2000に記載されているが、本発明と直接には関係ないので、その説明は省略する。
【0046】
次いで、CPU1は、現在プリンタ200が受信可能なパケット数を取得し(ステップS207)、ステップS207の取得したパケット数に基づいてプリンタ200が受信可能なパケット数は1以上であるか否か判別する(ステップS208)。
【0047】
この判別の結果、プリンタ200が受信可能なパケット数が1以上である場合には、CPU1は、ステップS206でパケット化した1パケットをUSB1.1のプロトコルが規定する方法でプリンタ200に送信し(ステップS209)、そのパケットの送信が完了するのを待つ(ステップS210)。このパケット送信が完了したときに、ステップS207でプリンタ200が取得した受信可能なパケット数を1減らす(ステップS211)。
【0048】
そして、CPU1は、ステップS206で作成された全てのパケットがプリンタ200に送信されたか否かを判別し(ステップS212)、全てのパケットの送信が完了している場合には、ステップS202に戻り、全てのパケットの送信が完了していない場合には、次のパケット送信のためにステップS208に戻る。
【0049】
上記ステップS208の判別の結果、プリンタ200が受信可能なパケット数が0である場合には、CPU1は、プリンタの状態を確認するためにステップS207の処理を行う。
【0050】
次に、上記ステップS204の判別の結果、1284.4FLGがOFFである場合には、CPU1は、すぐ下位のプロトコルはUSBプリンタクラスであると判断し、アプリケーションから受け取ったデータをUSBプリンタクラスを司るモジュールに渡す(ステップS213)。CPU1はUSB2.0モジュールにおいてUSB2.0が規定する方法にのっとりPINGパケットをプリンタ200に送信する(ステップS214)。そして、プリンタ200からの応答を待つ。
【0051】
次いで、プリンタ200からの応答がACKであるか又はNAKであるか否かを判別する(ステップS215)。この判別の結果、プリンタ200からの応答がNAKである場合には、CPU1は、プリンタ200ではデータパケットの受信が不可能であると判断し、ステップS214に戻り、一定時間後再度ステップS215の判別を行う。これに対し、ステップS215の判別の結果、プリンタ200からの応答がACKである場合には、CPU1は、プリンタ200ではデータパケットの受信が可能であると判断し、CPU1はUSB2.0モジュールにおいてステップS213で受信し且つ未送出または送出が完了していないデータをUSB2.0で規定されたパケットサイズにパケット化し、プリンタ200に送出する(ステップS216)。そして、プリンタ200からの応答を待つ。
【0052】
プリンタ200からの応答がACK若しくはNYETであるか、又はNAKであるか否かを判別する(ステップS217)。この判別の結果、プリンタ200からの応答がACK又はNYETである場合には、データ送信は正常に終了したので、全てのパケットの送信が終了したか否かを判別し(ステップS221)、全てのパケットの送信が完了していればステップS202に戻る一方、全てのパケットの送信が完了していなければ、受信したプリンタ200からの応答がACKであるか又はNYETであるかを判別する(ステップS222)。プリンタ200からの応答がACKである場合には、プリンタ200では次のパケットの受信が可能なので、CPU1は上記ステップS216の処理を行う一方、プリンタ200からの応答がNYETである場合には、その時点ではプリンタ200は次のパケットを受信できないので、一定時間後ステップS214に戻り、プリンタ200が受信可能になったかどうかを確認するためにステップS215の判別を行う。
【0053】
ステップS217の判別の結果、プリンタ200からの応答がNAKである場合には、CPU1はUSB2.0モジュールにおいてU SB2.0が規定する方法にのっとりPINGパケットをプリンタ200に送信する(ステップS218)。そして、プリンタ200からの応答を待つ。
【0054】
次いで、プリンタ200からの応答がACKであるか又はNAKであるか否かを判別する(ステップS219)。この判別の結果、プリンタ200からの応答がACKである場合には、CPU1はステップS216の処理を行う一方、プリンタ200からの応答がNAKである場合には、パケット送信が異常終了したのでエラー処理を行う(ステップS220)。
【0055】
図10は、プリンタ200がホストコンピュータ100とUSB回線で接続されたときに、USBスタックより上層のプロトコルスタックを決定する工程を示すフローチャートである。
【0056】
プリンタ200のCPU11は、ホストコンピュータ100と接続されたか否かを判別する(ステップS301)。プリンタ200のCPU11はホストコンピュータ100と接続されたか否かを常に監視している。
【0057】
ステップS301の判別の結果、プリンタ200はホストコンピュータ100と接続された場合には、CPU11はUSBスタックとUSBコントローラを介してホストコンピュータ100とネゴシエーションを行い(ステップS302)、USB通信をUSB1.1で規定する方法で行うのか又はUSB2.0で規定する方法で行うのかを決定する(ステップS303)、即ち使用するプロトコルがUSB2.0か又はUSB1.1に決定される。
【0058】
次いで、CPU11は、ステップS303で決定したUSBプロトコルがUSB1.1であるか又はUSB2.0であるかを判別する(ステップS304)。
【0059】
ステップS304の判別の結果、ステップS303で決定したUSBプロトコルがUSB1.1の場合には、USB1.1にはフロー制御機能がないので、CPU11はUSB1.1モジュールのすぐ上位のプロトコルスタックとしてフロー制御機能を持つIEEE1284.4−2000を使用する(ステップS305)。尚、IEEE1284.4−2000については、IEEEの規格書に記載されているが、本発明と直接には関係ないので、その説明は省略する。
【0060】
次いで、CPU11はプリンタ200が予めサポートしているUSBプリンタクラスをIEEE1284.4モジュールのすぐ上位のプロトコルスタックとする(ステップS306)。そして、USBプリンタクラスを司るモジュール内の1284.4FLGをONにして、USBプリンタクラスの下位プロトコルがIEEE1284.4であることを示し(ステップS307)、本処理を終了する。
【0061】
上記ステップS304の判別の結果、ステップS303で決定したUSBプロトコルがUSB2.0の場合には、USB2.0にはフロー制御機能があり、上位にはフロー制御機能を持つプロトコルスタックは必要ないので、CPU11はプリンタ200が予めサポートしているUSBプリンタクラスをUSB2.0のすぐ上位のプロトコルとする(ステップS308)。そして、USBプリンタクラスを司るモジュール内の1284.4FLGをOFFにして、USBプリンタクラスの下位プロトコルがIEEE1284.4でないことを示し(ステップS309)、本処理を終了する。
【0062】
図11〜13は、プリンタ200がデータをホストコンピュータ100から受信する方法を示すフローチャートである。
【0063】
まず、プリンタ200において、ホストコンピュータ100からのデータ受信を要求する可能性のあるアプリケーションを起動する(ステップS401)。
【0064】
次いで、CPU11はそのアプリケーションでデータ受信要求が発生したか否かを判別する(ステップS402)。この判別の結果、アプリケーションでデータ受信要求が発生していない場合には、該判別を繰り返す一方、アプリケーションでデータ受信要求が発生した場合には、CPU11はアプリケーションが確保したデータ受信バッファをUSBプリンタクラスを司るモジュールに引き渡し(ステップS403)、USBプリンタクラスが保持している1284.4FLGの値がONであるか否かを判別する(ステップS404)。
【0065】
ステップS404の判別の結果、USBプリンタクラスが保持している1284.4FLGの値がONである場合には、CPU11はUSBプリンタクラスのすぐ下位のプロトコルがIEEE1284.4であると認識し、受信バッファをIEEE1284.4を司るモジュールに引き渡す(ステップS405)。そして、CPU11はUSB1.1モジュールスタックがホストコンピュータ100から何かデータを受信したか否かを判別する(ステップS406)。
【0066】
ステップS406の判別の結果、USB1.1を司るモジュールを介してホストコンピュータから何かデータを受信した場合には、受信したデータをIEEE1284.4を司るモジュールに引き渡す(ステップS407)。CPU11はIEEE1284.4を司るモジュールで受信したデータを解析し、その受信データがホストコンピュータ100から来た受信可能パケット数の報告要求であるか否かを判別する(ステップS408)。尚、この詳しい解析方法については、IEEEの規格書に記載されているが、本発明と直接には関係ないので、その説明は省略する。
【0067】
ステップS408の判別の結果、受信したデータが受信可能パケット数の報告要求である場合には、CPU11はIEEE1284.4を司るモジュール内のUSBプリンタクラスから引き渡された受信バッファの大きさと1284.4パケットの大きさから受信可能なパケット数を計算し(ステップS409)、その受信可能なパケット数をUSB1.1モジュールスタックを介してホストコンピュータ100に送出して(ステップS410)、ステップS406に戻る。
【0068】
ステップS408の判別の結果、ホストコンピュータ100から来た受信データが受信可能パケット数の報告要求でない場合には、CPU11は当該受信データがIEEE1284.4−2000で規定するデータパケットであるか否かを判別する(ステップS411)。この判別の結果、受信データがIEEE1284.4−2000で規定するデータパケットでない場合には、CPU11はそのデータの従った処理を実行する(ステップS412)一方、受信データがIEEE1284.4−2000で規定するデータパケットである場合には、CPU11は受信データをUSBプリンタクラスから渡されたバッファにコピーする(ステップS413)。
【0069】
次いで、CPU11はUSBプリンタクラスから渡されたバッファがフル状態であるか否かを判別する(ステップS414)。USBプリンタクラスから渡されたバッファがフル状態でない場合には、CPU11はステップS413の受信データにデータ送信完了報告があるか否かを判別する(ステップS415)。
【0070】
ステップS415の判別の結果、受信データにデータ送信完了報告がない場合には、継続してホストコンピュータ100からデータが送信されてくるものと判断され、ステップS406に戻る。一方、受信データにデータ送信完了報告がある場合には、CPU11はアプリケーションが確保した受信バッファに関し、バッファ受信完了報告を当該アプリケーションに報告する(ステップS416)。CPU11はそのアプリケーションにおいてその受信データの内容に即した処理を行う(ステップS417)。
【0071】
上記ステップS414の判別の結果、USBプリンタクラスから渡されたバッファがフル状態である場合には、これ以上の受信データを格納する格納領域がアプリケーションが確保したバッファにはないので、ステップS416に進む。
【0072】
ステップS404の判別の結果、USBプリンタクラスが保持している1284.4FLGの値がOFFである場合には、CPU11はUSBプリンタクラスのすぐ下位のプロトコルがUSB2.0であるので、アプリケーションが確保した受信バッファをUSB2.0を司るモジュールに引き渡す(ステップS418)。CPU11はUSB2.0スタックがホストコンピュータ100からPINGパケットを受信したか否かを判別する(ステップS419)。
【0073】
ステップS419の判別の結果、USB2.0スタックがホストコンピュータ100からPINGパケットを受信した場合には、CPU11はアプリケーションが確保した受信バッファの受信データ未格納領域の大きさがUSB2.0で規定するUSB2.0のパケットの大きさよりも大きいか否かを判別する(ステップS420)。
【0074】
ステップS420の判別の結果、アプリケーションが確保した受信バッファの受信データ未格納領域の大きさがUSB2.0で規定するUSB2.0のパケットの大きさよりも小さい場合には、データ受信が不可能と判断されるので、CPU11はUSB2.0を司るモジュールを介してからNAKを送出し(ステップS429)、後述するステップS428に進む。
【0075】
ステップS420の判別の結果、アプリケーションが確保した受信バッファの受信データ未格納領域の大きさがUSB2.0で規定するUSB2.0のパケットの大きさよりも大きい場合には、次のパケット受信が可能と判断され、CPU11はU SB2.0を司るモジュールを介してホストコンピュータ100に対してACKを送出する(ステップS421)。
【0076】
次いで、CPU11はUSB2.0を司るモジュールを介してホストコンピュータ100からデータを受信したか否かを判別する(ステップS422)。もし受信していなければ受信するまで待つ。
【0077】
そして、USB2.0を司るモジュールを介してホストコンピュータ100からデータを受信した場合には、CPU11は受信したデータをアプリケーションから渡された受信バッファにコピーする(ステップS423)。
【0078】
そして、CPU11は受信バッファの受信データ未格納領域の大きさが、USB2.0が規定するUSB2.0のパケットの大きさよりも大きいか否かを判別する(ステップS424)。受信バッファの受信データ未格納領域の大きさが、USB2.0が規定するUSB2.0のパケットの大きさよりも小さい場合には、このバッファではデータ受信が不可能と判断し、CPU11はUSB2.0を司るモジュールを介してからNYETを送出し(ステップS430)、後述するステップS428に進む。
【0079】
受信バッファの受信データ未格納領域の大きさが、USB2.0が規定するUS B2.0のパケットの大きさよりも大きい場合には、連続してパケット受信可能と判断し、CPU11はUSB2.0を司るモジュールを介してからホストコンピュータ100に対してACKを送出する(ステップS425)。
【0080】
次いで、CPU11は受信バッファがフル状態であるか否かを判別し(ステップS426)、受信バッファがフル状態である場合には、後述するステップS428に進む一方、受信バッファがフル状態でない場合には、CPU11はホストコンピュータ100からデータの送信完了報告を受信したか否かを判別する(ステップS427)。ホストコンピュータ100からデータの送信完了報告を受信した場合には、ホストコンピュータ100からのデータ受信が終了したと判断し、CPU11はアプリケーションに対して、バッファに関するデータ受信が完了したと報告し(ステップS428)、受信データを受け取ったアプリケーションにおいてデータの中身にあった処理を実行してステップS402に戻る。
【0081】
ステップS427の判別の結果、ホストコンピュータ100からデータの送信完了報告を受信していない場合には、次のデータ受信に備えて、ステップS422に戻る。
【0082】
上述したように、本実施の形態によれば、ある層のプロトコルとして2つ以上のプロトコルのうち1つが、そのプロトコルの上位層の意思にかかわらず、選択される可能性があるとき、その層のプロトコルとしてフロー制御機能がないプロトコルが選択された場合、その上位にはフロー制御機能を持つプロトコルを選択するようにし、またその層のプロトコルとしてフロー制御機能があるプロトコルが選択された場合、その上位層にフロー制御機能を持たないプロトコルを選択するようにすることができるため、フロー制御機能を通信スタック全体で1つにすることができ、フロー制御という必要な機能を確実に保持でき、しかもフロー制御の多重化による冗長性を防止することができる。特にある層のプロトコルとしてUSB1.1とUSB2.0のどちらかが、そのプロトコルの上位層の意思にかかわらず、選択される場合において、USB1.1が選択されたときには、その上位層にはフロー制御機能を持つプロトコル、例えば、IEEE1284.4−2000が選択され、USB2.0が選択されたときには、フロー制御機能を持たないプロトコルが選択されるので、フロー制御の多重化による冗長性を防止することができる。
【0083】
上記実施の形態では、ホストコンピュータ100はUSB1.1が選択されたか又はUSB2.0が選択されたかをホストコンピュータ100のUSBを司るモジュールからの報告により決定していたが、ホストコンピュータ100のインプリテーションによってはUSBスタック層がその差異を隠蔽するため、ホストコンピュータ100のUSBスタックが報告する方法がないケースもある。そこで、ホストコンピュータ100側は、データ送信を開始する直前又はホストコンピュータ100とターゲット(例えばプリンタ200)が回線で接続された直後に、USB 規格が定めるVENDORUNIQUEコマンドを利用し、ターゲットに選択されたプロトコルがUSB1.1であるか又はUSB2.0であるかを問い合わせる方法を採用してもよい。
【0084】
また、上記実施の形態では、ターゲットはUSB1.1が選択されたか又はUSB2.0が選択されたかをターゲットのUSBスタックからの報告により決定していたが、ターゲットのインプリテーションによってはUSBスタック層がその差異を隠蔽するため、ターゲットのUSBを司るモジュールが報告する方法がないケースもある。そこで、ホストコンピュータ100側は、USB1.1の選択又はUSB2.0の選択が決定した時点で、USB規格が定めるVENDORUNIQUEコマンドを利用し、ターゲットに選択されたプロトコルがUSB1.1であるか又はUSB2.0であるかをUSBプリンタクラスを司るモジュールに通知する方法を採用してもよい。
【0085】
本発明は、上述した実施の形態の機能を実現するソフトウェアのプログラムをコンピュータ又はCPUに供給し、そのコンピュータ又はCPUが該供給されたプログラムを読出して実行することによっても本発明の目的が達成されることは云うまでもない。
【0086】
この場合、上記プログラムは、不図示の該プログラムを記録した記録媒体から直接、又はインターネット、商用ネットワーク、若しくはローカルエリアネットワーク等に接続される不図示の他のコンピュータやデータベース等からダウンロードすることにより供給される。
【0087】
また、上記プログラムは、上述した実施の形態の機能をコンピュータで実現することができればよく、その形態は、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給されるスクリプトデータ等の形態を有するものでもよい。
【0088】
更にまた、上述した実施の形態の機能を実現するソフトウェアのプログラムを記録した記録媒体をコンピュータに供給し、そのコンピュータが記録媒体に格納されたプログラムを読出し実行することによっても、本発明の目的が達成されることは云うまでもない。
【0089】
プログラムを供給する記録媒体としては、例えば、RAM、NV−RAM、フロッピー(登録商標)ディスク、光ディスク、光磁気ディスク、CD−ROM、MO、CD−ROM、CD−RW、DVD(DVD−ROM、DVD−RAM、DVD−RW、DVD+RW)、磁気テープ、不揮発性のメモリカード、他のROM等の上記プログラムを記憶できるものであればよい。
【0090】
【発明の効果】
以上詳細に説明したように、本発明によれば、ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、該ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルが選択され、該ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、該ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルが選択されるように構成されているので、フロー制御機能を通信スタック全体で1つにすることができ、フロー制御という必要な機能を確実に保持でき、しかもフロー制御の多重化による冗長性を防止することができる。
【0091】
特に、ネゴシエーションによって決定された通信プロトコルとしてUSB1.1とUSB2.0のどちらかが、そのプロトコルの上位層の意思にかかわらず、選択される場合に、USB1.1が選択されたときは、その上位層にフロー制御機能を持つプロトコル、例えばIEEE1284.4−2000が選択されるのに対し、USB2.0が選択されたときは、フロー制御機能を持たないプロトコルが選択されるので、フロー制御の多重化による冗長性を防止することができる。
【図面の簡単な説明】
【図1】USB1.1とUSB2.0とのプロトコル構成における差異を示す図であり、特にUSB2.0が選択されたときにフロー制御機能が通信スタック全体で2つになることを模式的に示す図である。
【図2】USB1.1とUSB2.0とのプロトコル構成における差異を示す図である。
【図3】本実施の形態に係る通信制御システムをホストコンピュータ100及びプリンタ200に適用した模式図を示す。
【図4】図3におけるホストコンピュータ100の内部構成を示すブロック図である。
【図5】図3におけるプリンタ200の内部構成を示すブロック図である。
【図6】ホストコンピュータ100がプリンタ200とUSB回線で接続されたときに、USBスタックより上層のプロトコルススタックを構築する工程を示すフローチャートである。
【図7】ホストコンピュータ100がプリンタ200にデータを送信する方法を示すフローチャートである。
【図8】ホストコンピュータ100がプリンタ200にデータを送信する方法を示すフローチャートである。
【図9】ホストコンピュータ100がプリンタ200にデータを送信する方法を示すフローチャートである。
【図10】プリンタ200がホストコンピュータ100とUSB回線で接続されたときに、USBスタックより上層のプロトコルスタックを決定する工程を示すフローチャートである。
【図11】プリンタ200がデータをホストコンピュータ100から受信する方法を示すフローチャートである。
【図12】プリンタ200がデータをホストコンピュータ100から受信する方法を示すフローチャートである。
【図13】プリンタ200がデータをホストコンピュータ100から受信する方法を示すフローチャートである。
【符号の説明】
1,11 CPU
2,12 RAM
3,13 ハードディスク
4 ユーザーコマンド入力装置
5,15 USBポート
8,18 メインバス
14 印字装置
100 ホストコンピュータ
200 プリンタ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a communication control system, a communication control method, a communication control program, and a storage medium for controlling selection of a protocol used for data exchange between two or more electronic devices.
[0002]
[Prior art]
Conventionally, when two electronic devices exchange data with a USB (Universal Serial Bus) version 1.0 (or version 1.1) or a USB version 2.0, the upper layer of the USB protocol does not recognize the USB version. The upper protocol stack was fixedly determined.
[0003]
For example, when a communication protocol stack is constructed by assuming that USB version 1.0 (hereinafter, “version” is omitted) is used for a lower layer, the USB 1.0 is used to improve the use efficiency of the bus. In some cases, a protocol having a data flow control function such as IEEE1284.4 is selected as a communication upper layer (for example, see Patent Document 1).
[0004]
[Patent Document 1]
JP 2000-215144 A
[0005]
[Problems to be solved by the invention]
However, USB 2.0, which has upward compatibility with USB 1.0, has a data flow control function (PING, NAK, NYET) that is not specified in USB 1.0. In USB 2.0, since USB 2.0 itself has a flow control function, if a protocol having a data flow control function is selected as an upper protocol of USB 2.0, the flow control function is duplicated and redundant. And the communication efficiency is reduced.
[0006]
The present invention has been made in view of the above points, and has as its object to provide a communication control system, a communication control method, a communication control program, and a storage medium that can prevent redundancy due to multiplexing of flow control. And
[0007]
[Means for Solving the Problems]
In order to achieve the above object, the communication control system according to claim 1, when a physical channel or a logical channel for performing communication between two devices is constructed, a communication protocol for constructing the physical channel or the logical channel. Determining by a negotiation between two devices, determining means for determining whether a communication protocol determined by the negotiation includes a flow control function of communication data, and a communication protocol determined by the negotiation In a communication control system comprising: a selection unit that selects a protocol set in an upper layer of the communication control unit; and a communication unit that performs communication using the protocol selected by the selection unit, a communication protocol determined by the negotiation by the determination unit. Provides communication data flow control function When it is determined that the communication protocol determined by the negotiation is not included in the upper layer of the communication protocol determined by the negotiation, the communication protocol determined by the determination by the negotiation is determined by the communication data. If it is determined that it does not include the flow control function, the selecting means is configured to select a protocol including a flow control function in an upper layer of the communication protocol determined by the negotiation. I do.
[0008]
The communication control system according to claim 2 is the communication control system according to claim 1, wherein the communication protocol is determined when the communication protocol determined by the negotiation is USB1.0 or USB1.1 or is USB2.0. Notifying means for notifying the selecting means of which of these communication protocols the communication means is, and the selecting means determines whether or not the notification by the notifying means is USB1.0 or USB1.1. A protocol different from that at a certain time is selected as a protocol to be set in an upper layer of the communication protocol determined by the negotiation.
[0009]
The communication control system according to claim 3 is the communication control system according to claim 1 or 2, wherein the selecting unit has a protocol having a flow control function when the notification by the notifying unit is USB1.0 or USB1.1. Is selected as a protocol set in an upper layer of the communication protocol determined by the negotiation.
[0010]
A communication control system according to a fourth aspect is the communication control system according to the third aspect, wherein the protocol having the flow control function is IEEE1284.4.
[0011]
The communication control system according to claim 5 is the communication control system according to claim 3, wherein when the communication protocol determined by the negotiation is USB 1.0 or USB 1.1 or USB 2.0, the negotiation is performed. The upper layer of the determined communication protocol is determined by the communication protocol determined by the negotiation.
[0012]
7. The communication control system according to claim 3, wherein the communication protocol determined by the negotiation is USB1.0 or USB1.1 or the communication protocol determined by USB2.0. When the upper layer of the two devices determines by the communication protocol determined by the negotiation, one of the two devices determines the determined upper layer communication protocol by using a vendorunique command defined by USB 2.0. The other device is notified.
[0013]
The communication control system according to claim 7 is the communication control system according to claim 6, wherein when one of the two devices selects a protocol having a flow control function as a communication protocol of an upper layer, the selection is made by a vendorunique command. Is used to notify the other of the two devices.
[0014]
The communication control system according to claim 8, wherein in the communication control system according to claim 3, when one of the two devices selects a predetermined protocol having a flow control function as one of the higher-level protocols, The other of the two devices detects that one of the two devices has selected the protocol by detecting that the communication protocol determined by the negotiation is USB 2.0.
[0015]
The communication control system according to claim 9, wherein when a physical channel or a logical channel for performing communication between the two devices is constructed, a communication protocol for constructing the physical channel or the logical channel is negotiated between the two devices. If the communication protocol determined by the negotiation includes a communication data flow control function in the communication control system determined by the negotiation, each of the two devices performs flow control on the upper layer of the communication protocol determined by the negotiation. If a protocol that does not include a function is selected, and the communication protocol determined by the negotiation does not include a communication data flow control function, each of the two devices is placed in a higher layer of the communication protocol determined by the negotiation. Flow control function Select A protocol, characterized in that each of said two devices are configured to communicate with one another.
[0016]
A communication control method according to claim 10, wherein when a physical channel or a logical channel for performing communication between two devices is constructed, a communication protocol for constructing the physical channel or the logical channel is negotiated between the two devices. A determining step to determine whether the communication protocol determined by the negotiation includes a flow control function of communication data, and a protocol to be set in an upper layer of the communication protocol determined by the negotiation. In a communication control method including a selection step of selecting and a communication step of performing communication using the protocol selected in the selection step, the communication protocol determined by the negotiation in the determination step includes a flow control function of communication data. Including If the communication protocol determined by the negotiation is not included in the upper layer of the communication protocol determined by the negotiation, and the communication protocol determined by the negotiation by the determination step is a communication data flow. When it is determined that the communication function does not include the control function, the selecting step selects a protocol including a flow control function in an upper layer of the communication protocol determined by the negotiation.
[0017]
A communication control program according to claim 11, wherein in the communication control program executed by a computer, when a physical channel or a logical channel for performing communication between two devices is constructed, the physical channel or the logical channel is constructed. A communication protocol to be determined by negotiation between two devices; a determination step of determining whether the communication protocol determined by the negotiation includes a flow control function of communication data; and a determination step of determining by the negotiation. A selection step of selecting a protocol to be set in an upper layer of the communication protocol, and a communication step of performing communication using the protocol selected in the selection step, causing the computer to execute, further, the negotiation by the determination step If the determined communication protocol includes the communication data flow control function, the selecting step selects a protocol that does not include a flow control function in an upper layer of the communication protocol determined by the negotiation. If the determining step determines that the communication protocol determined by the negotiation does not include the flow control function of communication data, the selecting step includes a flow control function in an upper layer of the communication protocol determined by the negotiation. And causing the computer to select a protocol including
[0018]
The storage medium according to claim 12, wherein a computer-readable storage medium stores a communication control program to be executed by a computer. A determination step of determining a communication protocol for building the physical channel or the logical channel by negotiation between the two devices, and determining whether the communication protocol determined by the negotiation includes a communication data flow control function. A determining step of determining whether the communication protocol is higher than a communication protocol determined by the negotiation, and a communication step of performing communication using the protocol selected in the selecting step. Let it run If it is determined in the determining step that the communication protocol determined by the negotiation includes a flow control function of communication data, the selecting step includes a flow control function in an upper layer of the communication protocol determined by the negotiation. If the communication protocol determined by the negotiation is determined not to include the communication data flow control function by the determination step, the selection step includes the communication protocol determined by the negotiation. A communication control program for causing the computer to select a protocol including a flow control function in an upper layer of the communication control program is stored.
[0019]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0020]
FIG. 1 is a diagram showing a difference in a protocol configuration between USB 1.1 and USB 2.0.
[0021]
One of the major differences between USB 1.1 and USB 2.0 is the presence or absence of a flow control function. USB1. In N, the NAK response in Out transaction can be issued only after the transfer of TOKEN and DATA packet is completed. For this reason, when a device (for example, a printer with a large number of NAK responses due to factors such as paper empty or paper jam) is connected to which a large number of NAK responses are not necessarily hardware or control abnormalities, a USB bus is connected. OUT → DATA → NAK are repeatedly issued many times. Since OUT → DATA → NAK has a long period of actually occupying the USB Bus and is ineffective for data transfer, the actual transfer rate on the USB Bus is reduced, and other devices are connected to the USB bus. When the device is connected, the communication speed between the device and the host is insignificantly reduced.
[0022]
However, in USB 2.0, new packets called PING and NYET, which did not exist in USB 1.1, are added as specifications, and negotiation with these packets enables flow control at the USB protocol level.
[0023]
First, the host inquires of the Bulk OUT device whether or not there is a free Buffer in the Bulk OUT device for receiving one packet of data by a PING packet. The Bulk OUT device responds with ACK when data can be received, and responds with NAC when data cannot be received. As long as the host receives the NAK response to the PING packet, the host determines that there is no vacancy in the reception buffer of the Bulk OUT device, repeatedly sends the PING, and continuously checks the vacancy status of the reception buffer of the Bulk OUT device.
[0024]
When the host receives the ACK response of the Bulk OUT device for the PING packet, the host performs Bulk-out transfer of a packet including data to be actually transmitted. The Bulk OUT device responds to the Bulk-out transfer with an ACK, NYET, or NAK response.
[0025]
The ACK response to the bulk-out transfer of the bulk-out device indicates that data can be received by the next bulk-out transfer because there is a buffer available to receive the next bulk-out transfer. For this reason, the host can continuously perform bulk-out transfer. The NYET response indicates that the next Bulk-out transfer cannot be received at that time because there is no buffer available to receive the next Bulk-out transfer. For this reason, the host sends a PING packet instead of performing the next bulk-out transfer, and waits until the reception buffer of the bulk-out device has enough space to receive the bulk-out transfer.
[0026]
The PING and NYET prevent the occurrence of a sequence of OUT → DATA → NAK, which unnecessarily consumes the bandwidth of the USB Bus, thereby enabling efficient use of the USB Bus.
[0027]
However, in order to cover the above-mentioned drawbacks of USB 1.1, existing USB devices include a protocol having a flow control function, for example, IEEE1284.4-2000 defined by IEEE and a higher-level protocol. Many (see stack on left side of FIG. 1). In this case, only IEEE1284.4-2000 is responsible for the flow control function. However, when the USB 1.1 stack portion of this stack configuration is replaced with USB 2.0 (see the stack on the right side of FIG. 1), both IEEE 1284.4-2000 and USB 2.0 have a flow control function. Redundancy occurs. Therefore, in the present embodiment, a method of determining whether the USB stack uses a protocol having a flow control function at an upper level in USB 1.1 and USB 2.0 (see the stack in FIG. 2).
[0028]
Specifically, if the result of USB negotiation is USB 1.1, a protocol having a flow control function (for example, IEEE1284.4-2000 or the like) is always adopted as a higher-order protocol, and if the result of USB negotiation is USB 2.0. For example, a protocol having no flow control function is adopted as the upper protocol, or nothing is adopted as the upper protocol.
[0029]
FIG. 3 is a schematic diagram in which the communication control system according to the present embodiment is applied to a host computer 100 and a printer 200.
[0030]
FIG. 4 is a block diagram showing the internal configuration of the host computer 100 in FIG.
[0031]
The host computer 100 includes a CPU 1 for controlling each component, a RAM 2 for providing a work area for the CPU 1, a hard disk 3 for storing various programs, and a user command input device 4 such as a mouse or a keyboard for inputting user commands. And a main bus 8 for connecting the CPU 1, the RAM 2, the hard disk 3, the user command input device 4, and the USB port 5, respectively. The hard disk 3 may be any storage medium that can store a program, such as a floppy (registered trademark) disk, a CD-ROM, a DVD, and a flash ram.
[0032]
FIG. 5 is a block diagram showing the internal configuration of the printer 200 in FIG.
[0033]
The printer 200 includes a CPU 11 that controls each component, a RAM 12 that provides a work area for the CPU 11, a hard disk 13 that stores various programs, a printing device 14 that prints on printing paper, a USB port 15, It has a CPU 11, a RAM 12, a hard disk 13, a printer 14, and a main bus 18 for connecting the USB port 15, respectively. The hard disk 13 may be any storage medium that can store programs, and may be, for example, a floppy (registered trademark) disk, a CD-ROM, a DVD, a flash ram, or the like.
[0034]
In the host computer 100, the CPU 1 controls the RAM 2, the hard disk 3, the user command input device 4, and the USB port 5 via the main bus 8 to implement the present invention, unless otherwise specified. In the printer 200, the CPU 11 controls the RAM 12, the ROM 13, the printing device 14, and the USB port 15 via the main bus 18 to implement the present invention.
[0035]
FIG. 6 is a flowchart showing a process of constructing a protocol stack above the USB stack when the host computer 100 is connected to the printer 200 via a USB line.
[0036]
The host computer 100 always monitors whether a new device, that is, the printer 200 is connected to the USB port 5 (step S101). When the printer 200 is connected, negotiation with the printer 200 is performed via the USB stack and the USB controller (step S102), and the USB communication is performed by the method specified in USB1.1 or specified in USB2.0. It is determined whether or not to perform the method (step S103), that is, the protocol to be used is determined to be USB 2.0 or USB 1.1. This negotiation method is described in Universal Serial Bus Specification Revision 2.0, but is not directly related to the present invention, and thus the detailed description is omitted.
[0037]
Then, the host computer 100 reads the description (description) of the printer ID (step S104) by reading the description (description) defined by the Universal Serial Bus Specification Revision 2.0 or Universal Serial Bus Specification Revision 1.1 of the printer 200 and the printer ID (step S104). If it is determined that the USB printer class supports the USB printer class, the CPU 1 determines that the USB printer class module is one of the upper module stacks (step S105).
[0038]
Next, the CPU 1 determines whether the USB protocol determined in step S103 is USB 1.1 or USB 2.0 (step S106).
[0039]
If the USB protocol determined in step S103 is USB1.1 as a result of the determination in step S106, the CPU1 does not have a flow control function in USB1.1, and thus the CPU 1 determines the flow control function as a protocol immediately above the USB1.1 module. An IEEE 1284.4-2000 having a function is used (step S107). Although IEEE1284.4-2000 is described in the IEEE standard, it is not directly related to the present invention, and therefore, the description thereof is omitted.
[0040]
Next, the CPU 1 uses the USB printer class determined in step S105 as a protocol of a protocol stack immediately above the IEEE1284.4 protocol (step S108). Then, the CPU turns on 1284.4 FLG in the module that controls the USB printer class, indicates that the lower protocol of the USB printer class is IEEE1284.4 (step S109), and ends this processing.
[0041]
If the result of determination in step S106 is that the USB protocol determined in step S103 is USB 2.0, the USB 2.0 has a flow control function and no higher-order protocol having a flow control function is required. Uses the USB printer class protocol determined in step S105 as a protocol immediately above the USB 2.0 protocol (step S110). Then, the 1284.4 FLG in the stack that controls the USB printer class is turned off to indicate that the lower protocol of the USB printer class is not the IEEE 1284.4 protocol (step S111), and the process ends.
[0042]
7 to 9 are flowcharts illustrating a method for transmitting data to the printer 200 by the host computer 100.
[0043]
First, in the host computer 100, an application that may transmit data to the printer 200 starts (step S201).
[0044]
Next, the CPU 1 determines whether or not a data transmission request has been issued to the printer 200 in the application (step S202). To the module that controls the USB printer class (step S203).
[0045]
Next, the CPU 1 determines whether or not 1284.4FLG in the module that manages the USB printer class that has received the data is ON (step S204). When the 1284.4FLG is ON, the CPU 1 recognizes that the immediately lower protocol is the IEEE1284.4 protocol, and passes the data received from the application to the module that manages the IEEE1284.4 (step S205). The CPU 1 negotiates with the printer 200 in a module governing IEEE1284.4 in accordance with the method defined in IEEE1284.4-2000, obtains a packet size, and converts the data received in step S205 into a packet size. In accordance with IEEE1284.4-2000 (step S206). Although the details of this method are described in IEEE1284.4-2000 of the IEEE standard, it is not directly related to the present invention, and therefore, the description thereof is omitted.
[0046]
Next, the CPU 1 obtains the number of packets that the printer 200 can currently receive (step S207), and determines whether the number of packets that the printer 200 can receive is one or more based on the number of packets obtained in step S207. (Step S208).
[0047]
If the result of this determination is that the number of packets that can be received by the printer 200 is one or more, the CPU 1 transmits one packet that has been packetized in step S206 to the printer 200 by a method defined by the USB 1.1 protocol ( In step S209, the process waits until the transmission of the packet is completed (step S210). When the packet transmission is completed, the number of receivable packets acquired by the printer 200 in step S207 is reduced by 1 (step S211).
[0048]
Then, the CPU 1 determines whether or not all the packets created in step S206 have been transmitted to the printer 200 (step S212). If all the packets have been transmitted, the process returns to step S202. If transmission of all packets has not been completed, the process returns to step S208 for transmission of the next packet.
[0049]
If the result of the determination in step S208 is that the number of packets that can be received by the printer 200 is 0, the CPU 1 performs the process of step S207 to check the status of the printer.
[0050]
Next, if the result of the determination in step S204 is that 1284.4FLG is OFF, the CPU 1 determines that the immediately lower protocol is the USB printer class, and manages the data received from the application in the USB printer class. It is passed to the module (step S213). The CPU 1 transmits a PING packet to the printer 200 in the USB 2.0 module according to the method defined by USB 2.0 (step S214). Then, it waits for a response from the printer 200.
[0051]
Next, it is determined whether the response from the printer 200 is ACK or NAK (step S215). As a result of this determination, if the response from the printer 200 is NAK, the CPU 1 determines that the printer 200 cannot receive the data packet, returns to step S214, and after a predetermined time, determines again in step S215. I do. On the other hand, if the result of the determination in step S215 is that the response from the printer 200 is ACK, the CPU 1 determines that the printer 200 can receive the data packet, and the CPU 1 The data received in S213 and not transmitted or not transmitted is packetized into a packet size specified by USB 2.0 and transmitted to the printer 200 (Step S216). Then, it waits for a response from the printer 200.
[0052]
It is determined whether the response from the printer 200 is ACK or NYET or NAK (step S217). If the result of this determination is that the response from the printer 200 is ACK or NYET, data transmission has ended normally, so it is determined whether or not transmission of all packets has ended (step S221). If the transmission of the packet has been completed, the process returns to step S202. If the transmission of all the packets has not been completed, it is determined whether the received response from the printer 200 is ACK or NYET (step S222). ). If the response from the printer 200 is ACK, the printer 200 can receive the next packet. Therefore, the CPU 1 performs the process of step S216. If the response from the printer 200 is NYET, At this point, the printer 200 cannot receive the next packet, so the process returns to step S214 after a predetermined time, and determines in step S215 to confirm whether the printer 200 is ready to receive.
[0053]
If the result of the determination in step S217 is that the response from the printer 200 is NAK, the CPU 1 transmits a PING packet to the printer 200 in the USB 2.0 module according to the method defined by USB 2.0 (step S218). Then, it waits for a response from the printer 200.
[0054]
Next, it is determined whether the response from the printer 200 is ACK or NAK (step S219). As a result of this determination, if the response from the printer 200 is ACK, the CPU 1 performs the process of step S216. If the response from the printer 200 is NAK, the packet transmission has been abnormally terminated. Is performed (step S220).
[0055]
FIG. 10 is a flowchart illustrating a process of determining a protocol stack higher than the USB stack when the printer 200 is connected to the host computer 100 via a USB line.
[0056]
The CPU 11 of the printer 200 determines whether or not the printer 200 is connected to the host computer 100 (step S301). The CPU 11 of the printer 200 constantly monitors whether or not the printer 200 is connected to the host computer 100.
[0057]
As a result of the determination in step S301, when the printer 200 is connected to the host computer 100, the CPU 11 negotiates with the host computer 100 via the USB stack and the USB controller (step S302), and performs the USB communication with the USB 1.1. It is determined whether to perform the method in accordance with the prescribed method or the method prescribed in USB 2.0 (step S303), that is, the protocol to be used is determined to be USB 2.0 or USB 1.1.
[0058]
Next, the CPU 11 determines whether the USB protocol determined in step S303 is USB 1.1 or USB 2.0 (step S304).
[0059]
As a result of the determination in step S304, if the USB protocol determined in step S303 is USB1.1, since the USB1.1 does not have a flow control function, the CPU 11 sets the flow control as a protocol stack immediately above the USB1.1 module. The IEEE 1284.4-2000 having the function is used (step S305). Although IEEE1284.4-2000 is described in the IEEE standard, it is not directly related to the present invention, and therefore, the description thereof is omitted.
[0060]
Next, the CPU 11 sets the USB printer class supported by the printer 200 in advance as a protocol stack immediately above the IEEE1284.4 module (step S306). Then, the CPU turns on 1284.4FLG in the module that manages the USB printer class to indicate that the lower protocol of the USB printer class is IEEE1284.4 (step S307), and terminates the processing.
[0061]
As a result of the determination in step S304, when the USB protocol determined in step S303 is USB 2.0, the USB 2.0 has a flow control function, and a protocol stack having a flow control function is not necessary at an upper level. The CPU 11 sets the USB printer class previously supported by the printer 200 as a protocol immediately above USB 2.0 (step S308). Then, the 1284.4FLG in the module that controls the USB printer class is turned off to indicate that the lower protocol of the USB printer class is not IEEE1284.4 (step S309), and this processing ends.
[0062]
11 to 13 are flowcharts illustrating a method for the printer 200 to receive data from the host computer 100.
[0063]
First, in the printer 200, an application that may request data reception from the host computer 100 is activated (step S401).
[0064]
Next, the CPU 11 determines whether a data reception request has occurred in the application (step S402). As a result of this determination, when the data reception request has not been generated by the application, the determination is repeated. On the other hand, when the data reception request has been generated by the application, the CPU 11 stores the data reception buffer secured by the application in the USB printer class. (Step S403), and determines whether the value of 1284.4 FLG held by the USB printer class is ON (step S404).
[0065]
If the result of the determination in step S404 is that the value of 1284.4FLG held by the USB printer class is ON, the CPU 11 recognizes that the immediately lower protocol of the USB printer class is IEEE1284.4 and sets the reception buffer. Is transferred to the module that manages IEEE1284.4 (step S405). Then, the CPU 11 determines whether or not the USB 1.1 module stack has received any data from the host computer 100 (step S406).
[0066]
As a result of the determination in step S406, if any data is received from the host computer via the module that manages USB 1.1, the received data is transferred to the module that manages IEEE1284.4 (step S407). The CPU 11 analyzes the data received by the module governing IEEE1284.4 and determines whether the received data is a report request for the number of receivable packets coming from the host computer 100 (step S408). Although the detailed analysis method is described in the IEEE standard, it is not directly related to the present invention, and therefore, the description thereof is omitted.
[0067]
If the result of determination in step S408 is that the received data is a report request for the number of receivable packets, the CPU 11 determines the size of the receive buffer passed from the USB printer class in the The number of receivable packets is calculated from the size of the packet (step S409), and the number of receivable packets is sent to the host computer 100 via the USB 1.1 module stack (step S410), and the process returns to step S406.
[0068]
If the result of determination in step S408 is that the received data from the host computer 100 is not a report request for the number of receivable packets, the CPU 11 determines whether the received data is a data packet specified by IEEE1284.4-2000. It is determined (step S411). If the result of this determination is that the received data is not a data packet specified by IEEE1284.4-2000, the CPU 11 executes processing in accordance with the data (step S412), while the received data is not specified by IEEE1284.4-2000. If the data packet is a data packet to be received, the CPU 11 copies the received data to the buffer passed from the USB printer class (step S413).
[0069]
Next, the CPU 11 determines whether or not the buffer passed from the USB printer class is full (step S414). If the buffer passed from the USB printer class is not full, the CPU 11 determines whether or not the received data in step S413 includes a data transmission completion report (step S415).
[0070]
If the result of determination in step S415 is that there is no data transmission completion report in the received data, it is determined that data will be continuously transmitted from the host computer 100, and the process returns to step S406. On the other hand, if there is a data transmission completion report in the received data, the CPU 11 reports a buffer reception completion report to the application for the reception buffer secured by the application (step S416). The CPU 11 performs a process according to the content of the received data in the application (step S417).
[0071]
If the result of the determination in step S414 is that the buffer passed from the USB printer class is in a full state, there is no storage area for storing more received data in the buffer secured by the application, and the process advances to step S416. .
[0072]
If the result of the determination in step S404 is that the value of 1284.4 FLG held by the USB printer class is OFF, the CPU 11 secures the application because the protocol immediately below the USB printer class is USB 2.0. The receiving buffer is transferred to the module that manages USB 2.0 (step S418). The CPU 11 determines whether the USB 2.0 stack has received a PING packet from the host computer 100 (Step S419).
[0073]
If the USB 2.0 stack receives the PING packet from the host computer 100 as a result of the determination in step S419, the CPU 11 determines that the size of the reception data non-storage area of the reception buffer secured by the application is the USB2 defined by USB 2.0. It is determined whether or not the size of the packet is larger than the size of the packet of.
[0074]
As a result of the determination in step S420, if the size of the reception data non-storage area of the reception buffer secured by the application is smaller than the size of the USB 2.0 packet specified by USB 2.0, it is determined that data cannot be received. Therefore, the CPU 11 sends out a NAK via the module that manages USB 2.0 (step S429), and proceeds to step S428 described below.
[0075]
As a result of the determination in step S420, if the size of the reception data non-storage area of the reception buffer secured by the application is larger than the size of the USB 2.0 packet specified by USB 2.0, the next packet can be received. The CPU 11 sends an ACK to the host computer 100 via the module that controls USB 2.0 (step S421).
[0076]
Next, the CPU 11 determines whether or not data has been received from the host computer 100 via the module governing USB 2.0 (step S422). If not, wait until it is received.
[0077]
Then, when data is received from the host computer 100 via the module that manages USB 2.0, the CPU 11 copies the received data to the reception buffer passed from the application (step S423).
[0078]
Then, the CPU 11 determines whether the size of the reception data non-storage area of the reception buffer is larger than the size of the USB 2.0 packet specified by USB 2.0 (step S424). If the size of the reception data non-storage area of the reception buffer is smaller than the size of the USB 2.0 packet specified by USB 2.0, it is determined that data cannot be received by this buffer, and the CPU 11 NYET is sent out via the module that manages (step S430), and the process proceeds to step S428 described later.
[0079]
When the size of the reception data non-storage area of the reception buffer is larger than the size of the USB 2.0 packet specified by USB 2.0, it is determined that the packet can be continuously received, and the CPU 11 changes the USB 2.0 to the USB 2.0. An ACK is sent to the host computer 100 via the controlling module (step S425).
[0080]
Next, the CPU 11 determines whether or not the reception buffer is full (step S426). If the reception buffer is full, the process proceeds to step S428 described below. The CPU 11 determines whether a data transmission completion report has been received from the host computer 100 (step S427). If the data transmission completion report is received from the host computer 100, it is determined that the data reception from the host computer 100 has been completed, and the CPU 11 reports to the application that the data reception regarding the buffer has been completed (step S428). ), The application that has received the received data executes a process corresponding to the content of the data, and returns to step S402.
[0081]
If it is determined in step S427 that the data transmission completion report has not been received from the host computer 100, the process returns to step S422 in preparation for receiving the next data.
[0082]
As described above, according to the present embodiment, when one of two or more protocols is likely to be selected as a protocol of a certain layer regardless of the intention of a higher layer of the protocol, the protocol of that layer is selected. If a protocol without a flow control function is selected as a protocol of a layer, a protocol with a flow control function is selected above it, and if a protocol with a flow control function is selected as a protocol of that layer, the Since it is possible to select a protocol that does not have a flow control function in the upper layer, the flow control function can be integrated into one in the entire communication stack, and the necessary function of flow control can be reliably held. Redundancy due to multiplexing of flow control can be prevented. In particular, when either USB 1.1 or USB 2.0 is selected as a protocol of a certain layer regardless of the intention of the upper layer of the protocol, when USB 1.1 is selected, the flow is sent to the upper layer. When a protocol having a control function, for example, IEEE1284.4-2000 is selected and USB 2.0 is selected, a protocol without a flow control function is selected, thereby preventing redundancy due to multiplexing of flow control. be able to.
[0083]
In the above embodiment, the host computer 100 determines whether USB 1.1 or USB 2.0 has been selected based on a report from the module that controls the USB of the host computer 100. In some cases, the USB stack layer hides the difference, so that there is no way for the USB stack of the host computer 100 to report. Therefore, immediately before starting the data transmission or immediately after the host computer 100 and the target (for example, the printer 200) are connected by a line, the host computer 100 uses the VENDOR UNIQUE command defined by the USB standard to select the protocol selected as the target. A method of inquiring whether is USB1.1 or USB2.0 may be adopted.
[0084]
In the above embodiment, the target determines whether USB 1.1 or USB 2.0 has been selected based on the report from the USB stack of the target. However, depending on the implementation of the target, the USB stack layer In some cases, there is no way for the module that controls the target USB to report the difference. Therefore, when the selection of USB1.1 or the selection of USB2.0 is determined, the host computer 100 uses the VENDORUNIQUE command defined by the USB standard to determine whether the protocol selected as the target is USB1.1 or USB2. 2.0 may be notified to the module that manages the USB printer class.
[0085]
The present invention achieves the object of the present invention also by supplying a computer or CPU with a software program that realizes the functions of the above-described embodiments, and reading and executing the supplied program. Needless to say.
[0086]
In this case, the program is supplied by being downloaded directly from a recording medium storing the program (not shown) or from another computer or database (not shown) connected to the Internet, a commercial network, a local area network, or the like. Is done.
[0087]
Further, the program only needs to be able to realize the functions of the above-described embodiments by a computer, and the form includes object code, a program executed by an interpreter, script data supplied to an OS, and the like. May be.
[0088]
Still further, the object of the present invention is also achieved by supplying a computer with a recording medium storing a software program for realizing the functions of the above-described embodiments, and reading and executing the program stored in the recording medium. It goes without saying that this is achieved.
[0089]
As a recording medium for supplying the program, for example, RAM, NV-RAM, floppy (registered trademark) disk, optical disk, magneto-optical disk, CD-ROM, MO, CD-ROM, CD-RW, DVD (DVD-ROM, DVD-RAM, DVD-RW, DVD + RW), magnetic tape, non-volatile memory card, and other ROMs can be used as long as they can store the program.
[0090]
【The invention's effect】
As described in detail above, according to the present invention, when it is determined that the communication protocol determined by the negotiation includes the flow control function of the communication data, the upper layer of the communication protocol determined by the negotiation If a protocol that does not include the flow control function is selected, and it is determined that the communication protocol determined by the negotiation does not include the flow control function of the communication data, the flow is transferred to an upper layer of the communication protocol determined by the negotiation. Since the protocol including the control function is configured to be selected, the flow control function can be integrated into one in the entire communication stack, the necessary function of flow control can be reliably held, and the flow control can be multiplexed. Redundancy can be prevented.
[0091]
In particular, when either USB 1.1 or USB 2.0 is selected as the communication protocol determined by the negotiation regardless of the intention of the upper layer of the protocol, when USB 1.1 is selected, When a protocol having a flow control function in the upper layer, for example, IEEE1284.4-2000 is selected, when USB 2.0 is selected, a protocol without a flow control function is selected. Redundancy due to multiplexing can be prevented.
[Brief description of the drawings]
FIG. 1 is a diagram showing a difference in a protocol configuration between USB 1.1 and USB 2.0, and particularly schematically shows that when USB 2.0 is selected, two flow control functions are provided in the entire communication stack. FIG.
FIG. 2 is a diagram illustrating a difference in a protocol configuration between USB 1.1 and USB 2.0.
FIG. 3 is a schematic diagram in which the communication control system according to the present embodiment is applied to a host computer 100 and a printer 200.
FIG. 4 is a block diagram showing an internal configuration of a host computer 100 in FIG.
FIG. 5 is a block diagram showing an internal configuration of the printer 200 in FIG.
FIG. 6 is a flowchart illustrating a process of constructing a protocol stack above the USB stack when the host computer 100 is connected to the printer 200 via a USB line.
FIG. 7 is a flowchart illustrating a method in which the host computer 100 transmits data to the printer 200.
FIG. 8 is a flowchart illustrating a method in which the host computer 100 transmits data to the printer 200.
FIG. 9 is a flowchart illustrating a method in which the host computer 100 transmits data to the printer 200.
FIG. 10 is a flowchart illustrating a process of determining a protocol stack above the USB stack when the printer 200 is connected to the host computer 100 via a USB line.
FIG. 11 is a flowchart illustrating a method in which the printer 200 receives data from the host computer 100.
FIG. 12 is a flowchart illustrating a method in which the printer 200 receives data from the host computer 100.
FIG. 13 is a flowchart illustrating a method in which the printer 200 receives data from the host computer 100.
[Explanation of symbols]
1,11 CPU
2,12 RAM
3,13 hard disk
4 User command input device
5,15 USB port
8,18 Main bus
14 Printer
100 Host computer
200 printer

Claims (12)

2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する決定手段と、
前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むか否かを判別する判別手段と、
前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルを選択する選択手段と、
前記選択手段で選択されたプロトコルを用いて通信を行う通信手段とを備える通信制御システムにおいて、
前記判別手段により前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、前記選択手段は前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記判別手段により前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、前記選択手段は前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択するように構成されていることを特徴とする通信制御システム。
Determining means for determining a communication protocol for establishing the physical channel or the logical channel by negotiation between the two devices when constructing a physical channel or a logical channel for performing communication between the two devices;
Determining means for determining whether the communication protocol determined by the negotiation includes a flow control function of communication data,
Selection means for selecting a protocol to be set in an upper layer of the communication protocol determined by the negotiation,
A communication control system comprising: a communication unit that performs communication using the protocol selected by the selection unit;
When it is determined by the determination means that the communication protocol determined by the negotiation includes a flow control function of communication data, the selection means includes a flow control function in an upper layer of the communication protocol determined by the negotiation. If no communication protocol is selected and the communication protocol determined by the negotiation by the determination means does not include the flow control function of communication data, the selection means determines a higher rank of the communication protocol determined by the negotiation. A communication control system configured to select a protocol including a flow control function in a layer.
前記ネゴシエーションによって決定される通信プロトコルがUSB1.0若しくはUSB1.1であるか又はUSB2.0であるときに、決定された通信プロトコルがこれらの内のいずれであるかを前記選択手段に通知する通知手段を備え、
前記選択手段は、前記通知手段による通知がUSB1.0若しくはUSB1.1であるときと、USB2.0であるときとで異なるプロトコルを、前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルとして選択することを特徴とする請求項1記載の通信制御システム。
When the communication protocol determined by the negotiation is USB 1.0 or USB 1.1 or USB 2.0, a notification for notifying the selection means of which of the determined communication protocols is selected. With means,
The selecting means sets a different protocol between when the notification by the notifying means is USB 1.0 or USB 1.1 and when the notification is USB 2.0, in a higher layer of the communication protocol determined by the negotiation. The communication control system according to claim 1, wherein the communication control system is selected as:
前記選択手段は、記通知手段による通知がUSB1.0若しくはUSB1.1であるときは、フロー制御機能を有するプロトコルを、前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルとして選択することを特徴とする請求項1又は2記載の通信制御システム。When the notification by the notifying means is USB1.0 or USB1.1, the selecting means selects a protocol having a flow control function as a protocol set in an upper layer of the communication protocol determined by the negotiation. The communication control system according to claim 1 or 2, wherein: 前記フロー制御機能を有するプロトコルはIEEE1284.4であることを特徴とする請求項3記載の通信制御システム。The communication control system according to claim 3, wherein the protocol having the flow control function is IEEE1284.4. 前記ネゴシエーションによって決定される通信プロトコルがUSB1.0若しくはUSB1.1であるか又はUSB2.0であるときに、前記ネゴシエーションによって決定された通信プロトコルの上位層は、前記ネゴシエーションによって決定された通信プロトコルにより決定することを特徴とする請求項3記載の通信制御システム。When the communication protocol determined by the negotiation is USB1.0 or USB1.1 or USB2.0, the upper layer of the communication protocol determined by the negotiation is based on the communication protocol determined by the negotiation. The communication control system according to claim 3, wherein the determination is made. 前記ネゴシエーションによって決定される通信プロトコルがUSB1.0若しくはUSB1.1であるか又はUSB2.0で、前記決定された通信プロトコルの上位層が前記ネゴシエーションによって決定された通信プロトコルにより決定するとき、前記2つの機器の一方がその決定された上位層の通信プロトコルを、USB2.0が規定するvendoruniqueコマンドを用いて、前記2つの機器の他方に通知することを特徴とする請求項3記載の通信制御システム。When the communication protocol determined by the negotiation is USB 1.0 or USB 1.1 or USB 2.0 and the upper layer of the determined communication protocol is determined by the communication protocol determined by the negotiation, 4. The communication control system according to claim 3, wherein one of the two devices notifies the other of the determined upper layer communication protocol to the other of the two devices by using a venderunique command defined by USB 2.0. . 前記2つの機器の一方が、フロー制御機能を有するプロトコルを上位層の通信プロトコルとして選択した場合に、その選択をvendoruniqueコマンドを用いて前記2つの機器の他方に通知することを特徴とする請求項6記載の通信制御システム。When one of the two devices selects a protocol having a flow control function as an upper layer communication protocol, the selection is notified to the other of the two devices by using a vendorunique command. 7. The communication control system according to 6. 前記2つの機器の一方が、フロー制御機能を有する予め指定されたプロトコルを上位プロトコルの1つとして選択した場合に、前記2つの機器の他方は、前記2つの機器の一方がそのプロトコルを選択したことを、前記ネゴシエーションによって決定された通信プロトコルがUSB2.0であることによって検知することを特徴とする請求項3記載の通信制御システム。If one of the two devices has selected a pre-designated protocol having a flow control function as one of the higher-level protocols, the other of the two devices has one of the two devices selected that protocol 4. The communication control system according to claim 3, wherein the communication control system detects that the communication protocol determined by the negotiation is USB 2.0. 2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する通信制御システムにおいて、
前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含む場合には、前記2つの機器の各々が前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まない場合には、前記2つの機器の各々が前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択し、前記2つの機器の各々が互いに通信を行うように構成されていることを特徴とする通信制御システム。
When constructing a physical channel or a logical channel for performing communication between two devices, a communication control system that determines a communication protocol for constructing the physical channel or the logical channel by negotiation between the two devices,
When the communication protocol determined by the negotiation includes a flow control function of communication data, each of the two devices selects a protocol that does not include a flow control function in an upper layer of the communication protocol determined by the negotiation. If the communication protocol determined by the negotiation does not include a communication data flow control function, each of the two devices selects a protocol that includes a flow control function in an upper layer of the communication protocol determined by the negotiation. And a communication control system, wherein the two devices are configured to communicate with each other.
2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する決定ステップと、
前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むか否かを判別する判別ステップと、
前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルを選択する選択ステップと、
前記選択ステップで選択されたプロトコルを用いて通信を行う通信ステップとを備える通信制御方法において、
前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択することを特徴とする通信制御方法。
Determining a communication protocol for constructing the physical channel or the logical channel by negotiation between the two devices when constructing a physical channel or a logical channel for performing communication between the two devices;
A determining step of determining whether the communication protocol determined by the negotiation includes a flow control function of communication data,
A selection step of selecting a protocol to be set in an upper layer of the communication protocol determined by the negotiation,
And a communication step of performing communication using the protocol selected in the selection step,
If it is determined in the determining step that the communication protocol determined by the negotiation includes a flow control function of communication data, the selecting step includes a flow control function in an upper layer of the communication protocol determined by the negotiation. If no communication protocol is selected by the determination step and the communication protocol determined by the negotiation does not include the flow control function of communication data, the selection step includes a higher rank of the communication protocol determined by the negotiation. A communication control method comprising selecting a protocol including a flow control function in a layer.
コンピュータが実行する通信制御用プログラムにおいて、
2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する決定ステップと、
前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むか否かを判別する判別ステップと、
前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルを選択する選択ステップと、
前記選択ステップで選択されたプロトコルを用いて通信を行う通信ステップとを前記コンピュータに実行させ、さらに、
前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択することを前記コンピュータに実行させることを特徴とする通信制御用プログラム。
In a communication control program executed by a computer,
Determining a communication protocol for constructing the physical channel or the logical channel by negotiation between the two devices when constructing a physical channel or a logical channel for performing communication between the two devices;
A determining step of determining whether the communication protocol determined by the negotiation includes a flow control function of communication data,
A selection step of selecting a protocol to be set in an upper layer of the communication protocol determined by the negotiation,
Causing the computer to execute a communication step of performing communication using the protocol selected in the selection step,
If it is determined in the determining step that the communication protocol determined by the negotiation includes a flow control function of communication data, the selecting step includes a flow control function in an upper layer of the communication protocol determined by the negotiation. If no communication protocol is selected by the determination step and the communication protocol determined by the negotiation does not include the flow control function of communication data, the selection step includes a higher rank of the communication protocol determined by the negotiation. A communication control program for causing the computer to select a protocol including a flow control function in a layer.
コンピュータが実行する通信制御用プログラムを格納することを特徴とするコンピュータで読み取り可能な記憶媒体において、
2つの機器の間で通信を行うための物理チャネルまたは論理チャネルを構築するときに、その物理チャネル又は論理チャネルを構築する通信プロトコルを2つの機器間でのネゴシエーションによって決定する決定ステップと、
前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むか否かを判別する判別ステップと、
前記ネゴシエーションによって決定された通信プロトコルの上位層に設定するプロトコルを選択する選択ステップと、
前記選択ステップで選択されたプロトコルを用いて通信を行う通信ステップとを前記コンピュータに実行させ、さらに、
前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含むと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含まないプロトコルを選択し、前記判別ステップにより前記ネゴシエーションによって決定された通信プロトコルが通信データのフロー制御機能を含まないと判別された場合には、前記選択ステップは前記ネゴシエーションによって決定された通信プロトコルの上位層にフロー制御機能を含むプロトコルを選択することを前記コンピュータに実行させる通信制御用プログラムを格納することを特徴とする記憶媒体。
In a computer-readable storage medium storing a communication control program to be executed by a computer,
Determining a communication protocol for constructing the physical channel or the logical channel by negotiation between the two devices when constructing a physical channel or a logical channel for performing communication between the two devices;
A determining step of determining whether the communication protocol determined by the negotiation includes a flow control function of communication data,
A selection step of selecting a protocol to be set in an upper layer of the communication protocol determined by the negotiation,
Causing the computer to execute a communication step of performing communication using the protocol selected in the selection step,
If it is determined in the determining step that the communication protocol determined by the negotiation includes a flow control function of communication data, the selecting step includes a flow control function in an upper layer of the communication protocol determined by the negotiation. If no communication protocol is selected by the determination step and the communication protocol determined by the negotiation does not include the flow control function of communication data, the selection step includes a higher rank of the communication protocol determined by the negotiation. A storage medium storing a communication control program that causes the computer to select a protocol including a flow control function in a layer.
JP2003133594A 2003-05-12 2003-05-12 System, method, program of communication control and storage medium Withdrawn JP2004334798A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003133594A JP2004334798A (en) 2003-05-12 2003-05-12 System, method, program of communication control and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003133594A JP2004334798A (en) 2003-05-12 2003-05-12 System, method, program of communication control and storage medium

Publications (1)

Publication Number Publication Date
JP2004334798A true JP2004334798A (en) 2004-11-25

Family

ID=33508080

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003133594A Withdrawn JP2004334798A (en) 2003-05-12 2003-05-12 System, method, program of communication control and storage medium

Country Status (1)

Country Link
JP (1) JP2004334798A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007150390A (en) * 2005-11-24 2007-06-14 Matsushita Electric Ind Co Ltd Communication apparatus
US7761620B2 (en) 2006-07-06 2010-07-20 Citizen Holdings Co., Ltd. Communications device, and communications method for enabling reception of real-time execution commands when a receive buffer is full
JP2011513883A (en) * 2008-06-30 2011-04-28 インテル・コーポレーション Asymmetric universal serial bus communication

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007150390A (en) * 2005-11-24 2007-06-14 Matsushita Electric Ind Co Ltd Communication apparatus
US7761620B2 (en) 2006-07-06 2010-07-20 Citizen Holdings Co., Ltd. Communications device, and communications method for enabling reception of real-time execution commands when a receive buffer is full
JP2011513883A (en) * 2008-06-30 2011-04-28 インテル・コーポレーション Asymmetric universal serial bus communication
US8321600B2 (en) 2008-06-30 2012-11-27 Intel Corporation Asymmetrical universal serial bus communications
US8335866B2 (en) 2008-06-30 2012-12-18 Intel Corporation Asymmetrical serial communications
US8341303B2 (en) 2008-06-30 2012-12-25 Intel Corporation Asymmetrical universal serial bus communications
US8762585B2 (en) 2008-06-30 2014-06-24 Intel Corporation Asymmetrical Universal Serial Bus communications
US9069697B2 (en) 2008-06-30 2015-06-30 Intel Corporation Asymmetrical universal serial bus communications

Similar Documents

Publication Publication Date Title
TW432318B (en) Peripheral machine and its control method
JP5089429B2 (en) Information processing apparatus, control method therefor, and program
JP5423079B2 (en) Device management system, device, device management method and device management program
JP5328225B2 (en) Device monitoring apparatus and control method thereof, device monitoring system, and program
JP2004157966A (en) End point memory control method and device, usb device, and storage medium
US20140300921A1 (en) Image forming apparatus and power supply control system
JP2007281836A (en) Image processor, job repeater, job transmitting program, job&#39;s type-/address-related information automatically setting program
JP2007098590A (en) Image forming device
CN103810003A (en) Information processing apparatus, method of controlling the same, and storage medium
JP2007207194A (en) Printer, external device, print system, and method for controlling printer
JP2004334798A (en) System, method, program of communication control and storage medium
US8429733B2 (en) Authentication system, terminal and information processing device, having function of performing stable authentication
JP2004341728A (en) Printer, printing system and cancellation method
US20100265542A1 (en) Image processing device, image processing method, and program
JP6007775B2 (en) Job management apparatus, network system, image processing apparatus, job management method, and job management program
EP0930563A2 (en) Printing system and printing apparatus
JP2016210035A (en) Communication device, control method, and program
JP5106082B2 (en) Printing system, printing apparatus and printing control method therefor
JP2006338232A (en) Communication system
EP4187365A1 (en) Printing apparatus, control method thereof, and program
CN104683624A (en) Electronic device and electronic device starting method
EP2610733B1 (en) Image forming apparatus connectable to multiple hosts and method of controlling image forming jobs of the image forming apparatus
JP2004153742A (en) Network apparatus and network system
JP6791026B2 (en) Image forming device
JPH0924660A (en) Printer

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20060415

A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20060801