[go: up one dir, main page]

JP4403677B2 - Communication apparatus and communication system - Google Patents

Communication apparatus and communication system Download PDF

Info

Publication number
JP4403677B2
JP4403677B2 JP2001256681A JP2001256681A JP4403677B2 JP 4403677 B2 JP4403677 B2 JP 4403677B2 JP 2001256681 A JP2001256681 A JP 2001256681A JP 2001256681 A JP2001256681 A JP 2001256681A JP 4403677 B2 JP4403677 B2 JP 4403677B2
Authority
JP
Japan
Prior art keywords
data
channel
packet
task
external
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.)
Expired - Fee Related
Application number
JP2001256681A
Other languages
Japanese (ja)
Other versions
JP2003067318A (en
Inventor
顕寛 古川
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2001256681A priority Critical patent/JP4403677B2/en
Publication of JP2003067318A publication Critical patent/JP2003067318A/en
Application granted granted Critical
Publication of JP4403677B2 publication Critical patent/JP4403677B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Facsimiles In General (AREA)
  • Storing Facsimile Image Data (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、共有メモリを介して、自身のプロセッサにて動作する自己タスクと、外部のプロセッサにて動作する外部タスクとの間で、複数の論理チャネルを用いてデータ通信を行う通信装置に関する。
【0002】
【従来の技術】
従来より、通信装置としては、パーソナルコンピュータや多機能ファクシミリ等に組み込まれるLAN(ローカルエリアネットワーク)カードが知られている。
【0003】
この種のLANカードは、自身内蔵のCPUと、上記多機能ファクシミリ本体等に内蔵されたCPUと、からアクセス可能な共有メモリを備えており、LANから受信した通信データを共有メモリに書き込んだり、上記多機能ファクシミリ本体等から共有メモリに書き込まれた通信データを読み出してLAN上に送出する構成にされている。
【0004】
一方、多機能ファクシミリ本体は、内蔵のCPUにて、LANカード側から共有メモリに書き込まれた通信データを読み込んで、本体側の内蔵メモリに書き込んだり、内蔵メモリから取り出した通信データを共有メモリに書き込む構成にされている。
【0005】
また、従来の通信装置は、上記共有メモリを介して多重通信可能とするために、複数同時動作可能な論理チャネルを用いて、通信制御を行っている。
【0006】
【発明が解決しようとする課題】
しかしながら、上記従来の通信装置では個々の論理チャネルの制御方法を、その論理チャネルを使用するアプリケーションで指定しなければならない事が問題となっていた。
【0007】
つまり、共有メモリを使用した通信方法では、装置全体として送信側が共有メモリに書き込む通信データのバイト数と、受信側が共有メモリから読み出す通信データのバイト数との調整が上手く行えていない場合に、共有メモリ上に通信データが滞留してしまい、以後のデータの送受信が滞ってしまうといった問題が発生するが、従来では、複数の論理チャネルが同時動作する場合に、夫々の論理チャネルを対応するアプリケーションで個別に制御しなければならないため、このような問題を解決するようにアプリケーションでの通信制御方法を取り決めるのが非常に難しかった。
【0008】
本発明は、こうした問題に鑑みなされたものであり、外部のプロセッサとの間で、共有メモリ内にデータが長時間滞留しないようにして通信を行うことが容易に可能な通信装置を提供することを目的とする。
【0009】
【課題を解決するための手段】
かかる目的を達成するためになされた請求項1に記載の発明は、自身のプロセッサ、及び、外部のプロセッサよりアクセス可能な共有メモリを介して、自身のプロセッサにて動作する自己タスクと、外部のプロセッサにて動作する外部タスクとの間で、複数の論理チャネルを用いてデータ通信を行う通信装置であって、外部タスクの動作により外部のプロセッサから共有メモリに書き込まれたデータを各論理チャネル毎に格納するための受信バッファを備える
【0010】
また、この通信装置は、データ取込手段及びデータ受渡手段を備えており、外部のプロセッサからチャネルIDに関する情報を含むデータが共有メモリに書き込まれると、データ取込手段にて、その書き込まれたデータを共有メモリから読み出して、当該データ内のチャネルIDに関する情報に基づき、当該データを、対応する論理チャネルの受信バッファに書き込み、データ取込手段による上記データの書き込みが完了すると、データ受渡手段にて、その受信バッファに対応する論理チャネルを使用する自己タスクに、受信バッファに格納されたデータを受け渡す構成にされている。
【0011】
この他、通信装置は、受信容量通知手段を備えており、当該受信容量通知手段にて、複数の論理チャネルの夫々について、受信バッファに格納可能な当該論理チャネルのデータ容量に関する自己容量情報を、外部のプロセッサに通知する構成にされている。
更に、この通信装置は、データ送出手段及び通信制御手段を備えており、通信制御手段にて、外部タスクが共有メモリより取り込み可能な論理チャネル毎のデータ容量に関する外部容量情報を、外部のプロセッサから取得し、この外部容量情報に基づき、データ送出手段を制御して、外部タスクがデータを共有メモリより取り込み可能な範囲内で、データ送出手段に、自己タスクにより生成された送信用データとチャネルIDに関する情報とを含むデータを、共有メモリに書き込ませる構成にされている。
【0012】
この通信装置によれば、通信制御手段によって、論理チャネル毎に、データ送出手段による共有メモリ上へのデータ書き込みを、受信側の外部タスクがデータを共有メモリより取り込み可能な範囲内に制限することができるため、複数の論理チャネルが同時動作している状態で、各論理チャネルでのデータ書き込み量を適切に管理することができる。
【0013】
したがって、少なくとも当該通信装置側からのデータ書き込みにより、共有メモリに長時間データが格納されたままの状態になるのを防止することができて、複数の論理チャネルを用いて、外部のプロセッサとの間で効率よく通信を行うことができる。また、通信制御手段が、このような通信制御を統括して行うために、アプリケーション実行時にプロセッサが実行するタスクで個々の論理チャネルの通信制御方法を指定しなくてもよく、アプリケーション側のメモリデバイスアクセス用のインターフェースを単純化することができる。
【0014】
また、本発明によれば、外部のプロセッサを備えた外部装置を、本発明の通信装置と同様の手順で、共有メモリへのデータ書き込み、及び、共有メモリからのデータ取り込みを行う構成とすることで(即ち、外部装置を、本発明の通信装置と同様の構成にすることで)、当該通信装置側からのデータ書き込みにより共有メモリに長時間データが格納されたままになるのを防止できるだけでなく、外部のプロセッサが共有メモリにデータを書き込むことにより、共有メモリにデータが長時間滞留するのを防止することができる。この結果、本発明によれば、外部タスクと自己タスクとの間で、効率よく双方向通信を行うことができる。
【0015】
尚、受信容量通知手段は、データ送出手段に自己容量情報を共有メモリに書き込ませることにより、自己容量情報を、共有メモリを介して外部のプロセッサに通知し、通信制御手段は、外部のプロセッサから共有メモリに書き込まれた外部容量情報を、データ受渡手段を介して取得することにより、外部容量情報を、外部のプロセッサから共有メモリを介して取得する構成にすることができる(請求項2)。
【0016】
この他、受信容量通知手段は、請求項3に記載のように構成されているのが好ましい。
請求項3に記載の通信装置の受信容量通知手段は、初期容量通知手段と、追加容量通知手段と、を備えており、自己タスクが外部タスクとの間で通信を開始する際に、初期容量通知手段にて、当該通信で用いる論理チャネルに対応する受信バッファに格納可能な初期データ容量を外部のプロセッサに通知し、以後、追加容量通知手段にて、当該論理チャネルに対応する受信バッファに格納されたデータをデータ受渡手段が自己タスクに受け渡すことにより新たに受信バッファに格納可能となった追加データ容量を、所定の契機で外部のプロセッサに通知する構成にされている。
【0017】
この通信装置においては、自己容量情報として、初期データ容量を外部のプロセッサに通知した後に、所定期間毎に追加データ容量を外部のプロセッサに通知することができるため、自己容量情報の通知動作量を十分に抑制することができる。この結果、本発明の通信装置(請求項3)によれば、ハードウェア資源を有効に活用して、円滑に外部タスクと自己タスクとの間で双方向通信を行うことができる。
【0018】
また、外部タスクとの間で行われる論理チャネル毎のデータ通信が、パケットにより構成されるチャネルIDに関する情報を含むデータを共有メモリに書き込む動作、及び、外部のプロセッサによって共有メモリに書き込まれたパケットを取り込む動作を通じて行われる場合、初期容量通知手段及び追加容量通知手段は、次のように構成されるとよい。
即ち、初期容量通知手段は、請求項4記載のように、初期データ容量として、通信で用いる論理チャネルに対応する受信バッファに格納可能な最大パケット数と、そのパケット長とを、外部のプロセッサに通知し、追加容量通知手段は、追加データ容量として、当該論理チャネルに対応する受信バッファに格納されたパケットをデータ受渡手段が自己タスクに受け渡すことにより新たに受信バッファに格納可能となったパケット数を、外部のプロセッサに通知する構成にされるとよい。
【0019】
このようにすれば、外部のプロセッサに、パケット単位で共有メモリへのパケットの書き込み量を制御させることができるので、外部のプロセッサの通信制御にかかる構成を簡素化することができる。
【0020】
また、上記通信装置においては、受信容量通知手段が、データ取込手段が共有メモリより受信バッファに格納したパケット数と、当該装置の受信バッファに格納可能な(取り込み可能な)パケット数とに基づき、所定の契機で、追加容量通知手段にて追加データ容量を通知するように構成されているのが良い。このようにすれば、追加データ容量を効率よく外部のプロセッサに通知することができて便利である。
【0021】
この他、上記通信装置(請求項1〜請求項4)においては、請求項5に記載のように、論理チャネルの夫々を、第一チャネル、第二チャネル、第三チャネルのいずれかのチャネルタイプに区分して、通信制御手段による夫々の論理チャネルの通信制御方法を変更するのが好ましい。
【0022】
請求項5に記載の通信装置においては、外部タスクと自己タスクとの間の通信制御に必要な処理の実行を指令するコマンドを含むパケットを送受信するための論理チャネルを、第一チャネルに区分し、上記コマンドを除くデータであって、外部タスクと自己タスクとの間で、単一パケットにて構成可能なデータを送受信するための論理チャネルを、第二チャネルに区分している。
【0023】
また、上記コマンドを除くデータであって、外部タスクと自己タスクとの間で、複数パケットにて構成される送信用データを送受信するための論理チャネルを、第三チャネルに区分し、更に、第三チャネルに区分した論理チャネルの受信バッファを、複数パケットを格納可能な構成にしている。
この他、通信制御手段は、データ送出手段に、第三チャネルに区分されている論理チャネルのチャネルIDに関する情報を含むパケットを、共有メモリに書き込ませる場合に、当該論理チャネルについての外部容量情報を外部のプロセッサから取得し、この外部容量情報に基づき、データ送出手段を制御する構成にされている。
【0024】
つまり、この通信装置においては、外部のプロセッサから外部容量情報を取得してこれに基づき通信制御手段にて通信制御を行う方法を、複数パケットの送信用データを共有メモリを介して送受信するための第三チャネルに限って適用することにより、外部容量情報の取得動作を必要不可欠な分だけに抑制している。したがって、この通信装置によれば、外部容量情報を、共有メモリを介して授受する場合等において、共有メモリ上の限られたメモリ資源を有効に活用して、円滑に外部タスクとの間で通信を行うことができる。
【0025】
尚、ここで更に、この第一チャネル又は第二チャネルに属する各論理チャネル毎の受信バッファを、唯一のパケットを格納する構成にすれば、明示的にフロー制御しなくても、パケットを受信した順に、そのパケットを自己タスクに受け渡すことができるので、例えば、第一チャネルを使用する上記コマンドについては、送信元から送信されてきた順に、これを処理することができる。
【0026】
この他、請求項5に記載の通信装置は、請求項6のように、第一チャネルに区分されている論理チャネルのチャネルIDに関する情報を含むパケットが、受信バッファに書き込まれた場合には、データ受渡手段によって、当該パケットに含まれるコマンドに従った処理を実行し、第二チャネル及び第三チャネルのいずれかに区分されている論理チャネルのチャネルIDに関する情報を含むパケットが、受信バッファに書き込まれた場合には、データ受渡手段によって、当該論理チャネルを使用する自己タスクにパケットを受け渡すことで、この自己タスクに、当該パケットに対応した処理を実行させる構成にされるとよい。
【0027】
この通信装置によれば、上記コマンドを迅速に実行することができる結果、通信制御を円滑に行うことができる。
【0028】
また、請求項7に記載の通信装置は、通信制御手段が、データ送出手段に、第三チャネルに区分されている論理チャネルのチャネルIDに関する情報を含むパケットを、共有メモリに書き込ませる場合に、当該論理チャネルにおいて外部タスクが共有メモリより取り込み可能なパケット数と、そのパケット長とを、外部容量情報として取得すると共に、データ送出手段を制御して、データ送出手段に、そのパケット数及びパケット長の範囲内でパケットを共有メモリに書き込ませる構成にされたものである
【0029】
このような構成の通信装置においては、パケット単位でデータ送出手段の共有メモリへのパケットの書き込み量を制御するように通信制御手段を構成すればよいので、通信制御手段の通信制御にかかる構成を簡素化することができて、通信制御手段をCPUによる自己タスクとして動作させる場合においては、通信制御のためのCPUの処理負荷を抑制することができる。つまり、本発明の通信装置によれば、効率よくデータ送出手段の制御を行うことができる。
【0030】
また、請求項8記載の発明は、プロセッサを備える第一及び第二の処理実行装置、並びに、当該第一及び第二の処理実行装置よりアクセス可能で第一の処理実行装置と第二の処理実行装置との間に介在する共有メモリを備え、共有メモリを介して、第一の処理実行装置のプロセッサにて動作するタスクと、第二の処理実行装置のプロセッサにて動作するタスクとの間で、複数の論理チャネルを用いてデータ通信を行う通信システムであって、第一の処理実行装置及び第二の処理実行装置が次のように構成されたものである。
即ち、第一の処理実行装置は、第二の処理実行装置から共有メモリに書き込まれたデータを論理チャネル毎に格納するための受信バッファと、第二の処理実行装置からチャネルIDに関する情報を含むデータが共有メモリに書き込まれると、このデータを共有メモリから読み出し、当該データ内のチャネルIDに関する情報に基づき、当該データを、対応する論理チャネルの受信バッファに書き込むデータ取込手段と、データ取込手段が受信バッファにデータを書き込むと、自装置のプロセッサにて動作するタスクであって、その受信バッファに対応する論理チャネルを使用するタスクに、受信バッファに格納されたデータを受け渡すデータ受渡手段と、複数の論理チャネルの夫々について、受信バッファに格納可能な当該論理チャネルのデータ容量に関する受信容量情報を、第二の処理実行装置に通知する受信容量通知手段と、を備える。
【0031】
また、第二の処理実行装置は、自装置のプロセッサにて動作するタスク、により生成された送信用データとチャネルIDに関する情報とを含むデータを、共有メモリに書き込むデータ送出手段と、第一の処理実行装置から受信容量情報を取得し、この受信容量情報に基づき、データ送出手段を制御して、第一の処理実行装置がデータを共有メモリより取り込み可能な範囲内で、データ送出手段にデータを共有メモリに書き込ませる通信制御手段と、を備える。この通信システムによれば、請求項1と同様の理由により、各論理チャネルでのデータ書き込み量を適切に管理することができ、第一及び第二の処理実行装置間で、複数の論理チャネルを用いて効率よく通信を行うことができる。
【0032】
【発明の実施の形態】
図1は、本発明が適用されたファクシミリ10の構成を表すブロック図である。
図1に示すように、本実施例のファクシミリ10は、主に、読取部11と、印刷部13と、ユーザインターフェース(I/F)15と、電話回線接続部17と、LANインターフェース(I/F)19と、USBインターフェース(I/F)21と、制御部23と、から構成されており、読取部11やLANI/F19を介して取得した画像データを公衆電話回線網を通じて外部のファクシミリに送信する本来のファックス機能の他に、紙面上の画像を複製印刷するコピー機能、LAN(ローカルエリアネットワーク)を介してパソコン等の外部装置から送信されてきた画像データを紙に印刷するプリンタ機能等を備えている。
【0033】
詳述すると、読取部11は、紙面上に印刷された文字、図形等からなる画像を、光を照射することにより読み取って、電気的な信号に変換するものであり、所謂スキャナとして機能する。また特に、この読取部11は、連続的に複数の紙から画像を読み取るための紙送り機構を備えている。この読取部11は、例えば利用者が本実施例のファクシミリ10のファックス機能を使用する際やコピー機能を使用する際に動作し、動作することにより読み取った画像データを、制御部23に送信する。
【0034】
続いて、印刷部13は、給紙、排紙機構を備え、読取部11から取得した画像データ、電話回線接続部17を介して外部のファクシミリから送信されてきた画像データ、LANI/F19を介して外部のパソコン等から送信されてきた印刷用データなどに基づき、画像や文章などを紙面に印刷するためのものである。特に、本実施例における印刷部13は、写真印刷等ができるように構成されており、更には、画像等を連続的に紙面印刷するための紙送り機構を備えている。
【0035】
ユーザI/F15は、液晶ディスプレイ等からなる表示部15aと、キースイッチなどからなる操作部15bと、から構成されており、例えば、利用者の外部操作に対応する指令を、操作部15bより制御部23へ入力したり、制御部23から送信されてきたメッセージ等を、表示部15aに表示する。
【0036】
続いて、電話回線接続部17は、当該ファクシミリ10を公衆電話回線網に接続するためのものである。つまり例えば、電話回線接続部17は、制御部23からの入力信号に基づき、当該ファクシミリ10を、ファックス送付先となる外部のファクシミリに公衆電話回線網を介して接続して、読取部11で紙面から読み取った画像データを外部のファクシミリに送信する。
【0037】
また、LANI/F19は、当該ファクシミリ10をLANに接続するためのものであり、LANを介して外部のパソコン等と双方向通信を行うことができるようにされている。例えば、LANI/F19は、TCP/IPやIPX/SPX等の通信方式にて、外部装置(パソコン等)から画像データ等を取得し、これを制御部23に入力したり、制御部23からの指令に基づき、当該ファクシミリ10の動作状態などを外部装置(パソコン等)に通知する。
【0038】
この他、USB(Universal Serial Bus)I/F21は、利用者の外部操作により自身にパソコンなどの外部装置を接続して、その外部装置との間で通信を行うことにより、パソコンと当該ファクシミリとの間でデータ通信を行うためのものである。このUSBI/F21は、基本的に、LANI/F19と同様の目的で使用されるものであるが、特にLANに接続できないパソコン等を当該ファクシミリ10に接続する場合に利用される。
【0039】
そして、制御部23は、当該ファクシミリ10内の各部を統括制御するためのものであり、CPU25や、CPU25からアクセス可能でプログラム等を格納するROM27(例えば、フラッシュメモリ)、プログラム動作に必要な各種データを格納するための作業領域等として機能するDRAM29、などを備えている。
【0040】
ここで、この制御部23及び上記LANI/F19の詳細構成について図2を用いて説明する。尚、図2は、制御部23及び上記LANI/F19の詳細構成を表すブロック図である。また、図3は、共有メモリとしてのデュアルポートSRAM40(Dual-Port SRAM)のデュアルポートメモリ領域及びSRAMセマフォ領域の構成を表す説明図である。
【0041】
LANI/F19は、主に、CPU31と、CPU31にて動作するプログラムなどを記憶するためのROM33と、補助記憶用のEEPROM35と、CPUにて動作するプログラムが作業領域などの目的で使用するDRAM37と、LANI/Fを外部のLANに接続してメディアアクセス制御(MAC)等を行うためのネットワーク制御用デバイス39と、制御部23とLANI/F19の間で通信を行う際にデータを中継するためのデュアルポートSRAM40(以下、単に「SRAM」と表現する。)と、を備えており、CPU31に上述した全てのデバイス33〜40が接続された構成にされている。
【0042】
SRAM40は、2つの入出力制御機構を持つメモリデバイスで、制御部23側のCPU25に繋がるバスと、LANI/F19側のCPU31に繋がるバスとに接続されている。即ち、SRAM40は、制御部23のCPU25及びLANI/F19のCPU31からアクセス可能に構成されている。
【0043】
また、このSRAM40は、図3に示すように、デュアルポートメモリとして機能するデュアルポートメモリ領域と、制御部23のCPU25及びLANI/F19のCPU31からのアクセスに対して排他制御を行うためのSRAMセマフォ領域と、から構成されている。尚、図3は、デュアルポートSRAM40の構成を表す説明図である。
【0044】
デュアルポートメモリ領域は、ブロック・データ・バッファと、Urgentコマンド領域と、R/Wセマフォ領域と、第一割込要求設定領域と、第二割込要求設定領域と、その他の予約領域(図示せず)と、から構成されている。
ブロック・データ・バッファは、制御部23とLANI/F19との間で通信を行う際に、送信側(制御部23若しくはLANI/F19)から送信されてきた送信用データを含むパケットを一時格納して、受信側(LANI/F19若しくは制御部23)に受け渡すためのデータバッファ領域である。本実施例では、1ブロック当たり512バイトで区画された15ブロック分の領域が確保されている。尚、このブロック・データ・バッファは、送信されてきた個々のパケットを、1つのブロック又は複数のブロックにまたがって格納する(詳しくは後述)。
【0045】
続いて、Urgentコマンド領域は、LANI/F19側からファクシミリ10本体へ電源リセット要求などの特殊なコマンドを入力するための領域である。このUrgentコマンド領域は、通常のデータ通信の際には使用されないようになっており、LANI/F19からコマンドを書き込むための領域と、制御部23側からコマンドを書き込むための領域とに、区分されている。
【0046】
R/Wセマフォ領域は、上記15ブロックに区画されたブロック・データ・バッファの各ブロックへのアクセスを排他制御し、更には、各ブロックにおいて、データが書き込まれた順序で、読み出しを行うためのものであり、ブロック・データ・バッファの15個のブロックに対応して、R/Wセマフォを15個備えている。
【0047】
各R/Wセマフォは、対応ブロックの書き込み側を識別するための書き込み側識別情報を格納する2ビットの書き込み側識別領域と、対応ブロックのデータ書き込み若しくは読み出し状態を示す状態識別情報を格納するための14ビットの状態識別領域と、送信側(LANI/F19又は制御部23)が電源オン後の最初の書き込みをゼロとして以後ブロック・データ・バッファにデータの書き込みを行う度にカウント(1ずつ加算)した番号を、ブロックデータの書き込み順を表すシーケンシャル番号として格納するための16ビット(2バイト)のシーケンシャル番号領域と、から構成されている。
【0048】
尚、上記書き込み側識別領域には、書き込み側識別情報として、対応ブロックが空き状態(即ち、対応ブロックにデータが格納されていない状態)であることを示す”空き”情報、対応ブロックに格納されているデータが制御部23側(換言すると、ファクシミリ本体側)から書き込まれたデータであることを示す”本体側書き込み”情報、対応ブロックに格納されているデータがLANI/F19側から書き込まれたデータであることを示す”LAN側書き込み”情報、のいずれかの情報が格納されている。
【0049】
また、上記状態識別領域には、状態識別情報として、対応ブロックが空き状態であることを示す”空き”情報、対応ブロックにデータを書き込み途中であることを示す”書き込み中”情報、データの書き込みが完了し読み出し待ち状態であることを示す”書き込み完了”情報、対応ブロックからデータを読み出し中であることを示す”読み出し中”情報、のいずれかの情報が格納されている。
【0050】
この他、第一割込要求設定領域は、LANI/F19から制御部23側(本体側)への割込要求信号を格納するための領域である。つまり例えば、LANI/F19がこの第一割込要求設定領域へ所定のデータを書き込むことにより割込要求信号をセットすると、制御部23は、この領域内のデータを読み出すことにより割込要求に応答して、割込要求信号をクリアする。また、第二割込要求設定領域は、制御部23からLANI/F19側への割込要求信号を格納するための領域である。
【0051】
また、SRAMセマフォ領域は、SRAM40へのアクセスに対して排他制御を行うためのセマフォ機能を実現するために確保されている領域であり、R/Wセマフォ領域用のSRAMセマフォと、Urgentコマンド領域用のSRAMセマフォと、第一割込要求設定領域用のSRAMセマフォと、第二割込要求設定領域用のSRAMセマフォと、その他の予約領域(図示せず)と、から構成されている。
【0052】
各SRAMセマフォは、片方(制御部23又はLANI/F19)からSRAMセマフォ取得時の値(以下、「取得値」とする。)が書き込まれると、他方にに、SRAMセマフォ解放時の値(以下、「解放値」とする。)を返すように構成されており、SRAMセマフォ取得値を書き込んだ側から解放値を入力しない限り、他方からはSRAMセマフォ取得値を書き込めない(即ち、SRAMセマフォを取得できない)ようになっている。
【0053】
詳述すると、R/Wセマフォ領域用SRAMセマフォは、R/Wセマフォ領域へのアクセスを排他制御するためのセマフォであり、本実施例のファクシミリ10においては、後述するSRAMI/F部により、制御部23及びLANI/F19の内、このSRAMセマフォを取得した側のみが、R/Wセマフォ領域にアクセスすることができるようにされている。
【0054】
また、Urgentコマンド領域用SRAMセマフォは、制御部23及びLANI/F19からのUrgentコマンド領域へのアクセスを排他制御するためのセマフォである。
この他、第一割込要求設定領域用SRAMセマフォは、第一割込要求設定領域へのアクセスを排他制御するためのセマフォ、第二割込要求設定領域用SRAMセマフォは、第二割込要求設定領域へのアクセスを排他制御するためのセマフォである。
【0055】
続いて、図4は、制御部23のCPU25で動作する各タスクと、LANI/F19のCPU31にて動作する各タスクとの間のデータ通信方法(データ受渡方法)を表した機能図である。
制御部23では、ROM27内にアプリケーション群やプロトコル部に対応する各種プログラム、SRAMI/F部に対応する各種プログラムが格納されており、CPU25は、これらを読み出すことにより各種タスクを実行している。同様に、LANI/F19のCPU31は、ROM33内に格納されているアプリケーション群、プロトコル部に相当する各種プログラム、SRAMI/F部に対応する各種プログラム、を読み出して、各種タスクを実行している。
【0056】
ここで、SRAMI/F部は、制御部23のCPU25にて動作するタスクとLANI/F19のCPU31にて動作するタスクとの間で通信を行う際に、CPU25,31がSRAM40にアクセスして送信用データを含むパケットを書き込んだり、読み出したりするための各CPU25,31にて動作するプログラム群である(詳細は後述)。
【0057】
また、プロトコル部は、SRAMI/F部に対応するプログラムを呼び出して、それらのプログラムで、パケットをSRAM40上に書き込んだり、読み出したりする際の手順を記述したプログラム群(換言すると、制御部23とLANI/F19との間の通信を制御するための通信制御用のプログラム群)である。
【0058】
つまり例えば、CPU25,31は、プロトコル部に対応する各種プログラムを実行することにより、アプリケーション群がDRAM29,37上に書き込んだ送信用データを取得すると共に、所定の手順でSRAMI/F部に対応するデータ書き込み用プログラム(後述するSRAMI/Fデータ書き込み処理)を実行して、SRAM40へデータ(パケット)を書き込む。また一方で、定期的にSRAMI/F部のデータ読み込み用プログラム(後述するSRAMI/Fデータ読み出し処理)を実行して、送信側からSRAM40上に書き込まれたデータ(パケット)を読み出し、これをDRAM29,37上に確保された受信パケット格納用のバッファ(即ち、受信バッファ)に書き込むと共に、受信バッファに一時格納した受信パケットをアプリケーション群に受け渡す(詳細は後述)。
【0059】
この他、制御部23が実行するアプリケーションとしては、ファクシミリ10がファックス機能、プリンタ機能、スキャナ機能、コピー機能などを果たすためのプログラムが挙げられる。
また、LANI/F19が実行するアプリケーションとしては、図4に示すように、POPメール受信プログラム、SMTPメール受信プログラム、SMTPメール送信プログラム、HTTPデーモン、印刷プロトコル群、本体側MIBアクセス関数、LAN側MIBアクセス関数、EEPROMアクセスプログラム、プリンタステータス通知プログラム等が挙げられる。
【0060】
詳述すると、POPメール受信プログラムは、ファクシミリ10がインターネット上のメールサーバから電子メールの受信を行うためのプログラムである。本実施例では、メールサーバからのメール受信をPOP3により行うようにされており、例えば、ファクシミリ10は、このプログラムで受信したメールを制御部23にて実行するアプリケーションにより処理して印刷部13で印刷する。この他、ファクシミリ10は、制御部23側で受信メールに添付されている画像データ等を抽出して、これを電話回線接続部17を介して外部のファクシミリに送信する。
【0061】
また、SMTPメール受信プログラムは、ファクシミリ10がメールサーバとして機能するためのプログラムである。本実施例では、SMTPに基づいて動作するようにされている。
この他、SMTPメール送信プログラムは、ファクシミリ10がインターネット上のメールサーバへ電子メールを送信するためのプログラムである。例えば、ファクシミリ10は、このプログラムを用いて、読取部11から読み込んだ画像データを電子メールに添付して外部に送信する。この他、ファクシミリ10は、公衆電話回線に接続された外部のファクシミリから送信されてきた画像データを、電子メールに添付して、これを外部に送信する。
【0062】
また、HTTPデーモンは、ファクシミリ10をWEBサーバとして機能させるためのプログラムである。例えば、LANI/F19は、HTTPデーモンにより、WEB画面上に表示するためのデータを制御部23から取得して、これをHTTP形式のデータでLAN上若しくはインターネット上に送出する。
【0063】
そして、印刷プロトコル群は、外部装置がLAN経由、インターネット経由で当該ファクシミリ10を遠隔操作して印刷機能を利用するための各種印刷プロトコルである。
この他、本体側MIBアクセス関数は、SNMPに基づいて管理する制御部23側の管理情報ベース(MIB)にデータを書き込んだり、読み出したりすることにより、ファクシミリ本体側の設定情報をLANI/F19側から管理するための関数である。また、LAN側MIBアクセス関数は、ファクシミリ本体としての制御部23側からLANI/F19のMIB内に格納されている設定情報を管理するための関数である。
【0064】
また、EEPROMアクセスプログラムは、ファクシミリ本体の制御部23からLANI/F19に実装されたEEPROM35にアクセスするためのプログラムである。
この他、プリンタステータス通知プログラムは、ファクシミリ10の動作状態(トナーや印刷用紙の消耗状態、印刷ジョブの処理状態等)を制御部23側から取得し、これに基づいて動作状態示した電子メールを作成して、これを当該ファクシミリの管理者の電子メールアドレス宛に送信するためのプログラムである。
【0065】
ところで、以上に説明したアプリケーションはLANI/F19のCPU31上で同時動作可能な構成にされており、これに対応して、LANI/F19は制御部23との間で、多重データ通信を行うことが可能な構成にされている。
つまり、本実施例のファクシミリ10では、複数の論理チャネルを用いて多重データ通信を行うことが可能な構成にされており、CPU25,31は、上記プロトコル部に対応するプログラムを実行することによって、上記各アプリケーションとの間で送受信すべき送信用データと、送信用データがどの論理チャネルに対応するデータであるかどうかを識別するためのチャネルIDと、を含むパケットを生成し、これを、SRAM40を介して受信側のプロトコル部に受け渡す構成にされている。
【0066】
また、本実施例のファクシミリ10においては、複数の論理チャネルを用いてもSRAM40上でパケットが滞ることなくデータ通信を行うことができるように、LANI/F19及び制御部23のROM27,33内に、各論理チャネルでの動作条件を記述するチャネル・プロパティ・テーブルを格納している。尚、図5(a)はチャネル・プロパティ・テーブルを表す説明図である。
【0067】
図5(a)に示すように、本実施例のファクシミリ10では、論理チャネルとして、制御部23側のプロトコル部、SRAMI/F部に対応するプログラムにより動作するタスクと、LANI/F19側のプロトコル部、SRAMI/F部に対応するプログラムにより動作するタスクとの間で必要なデータを送受信するためのシステムコマンドチャネルと、上記POPメール受信プログラムで使用されるPOPメール受信用チャネルと、上記SMTPメール受信プログラムで使用されるSMTPメール受信用チャネルと、上記SMTPメール送信プログラムで使用されるSMTPメール送信用チャネルと、上記HTTPデーモンで使用されるHTTP送受信用チャネルと、上記印刷プロトコル群で使用されるPDLデータ送受信用チャネルと、上記本体側MIBアクセス関数を呼び出すプログラムで使用される本体側MIBアクセス用チャネルと、上記LAN側MIBアクセス関数を呼び出すプログラムで使用されるLAN側MIBアクセス用チャネルと、上記EEPROMアクセスプログラムで使用されるEEPROMアクセス用チャネルと、上記プリンタステータス通知プログラムで使用されるプリンタステータス通知用チャネルと、が設定されている。
【0068】
各論理チャネル毎に設定されている動作条件に関する情報としては、チャネルタイプ( CH#Type)、サーバ/クライアント情報( Svr/Cli)、クレジットタイプ( Cred#Type)、チャネルID( CH#ID)、パケット当たり最大データ長(MAX#DLEN)、最大クレジット数(MAX#Cred)、限界クレジット数(Limit#Cred)、がある。
【0069】
以下、これらについて詳しく説明することにするが、この説明では、LANI/F19側のチャネル・プロパティ・テーブルについて重点的に説明することにする。尚、制御部23側のチャネル・プロパティ・テーブルもLANI/F19側のチャネル・プロパティ・テーブルと同様の構成にされている。
【0070】
チャネルタイプは、論理チャネルの種別を表す情報であり、本実施例における各論理チャネルは、システムコマンドチャネル(SYSTEM)、データチャネル(DATA)、コマンドチャネル(COMMAND)のいずれかに区分されている。
システムコマンドチャネルは、通信制御に必要な各処理を動作させるための各種システムコマンドを単一パケットに格納して制御部23とLANI/F19との間で送受信するためのチャネルであり、データチャネルは、複数パケットに分割して格納しなければならない送信用データを制御部23とLANI/F19との間で送受信するためのチャネルである。また、コマンドチャネルは、受信側(制御部23若しくはLANI/F19)を遠隔操作するためのコマンド(但し、システムコマンドを除く)を単一パケット内に格納して送受信するためのチャネルである。
【0071】
サーバ/クライアント情報は、LANI/F19側(制御部23側のチャネル・プロパティ・テーブルでは、制御部23側)が論理チャネルの使用開始を制御部23側へ要求する(即ち、後述するチャネルオープン要求用のオープンパケットを送信する)クライアントとして機能する論理チャネルであるか、それとも、LANI/F19側が制御部23側からの論理チャネルの使用開始の要求に応答してチャネル使用開始を許可する(即ち、後述するオープンパケット応答用のオープンリプライパケットを送信する)サーバとして機能する論理チャネルであるかを、識別するための情報である。尚、このサーバ/クライアント情報は、データチャネルに区分された論理チャネルにのみに有効であり、その他のチャネルタイプには、無効な情報であることを示す値(NA:Not Applicable)が付与されている。
【0072】
つまり、本実施例におけるデータチャネルは、オープンパケットと、これに応答するオープンリプライパケットが、制御部23及びLANI/F19間で送受信されることにより、使用可能な状態(オープン状態)になり、クローズパケットが送受信されると、使用不可能な状態(クローズ状態)になるように構成されており、LANI/F19は、論理チャネルがデータチャネルである場合にこのサーバ/クライアント情報を参照し、アプリケーションから論理チャネルの使用要求があった場合に、オープンパケットを制御部23側へ送信するか、オープンパケットを受信するまで待機するか、の動作を選択して、いずれかの方法で論理チャネルをオープン状態にする。
【0073】
クレジットタイプは、送信側(LANI/F19)が受信側(制御部23)で許容できない量のパケットをSRAM40上に書き込まないようにするために、プロトコル部にてクレジット数をカウントしデータ送信量の制御を行うかどうかを示す情報である。ここで、クレジット数とは、送信側で受信側の受信可能パケット数を把握するためのパラメータであり、当該ファクシミリ10においては、受信側がこのチャネル・プロパティ・テーブルの後述する最大クレジット数をチャネルオープン時に送信側に発行することにより、送信側の送信パケット数を制限し、送信側がクレジット数以上のパケットをSRAM40に書き込まないようにしている。
【0074】
ところで、本実施例におけるシステムコマンドチャネル、コマンドチャネルでのデータ送受信では、コマンドが単一パケットに格納されるためデータの繋がりを持つパケットが連続的に送受信されることがなく、データの送受信に関してクレジット数を用いたフロー制御を行う必要がないため、クレジットタイプには無効な値(NA)が付与されている。一方、データチャネルでは、扱うデータの性質上、一時的に複数のパケットが送受信されるため、クレジット数に基づきフロー制御を行う必要があり、クレジットタイプには有効な値(STREAM)が付与されている。
【0075】
この他、チャネルIDは、各論理チャネルを識別するためのID番号であり、パケット当たり最大データ長は、LANI/F19側が、受信バッファに取り込み可能なパケット当たりのデータ長の最大サイズ(バイト数)を示す情報である。尚、このデータ長の最大サイズは、図5(b)に示すデータ構成のパケットにおいて、パケットのヘッダ部分の情報を含まないとしたときのデータ長を示す。図5(b)は、ブロック・データ・バッファに格納された際のパケットのデータ構成を表す説明図である。
【0076】
本実施例においては、プロトコル部によりパケットを生成しSRAMI/F部にてそのパケットをSRAM40内に書き込んでいるが、このプロトコル部で生成されるパケットには、2バイトのパケット長に関する情報を格納するための領域と、チャネルIDに関する情報を格納するための領域と、チャネルがシステムコマンドチャネルである場合にシステムコマンドの種別コードを格納するための1バイトの領域が確保されており、パケットのヘッダ部分には、これら4バイトの情報が格納され、そのヘッダ部分より後部には、アプリケーションより指定された送信用データが格納されている。
【0077】
例えば、パケットあたり最大データ長が504バイトの論理チャネルにおいては、プロトコル部により最大でパケット長が508バイトのパケットが生成可能にされている。また、パケットあたり最大データ長が1012バイトの論理チャネルにおいては、プロトコル部により最大でパケット長が1016バイトのパケットが生成可能にされている。尚、1016バイトのパケットの場合には、SRAM40内のブロックデータバッファで区画された512バイト(内、パケット格納可能な領域は508バイト)のブロックにパケット全体を格納することができないので、SRAMI/F部により、ヘッダ部分を含む508バイトのパケット前半部分と、508バイトのパケット後半部分と、が各ブロックに(2つのブロックにまたがって)格納される構成にされている。
【0078】
また、最大クレジット数は、論理チャネルに対応した受信バッファがチャネルオープン時に格納可能なパケット数を示す情報であり、当該ファクシミリ10においては、チャネルオープン時に、制御部23及びLANI/F19双方で、互いのチャネル・プロパティ・テーブルの最大クレジット数の情報を交換し合う構成にされている。尚、本実施例ではデータチャネルにのみ、最大クレジット数として、有効な値が付与されている。
【0079】
この他、限界クレジット数は、クレジット数の付加情報を格納したクレジットパケットを相手側(制御部23)に送信するタイミングを調整するための値である。本実施例においては、送信側が、受信側から取得した最大クレジット数に関する情報に基づき、最大クレジット数の範囲内で、パケットを送信するため、受信側から新たなクレジット数を追加しないと、送信側はパケットの送信(SRAM40内へのパケット書き込み)を一時停止してしまうことになる。したがって、本実施例では、受信側が、送信側から受信したパケット数に基づき、送信側の残りクレジット数を把握して、残りクレジット数と、受信バッファに格納されているパケット数との合計が、限界クレジット数以下となると、クレジットパケットを相手側(制御部23)へ送出する構成になっている。
【0080】
また、本実施例においては、DRAM29,37内に、論理チャネルの動作状態や論理チャネル使用時にプロトコル部等が必要とするデータを記憶するためのチャネルステート情報域(図示せず)が各論理チャネル毎に確保されている。
尚、以下に説明するSRAMI/F部及びプロトコル部に対応するプログラムによりCPUが実行する各処理は、このチャネルステート情報域の各情報を参照にして動作し、また必要に応じて論理チャネルの状態を書き込むように構成されている。
【0081】
以下、上記SRAMI/F部に対応するプログラムを実行することによりCPU31が行う各処理の手順について説明する。尚、以下では、LANI/F19のCPU31が実行する処理についてのみ説明することにするが、本実施例のファクシミリ10においては、制御部23のCPU25も同様の処理を実行する構成にされている。
【0082】
図6は、CPU31がSRAM40のブロック・データ・バッファに格納されたパケットを読み出すために実行するSRAMI/Fデータ読み出し処理を表すフローチャートである。また、図7は、このSRAMI/Fデータ読み出し処理実行中に呼び出される読み出しブロック検索処理を表すフローチャートである。
【0083】
処理を実行すると、まずCPU31は、S110にてR/Wセマフォ領域用SRAMセマフォを取得する。つまり、CPU31は、R/Wセマフォ領域用SRAMセマフォに取得値を書き込み、書き込みが完了した時点でセマフォを取得したと判断し、続くS120にて、図7に示す読み出しブロック検索処理を実行する。
【0084】
この読み出しブロック検索処理を実行するとまず、CPU31は、S121にて前回の当該処理でデータを読み出したブロック・データ・バッファのブロック番号を表す読み出しブロック番号に1加算した値を、データが書き込まれているか否かを検索するブロック・データ・バッファのブロック番号を表す検索ブロック番号に設定する(但し、値が15になる場合は、検索ブロック番号を0(ゼロ)に設定する)。
【0085】
続いてCPU31は、S122にて検索ブロック番号に対応するブロックのR/Wセマフォ内の書き込み側識別情報及び状態識別情報を読み出し、この読み出した情報に基づきS123にて、検索ブロックの書き込み側が本体側(制御部23側)でそのブロックへのデータの書き込みが完了しているか否かを判断する。そして、ブロックへのデータの書き込みが完了しており書き込み側が本体側であると判断すると、S124にて、R/Wセマフォ内に書き込まれているシーケンシャル番号を読み出し、S125にて、前回のSRAMI/Fデータ読み出し処理実行時にDRAM37内に格納した読み出し用シーケンシャル番号と、R/Wセマフォ内に書き込まれているシーケンシャル番号が一致するか否か判断する。
【0086】
そして、シーケンシャル番号が一致していると判断すると、CPU31は、S126にて、この検索ブロック番号を読み出しブロック番号に設定して、その読み出しブロック番号をDRAM37内に記憶し当該処理を終了する。
一方、シーケンシャル番号が異なると判断すると、CPU31は、S127にて、検索ブロック番号が、当該処理で検索を開始したブロック番号より1少ない値である前回の処理で記憶した読み出しブロック番号に一致するか否か判断して、一致しなければ、S128にて検索ブロック番号を1加算して更新し処理をS122に戻す。一方、S127で一致していると判断すると(即ち、全ブロックの検索が完了したと判断すると)、S129にてデータが格納された読み出しブロックがないことを呼び元のタスクに通知して、処理をS140に移行する。
【0087】
S140において、CPU31は、読み出しブロック検索処理の結果に基づき、読み出しブロックがあったか否か判断する。つまり、S126の処理を経て読み出しブロック検索処理が終了したか否か判断し、S126の処理を経て処理が終了していなければ、S150にて、R/Wセマフォ領域用SRAMセマフォに解放値を書き込むことにより、R/Wセマフォ領域用SRAMセマフォを解放し、S155にて、読み込みデータバイト数をゼロとして、当該処理を終了する。
【0088】
一方、S126の処理を経て処理が終了したと判断すると、CPU31は、S160にて、読み出しブロック番号に対応するR/Wセマフォの状態識別に、”読み出し中”であることを示す値を書き込み、この後にS170にて、R/Wセマフォ領域用SRAMセマフォを解放する。
【0089】
そして、S180にて、読み出しブロック番号に対応するブロックに格納されているブロックデータ(パケット全体若しくはパケットの一部)を読み出し、これを当該処理の呼び元から指定されたDRAM37内の受信データ用一時格納バッファに書き込む。
【0090】
この後、S190にて、再びR/Wセマフォ領域用SRAMセマフォを取得して、S200にて、読み出したブロックに対応するR/Wセマフォの書き込み側識別情報、状態識別情報として、”空き”を示す値を書き込む。
そして、S210にてR/Wセマフォ領域用SRAMセマフォを解放して、S220にて、読み出し用シーケンシャル番号を1加算してこれをDRAM37内に記憶し、更に、S230にて、読み出したデータのバイト数(読み出しデータバイト数)を呼び元のタスクに通知して当該処理を終了する。
【0091】
続いて、図8は、CPU31がSRAM40のブロック・データ・バッファにパケットを書き込むために実行するSRAMI/Fデータ書き込み処理を表すフローチャートである。また、図9は、このSRAMI/Fデータ書き込み処理実行中に呼び出される空きブロック検索処理を表すフローチャートである。
【0092】
処理を実行するとまず、CPU31は、S310にて、R/Wセマフォ領域用SRAMセマフォを取得し、S320にて、図9に示す空きブロック検索処理を実行する。
空きブロック検索処理を実行すると、CPU31は、S321にて、R/Wセマフォ領域の15ブロックのR/Wセマフォに格納されている書き込み側識別情報及び状態識別情報を参照することにより、LANI/F19側の書き込み(即ち、書き込み側識別が”LAN側書き込み”)で、データが残っているブロック(即ち、状態識別が、”書き込み完了”又は”読み出し中”であるブロック)の数を求める。
【0093】
そして、この結果に基づき、データが残っているブロックが全体(全ブロック)の8割未満か否か判断し(S323)、8割以上であると判断すると、CPU31は、S324にて、呼び元のタスクに空きブロックなしとの通知を行った後に、当該処理を終了する。一方、S323にて、8割未満であると判断すると、CPU31は、続く、S325で、R/Wセマフォ領域の15ブロックのR/Wセマフォに格納されている書き込み側識別情報及び状態識別情報を順に参照することにより、参照途中で見つかった最初の空きブロックの番号を、空きブロック番号として当該処理の呼び元のタスクに通知し、この後に処理をS340に移行する。
【0094】
また、このS340において、CPU31は、空きブロック検索処理の実行結果に基づき、空きブロックがあったか否か判断し、なかったと判断した場合には、S350にて、R/Wセマフォ領域用SRAMセマフォを解放すると共に、S355にて呼び元のタスクに書き込み失敗を通知し、この後に当該処理を終了する。
【0095】
一方、空きブロックがあったと判断すると、CPU31は、続くS360にて、空きブロックに対応するR/Wセマフォに、書き込み側識別情報として”LAN側書き込み”を示す値を書き込み、状態識別情報として、”書き込み中”であることを示す値を書き込み、シーケンシャル番号として、前回までの当該処理により自身が保持している書き込み用シーケンシャル番号を書き込んだ後に、R/Wセマフォ領域用SRAMセマフォを解放する(S370)。
【0096】
また、S380にて、ブロックデータバッファの空きブロックに、現在のシーケンシャル番号と、ブロックに書き込むデータのバイト数と、呼び元から指定されたデータ(パケット全体若しくはパケットの一部)と、を書き込む。
この後、S390にて、再びR/Wセマフォ領域用SRAMセマフォを取得し、S400にて、上記データを書き込んだブロックに対応するR/Wセマフォの状態識別に、”書き込み完了”を示す値を書き込み、S410にて、R/Wセマフォ領域用SRAMセマフォを解放する。
【0097】
そして、S420にて、本体側(制御部23側)への割込要求処理を実行する。この割込要求処理を実行すると、CPU31は、第一割込要求設定領域用SRAMセマフォを取得して、第一割込要求設定領域に割込要求信号を書き込み、この後に第一割込要求設定領域用SRAMセマフォを解放して、その割込要求処理を終了する。またこの後に、CPU31は、S430にて、書き込み用シーケンシャル番号を1加算して更新する。
【0098】
次に、上記SRAMI/Fデータ読み出し処理、SRAMI/Fデータ書き込み処理を所定の手順で読み出して、SRAM40とDRAM37との間のデータ転送を行うプロトコル部に対応する各処理について説明する。
まず、図10は、CPU31が実行するプロトコル部ポーリングタスク処理を表すフローチャートである。
【0099】
この処理は、SRAM40からのデータ読み出し手順を規定する処理であり、CPU31は、上記割込要求処理に対応する制御部23側の処理により、制御部23がSRAM40内のブロック・データ・バッファにブロックデータを書き込んだことを意味する割込要求を行ってきたと判断するか、自身のインターバルタイマにより定期的なポーリング処理要求があったと判断した場合に、当該処理を実行する。
【0100】
CPU31は、プロトコル部ポーリングタスク処理を実行すると、S500にて図11に示す受信データポーリング処理を実行し、S800にて送信待ちのタスクに、処理再開の通知を行う。尚、図11はCPU31にて実行される受信データポーリング処理を表すフローチャートである。
【0101】
図11に示す受信データポーリング処理を実行すると、CPU31は、まずS510にて、SRAMI/Fデータ読み出し処理を実行することにより、SRAM40のブロック・データ・バッファの指定ブロックからブロックデータを読み出し、そのブロックデータをDRAM37内の受信データ用一時格納バッファに書き込む。続いて、CPU31は、S520にて、SRAMI/Fデータ読み出し処理において読み出したデータのバイト数(読み出しデータバイト数)がゼロであったか否かを判断し、ゼロであったと判断すると当該処理を終了する。
【0102】
一方、ゼロではないと判断すると(S520でNo)、CPU31は、読み出したブロックデータのパケットの先頭側に記載されているチャネルIDに関する情報に基づき、データを格納すべき論理チャネルの受信バッファの格納位置を割り出す(S530)。また、読み出したブロックデータ(パケット)の先頭側に記載されているパケット長に関する情報に基づき、そのパケット長を残りバイト数として設定する(S540)。
【0103】
そして、S550にて、受信データ用一時格納バッファに記憶されているブロック毎のデータ(ブロックデータ)を、割り出した受信バッファの格納位置に記憶する。また、この際、残りバイト数から、受信バッファに取り込んだブロックデータのバイト数を差し引いた値を新たな残りバイト数として記憶し、更に、次に読み出すブロックデータの格納位置を表すメモリアドレスを取得する。
【0104】
この後、CPU31は、S560にて、更新した残りバイト数がゼロであるか否か判断し、ゼロでなければ(S560でNo)、再びSRAMI/Fデータ読み出し処理により1ブロック分のデータ(ブロックデータ)を読み出す(S570)。また、S580にて、読み出しデータバイト数がゼロであるか否か判断し、ゼロであれば(即ち、SRAMI/Fデータ読み出し処理による読み出しが成功していなければ)、処理をS570に戻して、ブロックデータが読み出せるまで上記処理を繰り返す。
【0105】
そして、S580で読み出しデータバイト数がゼロでないと判断すると(即ち、SRAMI/Fデータ読み出し処理による読み出しが成功していれば)、CPU31は、処理をS550に戻して、読み出した1ブロック分のデータを前回受信バッファに格納したブロックデータに並べて格納し、残りバイト数と次にブロックデータを格納するメモリアドレスを更新する。
【0106】
またS560において残りバイト数がゼロであると判断すると(S560でYes)、CPU31は、続くS590において、パケットのチャネルIDに関する情報に基づき、チャネル・プロパティ・テーブルから、チャネルに対応するチャネルタイプを取得する。そして、S600にてチャネルタイプがSYSTEMであるか否か判断し、チャネルタイプがSYSTEMであれば、S610にて図12に示すシステムコマンド処理を実行し、この後に、処理をS510に戻して、SRAMI/Fデータ読み出し処理を実行し、上述の処理をSRAM40において、読み出すデータがなくなるまで実行する。
【0107】
一方、S600にてチャネルタイプがSYSTEMでないと判断すると、CPU31は、S620にて、チャネルタイプがCOMMANDであるか否か判断する。そして、チャネルタイプがCOMMANDであると判断すると、S630にて、該当チャネルに受信データ有りとの通知を当該チャネルを使用するタスクに対して行った後に、処理をS510に戻して、SRAMI/Fデータ読み出し処理を実行する。
【0108】
また、CPU31は、S620にてチャネルタイプがCOMMANDでもないと判断すると(即ち、チャネルタイプがDATAであると判断すると)、S640にて受信バッファに格納したパケットをバッファ管理上有効なデータとして登録する。
【0109】
そして、S650にてチャネルステート情報域に格納されている制御部23側(本体側)残りクレジット数を1減らすようにして更新し、更に、S660にて受信データ待ちをしているタスクに受信データ有りの通知を行い、この後に、処理をS510に戻して、SRAMI/Fデータ読み出し処理を実行する。
【0110】
次に、上記システムコマンド処理、及び、プロトコル部受信データ読み出し処理について説明する。
図12は、CPU31が実行するシステムコマンド処理を表すフローチャートである。この処理を実行すると、CPU31は、まずS710にて受信したパケットがオープンパケットであるか否か判断する。そして、オープンパケットであると判断すると、S711にてオープンパケット内に格納されているパケット当たりの最大データ長と、最大クレジット数とに関する情報を、該当するチャネルのチャネルステート情報域に格納して、チャネルステート情報域の情報をチャネルオープン時の状態に初期化する。そして、S713にてチャネルステート情報域にチャネルの状態を表す情報として、チャネルオープン待ち状態を示す情報を格納する。また、当該チャネルのオープンパケットの受信待ちをしているタスクがある場合に、そのタスクに処理続行を通知し(S715)、この後に当該処理を終了する。
【0111】
一方、CPU31は、S710にて受信パケットがオープンパケットではないと判断すると、続くS720にて、受信パケットがオープンリプライパケットか否か判断する。そして、受信パケットがオープンリプライパケットであると判断すると、続くS721にて、オープンリプライパケットに格納されているパケット当たり最大データ長と最大クレジット数とに関する情報を、該当するチャネルのチャネルステート情報域に格納して、チャネルステート情報域をチャネルオープン時の状態に初期化する。また、S723にて、当該チャネルのオープンリプライパケットの受信待ちをしているタスクがある場合に処理続行を通知し、この後に当該処理を終了する。
【0112】
この他、S720にて受信パケットがオープンリプライパケットではないと判断すると、CPU31は、続くS730にて受信パケットがクローズパケットであるか否か判断し、そうであるならば、S731にて、チャネルステート情報域にチャネルの状態を表す情報として、チャネルがクローズ状態であることを示す情報を格納し、当該処理を終了する。
【0113】
また、S730にて受信パケットがクローズパケットではないと判断すると、CPU31は、続くS740にて受信パケットがクレジットパケットであるか否か判断し、受信パケットがクレジットパケットであるならば、S741にて、クレジットパケットに格納されている付加クレジット数に関する情報に基づき、該当チャネルのチャネルステート情報域に格納されているクレジット数に付加クレジット数を加算する。また、S743にて、該当チャネルのクレジット付加の通知待ちをしているタスクに、クレジット付加の通知を行うことにより、そのタスクに処理続行を通知し、この後に当該処理を終了する。一方、CPU31は、受信パケットがクレジットパケットでもないと判断すると(S740でNo)、そのまま当該処理を終了する。
【0114】
次に、図13は、プロトコル部受信データ読み出し処理を表すフローチャートである。CPU31は、論理チャネルを使用するアプリケーションからの指令に基づきこの処理を実行すると、まずS810にて、指定のチャネルIDに対応する受信バッファにパケットデータがあるか否か判断する。そして、受信したパケットデータがあると判断すると、続くS820にて、アプリケーションから指定された最大読み出しバイト数と、パケットデータのバイト数との内、バイト数の小さい方を読み出しバイト数に設定する。そして、S830にて、受信バッファから読み出しバイト数分のデータを読み出して、これをアプリケーションが指定した読み出し先のバッファへ格納する。
【0115】
この後、CPU31は、S840にて、チャネルステート情報域に格納された受信バッファの格納パケット数に関する情報を更新し、S850にて、受信バッファの格納パケット数と、本体側残りクレジット数(S650を参照)の合計がクレジットパケット送信の閾値(限界クレジット数)に達しているか否か判断し、閾値に達していれば(即ち、上記合計が閾値以下であれば)、当該チャネルのクレジット付加を依頼するためのクレジットパケットを制御部23側に送信し(S860)、当該処理を終了する。尚、合計が閾値に達していなければそのまま当該処理を終了する。
【0116】
一方、CPU31は、S810で、受信データがないと判断すると、S870にて、アプリケーション側がブロッキングモードを指定しているか否か判断し、指定していなければ、そのまま当該処理を終了する。
ここで、ブロッキングモードとは、アプリケーション側が指定した処理をプロトコル部がうまく実行できなかった場合に、処理を再度実行するかどうかを切り替えるためのものであり、ブロッキングモードが指定されていると、CPU31は、再度処理を実行する
つまり、CPU31は、S870にてブロッキングモードが指定されていると判断すると、S880にて、データの受信通知(上記S660にて行われる通知)があるまで待機し、受信通知を受けると、再び処理をS810に戻して上記処理を繰り返す。
【0117】
以上、プロトコル部のデータ読み出しに関する各種処理について説明したが次に、データ書き込みに関する各種処理について説明する。
図14(a)は、チャネルタイプがDATAである論理チャネル(データチャネル)を使用可能とするためのチャネルオープン処理を表すフローチャートである。
【0118】
アプリケーションからの指令を受け、この処理を実行すると、CPU31は、まずS910にて、チャネル・プロパティ・テーブルのサーバ/クライアント情報を参照して、指定チャネルがサーバに区分されているか否か判断する。そして、サーバでないと判断すると(S910でNo)、S920にてチャネル・プロパティ・テーブルを参照して、指定チャネルのパケット当たり最大データ長と、最大クレジット数を含んだオープンパケットを作成し、S925にて、後述する送信パケット書き込み処理(図16参照)を実行して、生成したオープンパケットをSRAM40内に書き込む。
【0119】
この後、CPU31は、制御部23側から送信されてくるオープンリプライパケットの受信通知(S723による通知)があるまで待機し(S930)、オープンリプライパケットの受信通知を取得すると、指定チャネルのチャネルステート情報域内に、チャネルがオープン状態であることを示す情報を格納し(S940)、当該処理を終了する。
【0120】
一方、S910にて、指定チャネルがサーバに区分されていると判断すると、CPU31は、S950にて、チャネルステート情報域にてチャネル状態に関する情報をチェックし、既に、LANI/F19が、制御部23からオープンパケットを受信し、オープン待ち状態になっているかどうかを判断する(S713参照)。ここで、オープン待ち状態ではないと判断すると、CPU31は、オープンパケットを受信するまで待機し(S960)、チャネルオープンを受信したことを知らせる通知(S715の通知)を受けると、処理をS970に移行する。また、S950にて、既に、オープン待ち状態であると判断すると、S960の処理をスキップして、S970の処理を実行する。
【0121】
そして、CPU31は、S970において、チャネル・プロパティ・テーブルを参照して指定チャネルのパケット当たり最大データ長と、最大クレジット数に関する情報を含んだオープンリプライパケットを作成し、S975にて送信パケット書き込み処理を実行することにより、作成したパケットをSRAM40内に書き込む。
【0122】
この後、CPU31は、S980にて、指定チャネルのチャネルステート情報域にチャネル状態がオープン状態であることを示す情報を格納し、当該処理を終了する。
次に、図14(b)は、上記チャネルオープン処理によりオープン状態となった論理チャネル(データチャネル)を使用不可の状態、即ちクローズ状態にするためにCPU31が実行するチャネルクローズ処理を表したフローチャートである。
【0123】
アプリケーションからの指令により処理を実行すると、CPU31は、まずS1010にて、チャネルステート情報域を参照し、指定チャネルがクローズ状態であるかどうかを判断する。そして既にクローズ状態であると判断すると、当該処理を終了する。一方、チャネルがクローズ状態でないと判断すると、CPU31は、続くS1020にて、指定チャネルをクローズ状態にするように制御部23側に通知するためのクローズパケットを生成する。
【0124】
この後、CPU31は、S1030にて、送信パケット書き込み処理を実行することにより、生成したパケットをSRAM40上に書き込むと共に、S1040にて自己のチャネルステート情報域内にチャネルの状態がクローズ状態であることを示す情報を格納して、当該処理を終了する。
【0125】
次に、データチャネルに区分される論理チャネルがオープン状態である時に実行されるプロトコル部送信データ書き込み処理について説明する。尚、図15は、このプロトコル部送信データ書き込み処理を表すフローチャートである。
アプリケーションからの指令により処理を実行すると、CPU31は、S1110にて、アプリケーションから指定された書き込みバイト数(送信用データのバイト数)を残り書き込みバイト数として一時記憶し、更に、アプリケーションから指定された送信用データのメモリアドレスを一時記憶する。また、S1120にてアプリケーションから指定されたチャネルIDに対応する論理チャネルのパケット当たり最大データ長を、チャネルステート情報域から読み出して一時記憶する。
【0126】
この後、CPU31は、S1130にて、残り書き込みバイト数がゼロであるかどうか判断し、ゼロでなければ、続く、S1140にて残り書き込みバイト数と、対応するチャネルIDのパケット当たり最大データ長とを比較し、小さいバイト数の方を、1つのパケットに格納する送信用データのバイト数とし、S1150にて送信パケット書き込み処理を実行する。
【0127】
そして、S1160にてパケットが書き込めたかどうか判断し、書き込めていれば、S1170にて、残り書き込みバイト数からS1150にて書き込みが完了した送信用データのバイト数を引いた値を新たな残り書き込みバイト数とし、更に記憶したメモリアドレスを、次に書き込むべき送信用データのメモリアドレスに更新した後に、処理をS1130に戻す。一方、S1160にてパケットが書き込めていないと判断すると、CPU31は、続くS1180にてアプリケーションからブロッキングモードが指定されているかどうか判断し、指定されていれば、処理をS1130に戻してパケットの書き込みを再度行う。また、ブロッキングモードが指定されていなければ、S1185にて、書き込み完了バイト数として、アプリケーションから指定された書き込みバイト数から残り書き込みバイト数を引いた値を、アプリケーションに通知して、当該処理を終了する。
【0128】
また、上記のようにしてS1130に処理を戻すと、CPU31は、再び上記処理を繰り返し実行し、S1130にて残り書き込みバイト数がゼロとなった時点で、処理をS1135に移行し、書き込み完了バイト数をアプリケーションに通知して、当該処理を終了する。
【0129】
次に、上記送信パケット書き込み処理について説明する。尚、図16は、CPU31が実行する送信パケット書き込み処理を表すフローチャートである。
処理を実行するとCPU31は、まずS1210にて、パケット書き込み用セマフォを取得する。尚、このセマフォは、1パケットが複数ブロックに渡りSRAM40に書き込まれる際に、他の処理部からのパケットの書き込みによりSRAM40内におけるパケットの連続性が失われるのを防ぐためのものである。つまり、本実施例においては、送信パケット書き込み処理が複数のアプリケーションから同時に呼び出されない構成にされている。
【0130】
このセマフォを取得すると、CPU31は、続くS1220にて、チャネルステート情報域内に記憶されているLAN側(LANI/F19側)の残りクレジット数がゼロであるか否か判断する。尚、データチャネル以外の論理チャネルでは、クレジット数がNAとなっているが、当該処理では、これらの論理チャネルに関して、クレジット数を常に1に設定するように構成されている。
【0131】
ここで、LAN側残りクレジット数がゼロであると判断すると、CPU31は、続くS1230で、アプリケーションからブロッキングモードが指定されているか否か判断し、ブロッキングモードが指定されていなければ、S1210にて取得したセマフォを解放すると共に(S1235)、当該処理を読み出したタスクに書き込み済みバイト数がゼロであることを通知して(S1237)、当該処理を終了する。
【0132】
一方、S1230にてブロッキングモードが指定されていると判断すると、CPU31は、続くS1240にて、クレジット付加の通知(S743による通知)があるまで待機し、通知を受けると、処理をS1220に戻す。
また、S1220にて残りクレジットがゼロではないと判断すると、CPU31は、続くS1250にて、当該処理の呼び元が指定した送信用データ格納位置を表すメモリアドレスを取得し、更に、呼び元が指定した1つのパケットに格納する送信用データのバイト数を、残りバイト数として、一時記憶する。
【0133】
そして、S1260にて残りバイト数が504以下であるかどうかを判断する。ここで、この判断を行う理由としては、ブロックデータバッファの各ブロックが格納可能なパケットの最大バイト数は508バイトであるが、パケットの先頭部分には、図5(b)で示したように、2バイトのパケット長に関する情報を格納する領域と、1バイトのチャネルIDに関する情報を格納する領域と、1バイトの種別コードを格納するための領域と、が確保されているため、アプリケーションから取得した送信用データの最大格納バイト数が504バイトに制約されるためである。
【0134】
したがって、CPU31は、S1260にて残りバイト数が504バイトより大きいと判断すると、S1270にて、今回の書き込みバイト数を504バイトに設定し、S1260にて残りバイト数が504バイト以下であると判断すると、S1280にて、今回の書き込みバイト数をその残りバイト数に設定する。
【0135】
そして、S1290において、CPU31は、S1270若しくはS1280で設定された書き込みバイト数の送信用データを読みだして、その読み出したデータと、パケット長に関する情報と、チャネルIDに関する情報と、システムコマンドの種別コード(システムコマンドチャネルを使用するパケットのみ)と、を格納したブロックデータ(パケット全体若しくはパケットの一部)を生成し、これをDRAM37内に確保された書込用バッファに格納する。
【0136】
この後、CPU31は、S1300にて、上述のSRAMI/Fデータ書き込み処理を実行し、生成したブロックデータをDRAM37内からSRAM40内に転送し、S1310にて、SRAMI/Fデータ書き込み処理によるデータの書き込みが成功したかどうかを判断する。
【0137】
ここで、CPU31は、ブロックデータが書き込めなかったと判断すると、プロトコル部ポーリングタスク処理(S800)により書き込み再開の通知があるまで待機し(S1320)、通知があると再び処理をS1300に戻して、SRAMI/Fデータ書き込み処理を実行し、S1310にて、ブロックデータの書き込みが成功したかどうかを判断する。
【0138】
そして、書き込みが成功したと判断すると、続くS1330にて、次に書き込むべき送信用データのメモリアドレスを更新し、更に残りバイト数にS1300にて書き込めた送信用データのバイト数を引いた値を新たな残りバイト数として更新する。
【0139】
この後、CPU31は、S1340にて、残りバイト数がゼロであるか否か判断し、ゼロでなければ、S1350にて、残りバイト数は508バイト以下であるか否かを判断する。そして、残りバイト数が508バイトより大きいと判断すると、S1360にて、今回の書き込みバイト数を508バイトに設定し、残りバイト数が508バイト以下であると判断すると、S1370にて残りバイト数を今回の書き込みバイト数に設定する。
【0140】
また、S1380にて、そのデータを格納したブロックデータ(パケット後半部分)を作成して、これをDRAM37内の書込用バッファに書き込み、処理をS1300に戻してSRAMI/Fデータ書き込み処理を実行することにより、その作成したパケットをSRAM40上に書き込む。
【0141】
一方、S1340にて、残りバイト数がゼロであると判断すると、CPU31は、S1390にて、当該チャネルのクレジットタイプがNAであるかどうか判断し、NAでないと判断すると、S1400にて、チャネルステート情報域に格納されているLAN側残りクレジット数を1減らして処理をS1410に移行し、NAであると判断すると、そのS1400の処理をスキップして処理をS1410に移行する。
【0142】
また、S1410に移行すると、CPU31は、S1210にて取得したセマフォを解放すると共に、S1420にて、呼び元のタスクに書き込み済みバイト数を通知して当該処理を終了する。
次に、アプリケーション群の一つとして動作する本体側MIBアクセス関数を呼び出すためのプロトコル部の本体側MIBアクセス関数呼び出し処理と、LAN側MIBアクセス関数を呼び出すためのプロトコル部のLAN側MIBアクセス関数呼び出し処理とについて説明する。尚、図17(a)は、本体側MIBアクセス関数呼び出し処理を表すフローチャートである。
【0143】
当該実施例においては、制御部23に、制御部23側のMIB内のオブジェクトにアクセスするためのMIBアクセス関数(以下、「OBJACC関数」とも表現する)が用意されており、これを以下に説明するようにしてLANI/F19側から呼び出し、MIBにアクセスする。
【0144】
CPU31は、他のタスクから当該処理実行の指令が入力されると、処理を実行してまずS1510にて、本体側OBJACC関数読みだしのためのセマフォを取得する。尚、このセマフォは、本体側(制御部23)からのOBJACC関数呼び出しと、LANI/F19側からのOBJACC関数呼び出しが同時に行われないようにして、オブジェクトが同時操作されてしまうのを防止するためのものである。
【0145】
続いてCPU31は、S1520にて、当該処理を呼び出したタスクから取得したパラメータに基づき、OBJACC関数呼び出し用のパケットを生成して、これをDRAM37内の書込用バッファに格納し、S1530にて上記送信パケット書き込み処理を実行して、パケットをSRAM40内に書き込む。
【0146】
この後、制御部23からの応答として、本体側MIBアクセスチャネルの受信バッファへのデータ格納通知(即ち、S630における受信通知)があるまで待機し、通知があると、S1550にて、受信バッファからパケット形式のデータを読み出して、本体側でOBJACC関数を呼び出したことによる戻り値を、呼び元のタスクに返すためのパラメータに変換して、そのパラメータを呼び元のタスクに受け渡し、更にS1510にて取得したセマフォを解放して(S1560)、当該処理を終了する。
【0147】
続いて、図17(b)は、LAN側MIBアクセス関数呼び出し処理を表すフローチャートである。
CPU31は、制御部23側からLAN側MIBアクセスチャネルの受信バッファにデータが格納されたことを示す通知(S630における通知)があると、当該処理を実行し、まずS1610にて、LAN側OBJACC関数呼び出しのためのセマフォを取得する。尚、このセマフォは、本体側OBJACC関数呼び出し用のセマフォと同様の目的で使用されるものである。
【0148】
続いてS1620において、CPU31は、LAN側MIBアクセスチャネルの受信バッファからパケットを取得し、これをLANI/F19側でOBJACC関数を呼び出すためのパラメータに変換し、S1630にて、OBJACC関数を呼び出す。
【0149】
この後、CPU31は、S1640にて、OBJACC関数を呼び出した結果として取得した関数からの戻り値を含むパケットを生成し、これを書込用バッファに格納する。また、S1610にて取得したセマフォを解放し(S1650)、S1660にて上記送信パケット書き込み処理を実行して、当該処理を終了する。
【0150】
次に、アプリケーション群として動作するEEPROMアクセス処理を呼び出すためのプロトコル部のEEPROMアクセス呼び出し処理と、プリンタステータス通知処理を呼び出すためのプロトコル部のプリンタステータス通知呼び出し処理について説明する。
【0151】
図18(a)は、EEPROMアクセス呼び出し処理を表すフローチャートである。
EEPROMアクセスチャネルの受信バッファへデータが格納されたことを示す通知(S630における通知)があると、CPU31は、当該処理を実行し、まずS1710にて、EEPROMアクセス処理を呼び出すためのセマフォを取得する。ここで、EEPROM35は、同時アクセスを許容しないハードウェア構成にされており、このセマフォは、本体側からのEEPROMアクセスと、LANI/F19内でのEEPROMアクセスとを排他制御することを目的としている。
【0152】
このセマフォを取得すると、CPU31は、S1720にて、EEPROMアクセスチャネルの受信バッファからパケットを読みだし、これに基づいて、EEPROMアクセス処理呼び出し用のパラメータを生成し、このパラメータに基づき、S1730にてEEPROMアクセス処理を呼び出す。そして、このEEPROMアクセス処理により、制御部23側から指示されたEEPROM35内のデータを操作し、S1740にて、EEPROMアクセス処理を実行することにより得た戻り値を、EEPROMアクセス用に定められたパケットに格納して、これをDRAM37内の書込用バッファに格納する。
【0153】
この後、CPU31は、S1710にて取得したセマフォを解放し(S1750)、更に、送信パケット書き込み処理を実行して、上記生成したパケットをSRAM40内に書き込み、当該処理を終了する。
続いて図18(b)は、プリンタステータス通知呼び出し処理を表すフローチャートである。
【0154】
プリンタステータス通知チャネルの受信バッファへデータが格納されたことを示す通知(S630における通知)があると、CPU31は、当該処理を実行し、まずS1810にて、プリンタステータス通知チャネルの受信バッファから、パケットを読み出し、これに基づいて、プリンタステータス通知処理呼び出し用のパラメータを作成して、S1820にて、プリンタステータス通知処理を呼び出す。そして、制御部23から指示された宛先にプリンタステータス通知用のメールを作成して、これをLAN上に送出する。
【0155】
またプリンタステータス通知処理が終了すると、CPU31は、S1830にて、プリンタステータス通知処理が完了したことを示す応答パケットを作成し、これをDRAM37内の書込用バッファに格納する。そして、S1840にて送信パケット書き込み処理を実行して、応答パケットをSRAM40上に書き込み、当該処理を終了する。
【0156】
以上、本実施例のファクシミリ10について説明したが、当該ファクシミリ10においては、プロトコル部に対応する各処理が、アプリケーションから取得した送信用データとチャネルIDに関する情報を含むパケットを生成し、これを上記手法にて、受信側がSRAM40より取り込み可能な範囲で、SRAM40上に書き込み、更に、書き込みが完了すると、書き込みを行ったことを受信側に通知して、受信側に直ぐさまSRAM40からパケットを取り込ませる構成にされているため、結果として、本実施例のファクシミリ10によれば、SRAM40にパケットが長時間滞留することにより以後の通信が滞ってしまうなどの問題を十分に抑制することができる。
【0157】
また特に、システムコマンドチャネルにおいては、プロトコル部が、すぐさま受信したコマンドを実行するため、長時間システムコマンドが格納されたパケットがSRAM40上に滞留することなく、結果として、送受信パケットの通信制御を円滑に行うことができる。
【0158】
また、システムコマンドチャネル及びコマンドチャネルは、パケットを1つしか受信できない構成にされているため、明示的にフロー制御しなくても、受信したパケットの順に、コマンドに対応した処理をCPUに実行させることができる。
【0159】
この他、プロトコル部は、データチャネルのオープン時に、SRAM40より受信バッファに取り込み可能な最大パケット数としての最大クレジット数を通知し、以後、送信側のクレジット数と受信バッファの格納パケット数との合計が閾値(限界クレジット数)以下になる度に、クレジットパケットを生成して、このパケットを通信相手側に送信する構成にされているため、制御部23及びLANI/F19間でやり取りしなければいけない通信制御のためのデータ通信量を最低限に抑えつつ、送信側でクレジット数がゼロになることによってデータ送信が一時的に停止状態になるのを抑制することができ、結果として、効率よく通信を行うことができる。
【0160】
尚、本発明の第一チャネルは、システムコマンドチャネルに相当し、第二チャネルはコマンドチャネルに相当し、第三チャネルは、データチャネルに相当する。
また、本発明のデータ取込手段は、本実施例のSRAMI/Fデータ読み出し処理、プロトコル部ポーリングタスク処理、受信データポーリング処理に相当する。
【0161】
この他、本発明のデータ受渡手段は、本実施例の受信データポーリング処理にてシステムコマンド処理(S610)を呼び出す動作、プロトコル部受信データ読み出し処理のS830にて受信バッファ内のデータをアプリケーション指定の読み出し先バッファへ転送する動作、上記本体側MIBアクセス関数呼び出し処理、LAN側MIBアクセス関数呼び出し処理、EEPROMアクセス呼び出し処理、及び、プリンタステータス呼び出し処理にて、対応するコマンドチャネルを使用するアプリケーションを呼び出す動作、にて実現される。
【0162】
尚、本実施例の受信データポーリング処理では、コマンドチャネル、データチャネルにより送信されてきたパケットを受信すると、CPU31が受信データ待ちのタスクに受信データがあることを通知して、そのタスクに受信バッファのデータを処理させ、システムコマンドチャネルにより送信されてきたパケットを受信すると、CPU31が直接システムコマンド処理を呼び出して実行するようにされているが、後者の動作は、本発明におけるデータ受渡手段がパケットに含まれるコマンドに従った処理を実行する動作に相当する。
【0163】
また、データ送出手段は、本実施例のSRAMI/Fデータ書き込み処理に相当し、通信制御手段は、プロトコル部に対応する各処理(プロトコル部送信データ書き込み処理、送信パケット書き込み処理など)に相当する。
具体的に、通信制御手段が、外部容量情報を外部のプロセッサから取得する動作は、LANI/F19及び制御部23双方が、チャネルオープン時に通信相手からオープンパケット若しくはオープンリプレイパケットに含まれるパケット当たり最大データ長、最大クレジット数に関する情報を取得し、更に所定期間毎に、クレジットパケットに含まれるクレジット数付加の情報を取得する動作に相当する。
【0164】
【0165】
【0166】
この他、データ送出手段が第三チャネルにてパケットを送信する場合に、通信制御手段が、外部容量情報に基づき、データ送出手段を制御して、データ送出手段に、パケット数及びパケット長の範囲内でパケットを共有メモリに書き込ませる動作は、CPU31が送信パケット書き込み処理のS1220にて残りクレジット数がゼロであるかどうか判断し、残りクレジット数がゼロであれば、クレジット付加の通知があるまで待機する動作に相当する。
【0167】
また、受信容量通知手段の初期容量通知手段は、CPU31がチャネルオープン処理を実行して、初期データ容量としてのパケット当たり最大データ長及び最大クレジット数を格納したオープンパケット又はオープンリプライパケットを本体側に送信する動作にて実現され、追加容量通知手段は、CPU31がデータチャネルでパケットを受信した場合に、プロトコル部受信データ読み出し処理を実行して、クレジット付加を通知するクレジットパケットを生成し、本体側に送信する動作にて実現される。
【0168】
以上、本発明の実施例について説明したが、本発明の通信装置は、上記実施例に限定されるものではなく、種々の態様を採ることができる。
例えば、本実施例では、パケット単位でカウントされるクレジット数で送信側のデータ送出量を調節するようにしたが、クレジット数の代わりに受信側で受信バッファの空きバイト数を所定期間毎に送信側に送信するようにしてもよい。このようにすると、通信制御方法が複雑化するが、より詳細に、送信側のデータ送出量を調節することができる。
【図面の簡単な説明】
【図1】 本実施例のファクシミリ10の構成を表すブロック図である。
【図2】 LANI/F19の構成を表すブロック図である。
【図3】 SRAM40内の構成を表す説明図である。
【図4】 データ送受信に係わる各処理と、データの受渡態様とを機能的に表した説明図である。
【図5】 チャネル・プロパティ・テーブルの構成を表す説明図(図5(a))と、SRAM40内に格納されるパケットのデータ構成を表す説明図(図5(b))である。
【図6】 SRAMI/Fデータ読み出し処理を表すフローチャートである。
【図7】 読み出しブロック検索処理を表すフローチャートである。
【図8】 SRAMI/Fデータ書き込み処理を表すフローチャートである。
【図9】 空きブロック検索処理を表すフローチャートである。
【図10】 プロトコル部ポーリングタスク処理を表すフローチャートである。
【図11】 受信データポーリング処理を表すフローチャートである。
【図12】 システムコマンド処理を表すフローチャートである。
【図13】 プロトコル部受信データ読み出し処理を表すフローチャートである。
【図14】 チャネルオープン処理を表すフローチャート(図14(a))と、チャネルクローズ処理を表すフローチャート(図14(b))である。
【図15】 プロトコル部送信データ書き込み処理を表すフローチャートである。
【図16】 送信パケット書き込み処理を表すフローチャートである。
【図17】 本体側MIBアクセス関数呼び出し処理を表すフローチャート(図17(a))と、LAN側MIBアクセス関数呼び出し処理を表すフローチャート(図17(b))である。
【図18】 EEPROMアクセス呼び出し処理を表すフローチャート(図18(a))と、プリンタステータス通知呼び出し処理を表すフローチャート(図18(b))である。
【符号の説明】
10…ファクシミリ、19…LANI/F、23…制御部、25,31…CPU、29,37…DRAM、29a,37a…受信バッファ、27,33…ROM、35…EEPROM、40…デュアルポートSRAM
[0001]
BACKGROUND OF THE INVENTION
  The present invention relates to a communication apparatus that performs data communication using a plurality of logical channels between a self task that operates on its own processor and an external task that operates on an external processor via a shared memory.
[0002]
[Prior art]
  2. Description of the Related Art Conventionally, LAN (local area network) cards incorporated in personal computers, multifunctional facsimiles, and the like are known as communication devices.
[0003]
  This type of LAN card has a shared memory accessible from the CPU built in itself and the CPU built in the multifunctional facsimile main body, etc., and writes communication data received from the LAN to the shared memory, The communication data written in the shared memory is read from the multi-function facsimile main body or the like and sent out on the LAN.
[0004]
  On the other hand, the multifunctional facsimile main body reads the communication data written in the shared memory from the LAN card side by the built-in CPU and writes it to the built-in memory on the main body side, or the communication data taken out from the built-in memory to the shared memory It is configured to write.
[0005]
  In addition, the conventional communication apparatus performs communication control using a plurality of logical channels that can be operated simultaneously in order to enable multiplex communication via the shared memory.
[0006]
[Problems to be solved by the invention]
  However, the conventional communication apparatus has a problem in that an individual logical channel control method must be designated by an application using the logical channel.
[0007]
  In other words, in the communication method using the shared memory, if the transmission side of the device as a whole cannot properly adjust the number of bytes of communication data written to the shared memory and the number of bytes of communication data read from the shared memory by the receiving side, There is a problem that communication data stays in the memory and subsequent data transmission / reception is delayed. Conventionally, when multiple logical channels operate simultaneously, each logical channel must be Since it has to be controlled individually, it is very difficult to negotiate a communication control method in the application so as to solve such a problem.
[0008]
  The present invention has been made in view of these problems, and provides a communication device that can easily communicate with an external processor so that data does not stay in the shared memory for a long time. With the goal.
[0009]
[Means for Solving the Problems]
  Claim 1 made to achieve this object.InventionA plurality of logical channels are set between a self-task that operates on its own processor and an external task that operates on an external processor via its own processor and a shared memory accessible from the external processor. Data communication usingA communication device,External taskWritten to shared memory by an external processorReceive buffer for storing data for each logical channelWith.
[0010]
  In addition, the communication device includes data fetching means and data delivery means,From the processorContains information about channel IDdataIs written to the shared memory, the data fetching meansdataFrom the shared memory,Data concernedBased on the channel ID information inThe dataWrite to the receive buffer of the corresponding logical channel, by data capture meansAbove dataWhen the data writing is completed, the data is stored in the reception buffer in the self task that uses the logical channel corresponding to the reception buffer.dataIt is configured to deliver.
[0011]
  In addition, the communication deviceA configuration in which reception capacity notification means is provided, and the reception capacity notification means notifies the external processor of self-capacity information regarding the data capacity of the logical channel that can be stored in the reception buffer for each of the plurality of logical channels. Has been.
Furthermore, this communication deviceData transmission means and communication control means are provided, and external tasks can be taken from the shared memory by the communication control means.Per logical channelExternal capacity information about data capacity from an external processorGet thisBased on the external capacity information, the data sending means is controlled so that the external taskdataThe data transmission means includes the data for transmission generated by the self task and the information on the channel ID within a range in which data can be captured from the shared memorydataAre written in the shared memory.
[0012]
  According to this communication apparatus, the data transmission means is provided for each logical channel by the communication control means.On shared memorydataWrite by external task on receiving sidedataCan be limited to a range that can be captured from the shared memory, so that multiple logical channels operate simultaneously.Each stateOn logical channelsdataWrite amountManage properlycan do.
[0013]
  Therefore, at least from the communication device sidedataWrite to shared memory for a long timedataCan be kept from being stored,Using multiple logical channelsCommunication can be efficiently performed with an external processor. Also, the communication control means,like thisSince the communication control is integrated, it is not necessary to specify the communication control method of each logical channel in the task executed by the processor when executing the application, and the interface for accessing the memory device on the application side can be simplified. it can.
[0014]
  Further, according to the present invention, an external device including an external processor is configured to write data into the shared memory and fetch data from the shared memory in the same procedure as the communication device of the present invention. (Ie, by configuring the external device to have the same configuration as the communication device of the present invention), it is possible to prevent data from being stored in the shared memory for a long time due to data writing from the communication device side. Instead, data can be prevented from staying in the shared memory for a long time by writing data to the shared memory by an external processor. As a result, according to the present invention, it is possible to efficiently perform bidirectional communication between the external task and the self task.
[0015]
The reception capacity notifying means causes the data sending means to write the self-capacity information to the shared memory, thereby notifying the self-capacity information to the external processor via the shared memory, and the communication control means from the external processor. By acquiring the external capacity information written in the shared memory via the data delivery means, the external capacity information can be acquired from the external processor via the shared memory.
[0016]
  In addition,The reception capacity notification means is preferably configured as described in claim 3.
  The reception capacity notifying means of the communication device according to claim 3 comprises an initial capacity notifying means and an additional capacity notifying means, and when the self task starts communication with an external task, the initial capacity notifying means is provided. In the notification means,Corresponds to the logical channel used in the communicationReceive bufferIn caseInitial data capacity,Notify the external processor and then notify the additional capacity notification meansThe data delivery means sends the data stored in the reception buffer corresponding to the logical channel.It is configured to notify an external processor of an additional data capacity that can be newly stored in the reception buffer by passing it to its own task.
[0017]
  In this communication device,As self-capacity information, after the initial data capacity is notified to the external processor, the additional data capacity can be notified to the external processor every predetermined period.Notification operation amountCan be sufficiently suppressed. As a result, according to the communication device of the present invention (Claim 3),Hardware resourcesBy effectively utilizing this, bidirectional communication can be smoothly performed between an external task and a self-task.
[0018]
  In addition, data communication for each logical channel performed with an external task is an operation for writing data including information related to a channel ID configured by a packet to the shared memory, and a packet written to the shared memory by an external processor. The initial capacity notification means and the additional capacity notification means may be configured as follows.
That is, as described in claim 4, the initial capacity notification means sets the maximum number of packets that can be stored in the reception buffer corresponding to the logical channel used for communication and the packet length as an initial data capacity to an external processor. The additional capacity notification means notifies the additional data capacity of the packet stored in the reception buffer corresponding to the logical channel, and the data delivery means passes the packet to the own task so that the packet can be newly stored in the reception buffer. The number may be notified to an external processor.
[0019]
  Like thisOutsideThe amount of packets written to the shared memory can be controlled on a packet-by-packet basis, so that the configuration related to communication control of an external processor can be simplified.
[0020]
  In the communication apparatus, the reception capacity notifying unit is based on the number of packets stored in the reception buffer by the data capturing unit from the shared memory and the number of packets that can be stored (captured) in the reception buffer of the apparatus. It is preferable that the additional data capacity is notified by the additional capacity notification means at a predetermined opportunity. This is convenient because the additional data capacity can be efficiently notified to an external processor.
[0021]
  In addition, the communication device (Claim 1In claim 4), as described in claim 5, each of the logical channels is any one of the first channel, the second channel, and the third channel.Channel typeIt is preferable to change the communication control method of each logical channel by the communication control means.
[0022]
  In the communication device according to claim 5, between the external task and the self taskIncluding commands that command execution of processing necessary for communication controlThe logical channel for sending and receivingData excluding the above command,A logical channel for transmitting / receiving data that can be configured in a single packet between an external task and a self task is divided into second channels.
[0023]
  Also,Data excluding the above command,The logical channel for transmitting / receiving data for transmission composed of multiple packets between the external task and the self task is divided into the third channel, and the third channelLogical channels divided intoThe reception buffer is configured to store a plurality of packets.
In addition, when the communication control unit causes the data transmission unit to write a packet including information on the channel ID of the logical channel divided into the third channel into the shared memory, the communication control unit provides the external capacity information about the logical channel. It is obtained from an external processor and is configured to control the data transmission means based on this external capacity information.
[0024]
  That meansthisIn the communication apparatus, a third channel for transmitting and receiving data for transmission of a plurality of packets via a shared memory is a method for acquiring external capacity information from an external processor and performing communication control by the communication control means based on the external capacity informationOnlyBy applyingAcquisition of external capacity informationIs reduced to the essential amount. Therefore, according to this communication device,When transferring external capacity information via shared memory, etc.By effectively utilizing the limited memory resources on the shared memory, it is possible to smoothly communicate with external tasks.
[0025]
  Here, further, if the reception buffer for each logical channel belonging to the first channel or the second channel is configured to store only one packet, the packet is received without explicit flow control. In turn, the packet can be passed to the self-task,For example, the commands using the first channel can be processed in the order in which they are transmitted from the transmission source.
[0026]
  In addition, the communication device according to claim 5 isAs described in claim 6, when a packet including information on the channel ID of the logical channel divided into the first channel is written in the reception buffer, the command included in the packet is received by the data delivery means. When a packet including information on the channel ID of the logical channel divided into either the second channel or the third channel is written in the reception buffer, the data delivery means The packet may be transferred to a self-task that uses a logical channel, so that the self-task executes a process corresponding to the packet.
[0027]
  According to this communication apparatus, as a result of being able to execute the command quickly, communication control can be performed smoothly.
[0028]
  Further, in the communication device according to claim 7, when the communication control unit causes the data transmission unit to write a packet including information on the channel ID of the logical channel divided into the third channel into the shared memory, The external capacity information is the number of packets that can be fetched from the shared memory by the external task in the logical channel and the packet length.And acquiring the data, and controlling the data transmission means so that the data transmission means writes the packet to the shared memory within the range of the number of packets and the packet length.Is.
[0029]
  In the communication apparatus having such a configuration, the communication control unit may be configured to control the amount of packets written to the shared memory of the data transmission unit in units of packets. In the case where the communication control means is operated as a self task by the CPU, the processing load on the CPU for communication control can be suppressed. That is, according to the communication apparatus of the present invention, the data transmission means can be controlled efficiently.
[0030]
  The invention according to claim 8 is the first and second processing execution devices including a processor, and the first processing execution device and the second processing that are accessible from the first and second processing execution devices. A shared memory interposed between the execution device and a task operating on the processor of the first processing execution device and a task operating on the processor of the second processing execution device via the shared memory In the communication system that performs data communication using a plurality of logical channels, the first processing execution device and the second processing execution device are configured as follows.
That is, the first process execution device includes a reception buffer for storing the data written in the shared memory from the second process execution device for each logical channel, and information on the channel ID from the second process execution device. When data is written to the shared memory, the data is read from the shared memory, and based on the information about the channel ID in the data, the data fetching means for writing the data to the reception buffer of the corresponding logical channel, When the means writes data into the reception buffer, the data delivery means delivers the data stored in the reception buffer to the task that operates in the processor of the own device and uses the logical channel corresponding to the reception buffer. For each of the plurality of logical channels, the logical channel data that can be stored in the reception buffer is stored. The reception capacity information about the data volume comprises a receiving capacity notifying means for notifying the second process execution device.
[0031]
In addition, the second processing execution device includes data sending means for writing data including transmission data generated by a task operating in the processor of the own device and information relating to the channel ID to the shared memory, Receive capacity information is acquired from the processing execution device, and based on this reception capacity information, the data sending means is controlled, and the data is sent to the data sending means within a range in which the first processing execution device can fetch data from the shared memory Communication control means for writing to the shared memory. According to this communication system, for the same reason as in claim 1, the amount of data written in each logical channel can be managed appropriately, and a plurality of logical channels can be established between the first and second processing execution devices. Can be used for efficient communication.
[0032]
DETAILED DESCRIPTION OF THE INVENTION
  FIG. 1 is a block diagram showing the configuration of a facsimile machine 10 to which the present invention is applied.
  As shown in FIG. 1, the facsimile 10 of the present embodiment mainly includes a reading unit 11, a printing unit 13, a user interface (I / F) 15, a telephone line connection unit 17, a LAN interface (I / F). F) 19, a USB interface (I / F) 21, and a control unit 23, and image data acquired via the reading unit 11 and the LAN I / F 19 is transferred to an external facsimile via a public telephone network. In addition to the original fax function to be transmitted, a copy function that duplicates and prints an image on paper, a printer function that prints image data transmitted from an external device such as a personal computer via a LAN (local area network), etc. It has.
[0033]
  More specifically, the reading unit 11 reads an image composed of characters, figures, and the like printed on a paper surface by irradiating light and converts the image into an electrical signal, and functions as a so-called scanner. In particular, the reading unit 11 includes a paper feeding mechanism for continuously reading images from a plurality of papers. The reading unit 11 operates, for example, when the user uses the facsimile function of the facsimile 10 of the present embodiment or when using the copy function, and transmits image data read by the operation to the control unit 23. .
[0034]
  Subsequently, the printing unit 13 includes a paper feed and paper discharge mechanism, and includes image data acquired from the reading unit 11, image data transmitted from an external facsimile via the telephone line connection unit 17, and a LAN I / F 19. For example, an image or text is printed on a sheet based on print data transmitted from an external personal computer or the like. In particular, the printing unit 13 in the present embodiment is configured to be able to perform photo printing and the like, and further includes a paper feed mechanism for continuously printing images and the like on a paper surface.
[0035]
  The user I / F 15 includes a display unit 15a including a liquid crystal display and an operation unit 15b including a key switch. For example, a command corresponding to a user's external operation is controlled by the operation unit 15b. A message or the like input to the unit 23 or transmitted from the control unit 23 is displayed on the display unit 15a.
[0036]
  Subsequently, the telephone line connection unit 17 is for connecting the facsimile 10 to the public telephone line network. That is, for example, the telephone line connection unit 17 connects the facsimile 10 to an external facsimile serving as a fax destination via a public telephone line network based on an input signal from the control unit 23, and the reading unit 11 uses the paper surface. The image data read from is sent to an external facsimile.
[0037]
  The LAN I / F 19 is used to connect the facsimile 10 to a LAN, and can perform bidirectional communication with an external personal computer or the like via the LAN. For example, the LAN I / F 19 acquires image data or the like from an external device (such as a personal computer) by a communication method such as TCP / IP or IPX / SPX, and inputs this to the control unit 23 or from the control unit 23. Based on the command, the operating state of the facsimile 10 is notified to an external device (such as a personal computer).
[0038]
  In addition, the USB (Universal Serial Bus) I / F 21 connects an external device such as a personal computer to the external device by a user's external operation, and communicates with the external device, whereby the personal computer and the facsimile are connected. For data communication between the two. The USB I / F 21 is basically used for the same purpose as the LAN I / F 19, but is used particularly when a personal computer or the like that cannot be connected to the LAN is connected to the facsimile 10.
[0039]
  The control unit 23 is for overall control of each unit in the facsimile 10, and includes a CPU 25, a ROM 27 (for example, a flash memory) that can be accessed from the CPU 25 and stores programs, and various types of programs necessary for the program operation. A DRAM 29 that functions as a work area for storing data and the like are provided.
[0040]
  Here, detailed configurations of the control unit 23 and the LAN I / F 19 will be described with reference to FIG. FIG. 2 is a block diagram showing a detailed configuration of the control unit 23 and the LAN I / F 19. FIG. 3 is an explanatory diagram showing the configuration of a dual port memory area and an SRAM semaphore area of a dual port SRAM 40 (Dual-Port SRAM) as a shared memory.
[0041]
  The LAN I / F 19 mainly includes a CPU 31, a ROM 33 for storing a program operating on the CPU 31, an auxiliary storage EEPROM 35, and a DRAM 37 used by the program operating on the CPU for a purpose such as a work area. In order to relay data when communication is performed between the control unit 23 and the LAN I / F 19 with the network control device 39 for performing media access control (MAC) by connecting the LAN I / F to an external LAN. Dual port SRAM 40 (hereinafter simply referred to as “SRAM”), and the CPU 31 is connected to all the devices 33 to 40 described above.
[0042]
  The SRAM 40 is a memory device having two input / output control mechanisms, and is connected to a bus connected to the CPU 25 on the control unit 23 side and a bus connected to the CPU 31 on the LAN I / F 19 side. That is, the SRAM 40 is configured to be accessible from the CPU 25 of the control unit 23 and the CPU 31 of the LAN I / F 19.
[0043]
  Further, as shown in FIG. 3, the SRAM 40 is an SRAM semaphore for performing exclusive control on the access from the CPU 25 of the control unit 23 and the CPU 31 of the LAN I / F 19 as well as the dual port memory area functioning as a dual port memory. Area. FIG. 3 is an explanatory diagram showing the configuration of the dual port SRAM 40.
[0044]
  The dual port memory area includes a block data buffer, an Urgent command area, an R / W semaphore area, a first interrupt request setting area, a second interrupt request setting area, and other reserved areas (not shown). Z)).
  The block data buffer temporarily stores packets including transmission data transmitted from the transmission side (control unit 23 or LAN I / F 19) when communication is performed between the control unit 23 and the LAN I / F 19. This is a data buffer area for delivery to the receiving side (LAN I / F 19 or control unit 23). In the present embodiment, an area of 15 blocks divided by 512 bytes per block is secured. The block data buffer stores each transmitted packet across one block or a plurality of blocks (details will be described later).
[0045]
  Subsequently, the Urgent command area is an area for inputting a special command such as a power reset request from the LAN I / F 19 side to the facsimile 10 main body. This Urgent command area is not used in normal data communication, and is divided into an area for writing commands from the LAN I / F 19 and an area for writing commands from the control unit 23 side. ing.
[0046]
  The R / W semaphore area exclusively controls access to each block of the block data buffer partitioned into the 15 blocks, and further for reading in the order in which data is written in each block. There are 15 R / W semaphores corresponding to 15 blocks of the block data buffer.
[0047]
  Each R / W semaphore stores a 2-bit write-side identification area for storing write-side identification information for identifying the write side of the corresponding block, and state identification information indicating the data write or read status of the corresponding block. 14-bit status identification area and the transmission side (LAN I / F 19 or control unit 23) counts every time data is written to the block data buffer after the first write after power-on is set to zero. ) Is a 16-bit (2 byte) sequential number area for storing the number as a sequential number representing the writing order of block data.
[0048]
  In the write side identification area, “free” information indicating that the corresponding block is empty (that is, no data is stored in the corresponding block) is stored in the corresponding block as write side identification information. Data stored in the corresponding block is written from the LAN I / F 19 side, indicating that the stored data is data written from the control unit 23 side (in other words, the facsimile main body side). One piece of “LAN side write” information indicating data is stored.
[0049]
  In the status identification area, as status identification information, “vacant” information indicating that the corresponding block is empty, “writing” information indicating that data is being written to the corresponding block, and data writing Is stored, and “reading complete” information indicating that data is being read from the corresponding block is stored.
[0050]
  In addition, the first interrupt request setting area is an area for storing an interrupt request signal from the LAN I / F 19 to the control unit 23 side (main body side). That is, for example, when the LAN I / F 19 sets an interrupt request signal by writing predetermined data in the first interrupt request setting area, the control unit 23 responds to the interrupt request by reading the data in this area. Then, the interrupt request signal is cleared. The second interrupt request setting area is an area for storing an interrupt request signal from the control unit 23 to the LAN I / F 19 side.
[0051]
  The SRAM semaphore area is an area reserved for realizing a semaphore function for performing exclusive control on access to the SRAM 40. The SRAM semaphore for the R / W semaphore area and the Urgent command area SRAM semaphores, a first interrupt request setting area SRAM semaphore, a second interrupt request setting area SRAM semaphore, and other reserved areas (not shown).
[0052]
  Each SRAM semaphore is written with a value at the time of SRAM semaphore acquisition (hereinafter referred to as “acquired value”) from one side (control unit 23 or LAN I / F 19). , “Release value”), and unless the release value is input from the side where the SRAM semaphore acquisition value is written, the SRAM semaphore acquisition value cannot be written from the other side (that is, the SRAM semaphore is not changed). It cannot be obtained).
[0053]
  More specifically, the SRAM semaphore for the R / W semaphore area is a semaphore for exclusive control of access to the R / W semaphore area. In the facsimile 10 of this embodiment, the SRAM I / F unit described later controls the semaphore. Of the unit 23 and the LAN I / F 19, only the side that has acquired the SRAM semaphore can access the R / W semaphore area.
[0054]
  The Urgent command area SRAM semaphore is a semaphore for exclusive control of access to the Urgent command area from the control unit 23 and the LAN I / F 19.
  In addition, the SRAM interrupt semaphore for the first interrupt request setting area is a semaphore for exclusive control of access to the first interrupt request setting area, and the SRAM semaphore for the second interrupt request setting area is the second interrupt request. This is a semaphore for exclusive control of access to the setting area.
[0055]
  Next, FIG. 4 is a functional diagram showing a data communication method (data delivery method) between each task operated by the CPU 25 of the control unit 23 and each task operated by the CPU 31 of the LAN I / F 19.
  In the control unit 23, various programs corresponding to application groups and protocol units and various programs corresponding to the SRAM I / F unit are stored in the ROM 27, and the CPU 25 executes various tasks by reading them. Similarly, the CPU 31 of the LAN I / F 19 reads out the application group stored in the ROM 33, various programs corresponding to the protocol unit, and various programs corresponding to the SRAM I / F unit, and executes various tasks.
[0056]
  Here, the SRAM I / F unit accesses the SRAM 40 and sends it when communicating between a task operated by the CPU 25 of the control unit 23 and a task operated by the CPU 31 of the LAN I / F 19. This is a program group that operates in each of the CPUs 25 and 31 for writing and reading packets including trust data (details will be described later).
[0057]
  In addition, the protocol unit calls a program corresponding to the SRAM I / F unit, and a program group (in other words, the control unit 23 and the program unit) describes a procedure for writing or reading a packet on the SRAM 40 with these programs. A communication control program group for controlling communication with the LAN I / F 19).
[0058]
  That is, for example, the CPUs 25 and 31 execute various programs corresponding to the protocol unit to acquire the transmission data written by the application group on the DRAMs 29 and 37, and correspond to the SRAM I / F unit in a predetermined procedure. A data writing program (SRAM I / F data writing process described later) is executed to write data (packets) to the SRAM 40. On the other hand, a data reading program (SRAM I / F data reading process described later) of the SRAM I / F unit is periodically executed to read data (packets) written on the SRAM 40 from the transmission side, and this is read into the DRAM 29. , 37 is written to a buffer for storing received packets (that is, a receive buffer), and the received packets temporarily stored in the receive buffer are transferred to the application group (details will be described later).
[0059]
  In addition, examples of applications executed by the control unit 23 include programs for the facsimile 10 to perform a fax function, a printer function, a scanner function, a copy function, and the like.
  As shown in FIG. 4, the applications executed by the LAN I / F 19 include a POP mail reception program, an SMTP mail reception program, an SMTP mail transmission program, an HTTP daemon, a print protocol group, a main body side MIB access function, and a LAN side MIB. Examples include an access function, an EEPROM access program, and a printer status notification program.
[0060]
  More specifically, the POP mail receiving program is a program for the facsimile 10 to receive electronic mail from a mail server on the Internet. In this embodiment, the mail reception from the mail server is performed by the POP 3. For example, the facsimile 10 processes the mail received by this program by the application executed by the control unit 23 and the printing unit 13. Print. In addition, the facsimile 10 extracts image data and the like attached to the received mail on the control unit 23 side, and transmits it to the external facsimile via the telephone line connection unit 17.
[0061]
  The SMTP mail receiving program is a program for the facsimile 10 to function as a mail server. In this embodiment, the operation is based on SMTP.
  In addition, the SMTP mail transmission program is a program for the facsimile 10 to transmit an electronic mail to a mail server on the Internet. For example, the facsimile 10 uses this program to send the image data read from the reading unit 11 to the outside by attaching it to an electronic mail. In addition, the facsimile 10 attaches image data transmitted from an external facsimile connected to a public telephone line to an electronic mail and transmits it to the outside.
[0062]
  The HTTP daemon is a program for causing the facsimile 10 to function as a WEB server. For example, the LAN I / F 19 acquires data to be displayed on the WEB screen from the control unit 23 by the HTTP daemon, and transmits the data to the LAN or the Internet as HTTP format data.
[0063]
  The print protocol group is a variety of print protocols for an external device to remotely operate the facsimile 10 via the LAN or the Internet to use the print function.
  In addition, the main body side MIB access function writes setting information on the facsimile main body side to the LAN I / F 19 side by writing data to or reading data from a management information base (MIB) on the control unit 23 side managed based on SNMP. It is a function to manage from. The LAN-side MIB access function is a function for managing setting information stored in the MIB of the LAN I / F 19 from the control unit 23 side as a facsimile main body.
[0064]
  The EEPROM access program is a program for accessing the EEPROM 35 mounted on the LAN I / F 19 from the control unit 23 of the facsimile main body.
  In addition, the printer status notification program obtains the operation state of the facsimile 10 (consumed state of toner and printing paper, processing state of the print job, etc.) from the control unit 23 side, and sends an e-mail indicating the operation state based on this. This is a program for creating and transmitting this to the e-mail address of the facsimile administrator.
[0065]
  By the way, the application described above is configured to be simultaneously operable on the CPU 31 of the LAN I / F 19, and the LAN I / F 19 can perform multiplex data communication with the control unit 23 correspondingly. It has a possible configuration.
  That is, the facsimile 10 of the present embodiment is configured to be able to perform multiplex data communication using a plurality of logical channels, and the CPUs 25 and 31 execute a program corresponding to the protocol unit, thereby A packet including transmission data to be transmitted / received to / from each application and a channel ID for identifying which logical channel the transmission data corresponds to is generated. It is configured to pass to the protocol unit on the receiving side via
[0066]
  Further, in the facsimile 10 of the present embodiment, the LAN I / F 19 and the ROMs 27 and 33 of the control unit 23 are provided so that data communication can be performed on the SRAM 40 without stagnation even when a plurality of logical channels are used. The channel property table describing the operating conditions in each logical channel is stored. FIG. 5A is an explanatory diagram showing a channel property table.
[0067]
  As shown in FIG. 5A, in the facsimile 10 according to the present embodiment, as a logical channel, a task operated by a protocol unit on the control unit 23 side, a program corresponding to the SRAM I / F unit, and a protocol on the LAN I / F 19 side. System command channel for transmitting and receiving necessary data to and from the task operated by the program corresponding to the SRAM I / F unit, the POP mail receiving channel used in the POP mail receiving program, and the SMTP mail Used in the SMTP mail reception channel used in the reception program, the SMTP mail transmission channel used in the SMTP mail transmission program, the HTTP transmission / reception channel used in the HTTP daemon, and the printing protocol group. PDL data transmission / reception channel Used in the main body side MIB access channel used in the program that calls the main body side MIB access function, used in the LAN side MIB access channel used in the program that calls the LAN side MIB access function, and used in the EEPROM access program. An EEPROM access channel and a printer status notification channel used in the printer status notification program are set.
[0068]
  Information on operating conditions set for each logical channel includes channel type (CH # Type), server / client information (Svr / Cli), credit type (Cred # Type), channel ID (CH # ID), There is a maximum data length per packet (MAX # DLEN), a maximum number of credits (MAX # Cred), and a limit credit number (Limit # Cred).
[0069]
  Hereinafter, these will be described in detail, but in this description, the channel property table on the LAN I / F 19 side will be mainly described. The channel property table on the control unit 23 side has the same configuration as the channel property table on the LAN I / F 19 side.
[0070]
  The channel type is information indicating the type of logical channel, and each logical channel in this embodiment is classified into one of a system command channel (SYSTEM), a data channel (DATA), and a command channel (COMMAND).
  The system command channel is a channel for storing various system commands for operating each processing necessary for communication control in a single packet and transmitting / receiving between the control unit 23 and the LAN I / F 19, and the data channel is This is a channel for transmitting and receiving transmission data that must be divided into a plurality of packets and stored between the control unit 23 and the LAN I / F 19. Further, the command channel is a channel for storing and transmitting / receiving a command (excluding system commands) for remotely operating the receiving side (the control unit 23 or the LAN I / F 19) in a single packet.
[0071]
  As for the server / client information, the LAN I / F 19 side (the control unit 23 side in the channel property table on the control unit 23 side) requests the control unit 23 to start using the logical channel (that is, a channel open request described later). Or the LAN I / F 19 side permits the start of channel use in response to a request for start of use of the logical channel from the control unit 23 side (that is, the open channel is transmitted). This is information for identifying whether the logical channel functions as a server (which transmits an open reply packet for an open packet response described later). This server / client information is valid only for logical channels divided into data channels, and other channel types are given invalid values (NA: Not Applicable). Yes.
[0072]
  In other words, the data channel in this embodiment is in an available state (open state) by transmitting and receiving an open packet and an open reply packet in response thereto between the control unit 23 and the LAN I / F 19, and is closed. When a packet is transmitted / received, it is configured to be in an unusable state (closed state), and the LAN I / F 19 refers to this server / client information when the logical channel is a data channel, and from the application If there is a request to use a logical channel, select whether to send an open packet to the control unit 23 side or wait until an open packet is received, and open the logical channel by any method. To.
[0073]
  In order to prevent the transmission side (LAN I / F 19) from writing an unacceptable amount of packets on the SRAM 40 by the transmission side (LAN I / F 19), the protocol unit counts the number of credits and sets the data transmission amount. This is information indicating whether to perform control. Here, the number of credits is a parameter for grasping the number of receivable packets on the receiving side on the transmitting side. In the facsimile 10, the receiving side opens the maximum number of credits described later in this channel property table by channel opening. At times, it is issued to the transmission side to limit the number of transmission packets on the transmission side so that the transmission side does not write more packets than the credit number in the SRAM 40.
[0074]
  By the way, in the data transmission / reception in the system command channel and command channel in the present embodiment, since the command is stored in a single packet, packets having a data connection are not continuously transmitted / received, and credits regarding data transmission / reception Since there is no need to perform flow control using numbers, an invalid value (NA) is assigned to the credit type. On the other hand, in the data channel, because a plurality of packets are temporarily transmitted and received due to the nature of the data to be handled, it is necessary to perform flow control based on the number of credits, and a valid value (STREAM) is assigned to the credit type. Yes.
[0075]
  In addition, the channel ID is an ID number for identifying each logical channel, and the maximum data length per packet is the maximum size (number of bytes) of the data length per packet that can be taken into the reception buffer by the LAN I / F 19 side. It is information which shows. The maximum size of the data length indicates the data length when the packet having the data configuration shown in FIG. 5B does not include information on the header portion of the packet. FIG. 5B is an explanatory diagram showing the data structure of the packet when stored in the block data buffer.
[0076]
  In this embodiment, a packet is generated by the protocol unit and the packet is written in the SRAM 40 by the SRAM I / F unit. The packet generated by this protocol unit stores information on the packet length of 2 bytes. And a 1-byte area for storing a system command type code when the channel is a system command channel, and a packet header. The 4-byte information is stored in the part, and the data for transmission designated by the application is stored behind the header part.
[0077]
  For example, in a logical channel having a maximum data length of 504 bytes per packet, a packet having a maximum packet length of 508 bytes can be generated by the protocol unit. Further, in a logical channel having a maximum data length of 1012 bytes per packet, a packet having a maximum packet length of 1016 bytes can be generated by the protocol unit. In the case of a 1016-byte packet, the entire packet cannot be stored in a 512-byte block partitioned by the block data buffer in the SRAM 40 (of which 508 bytes can be stored in the packet). The F part is configured to store the first half part of the 508-byte packet including the header part and the second half part of the 508-byte packet in each block (across two blocks).
[0078]
  The maximum number of credits is information indicating the number of packets that can be stored in the reception buffer corresponding to the logical channel when the channel is open. In the facsimile 10, both the control unit 23 and the LAN I / F 19 each other when the channel is open. The maximum number of credits in the channel property table is exchanged. In this embodiment, an effective value is assigned as the maximum credit number only to the data channel.
[0079]
  In addition, the limit credit number is a value for adjusting the timing of transmitting a credit packet storing additional information of the credit number to the other party (control unit 23). In this embodiment, since the transmitting side transmits a packet within the range of the maximum credit number based on the information on the maximum credit number acquired from the receiving side, the transmitting side must add a new credit number from the receiving side. Will temporarily stop packet transmission (packet writing into the SRAM 40). Therefore, in this embodiment, the receiving side grasps the remaining credit number on the transmitting side based on the number of packets received from the transmitting side, and the total of the remaining credit number and the number of packets stored in the receiving buffer is When the number of credits is less than or equal to the limit credit number, the credit packet is transmitted to the other party (control unit 23).
[0080]
  In the present embodiment, a channel state information area (not shown) for storing the operation state of the logical channel and data required by the protocol unit when the logical channel is used is stored in each of the logical channels in the DRAMs 29 and 37. Secured every time.
  Each process executed by the CPU by a program corresponding to the SRAM I / F unit and protocol unit described below operates with reference to each information in the channel state information area, and the state of the logical channel as necessary. Is configured to write.
[0081]
  The procedure of each process performed by the CPU 31 by executing a program corresponding to the SRAM I / F unit will be described below. In the following, only the process executed by the CPU 31 of the LAN I / F 19 will be described. However, in the facsimile 10 of this embodiment, the CPU 25 of the control unit 23 is also configured to execute the same process.
[0082]
  FIG. 6 is a flowchart showing the SRAM I / F data read process executed by the CPU 31 for reading the packet stored in the block data buffer of the SRAM 40. FIG. 7 is a flowchart showing a read block search process called during execution of the SRAM I / F data read process.
[0083]
  When the process is executed, the CPU 31 first acquires an R / W semaphore area SRAM semaphore in S110. That is, the CPU 31 writes the acquired value to the R / W semaphore area SRAM semaphore, determines that the semaphore has been acquired when the writing is completed, and executes the read block search process shown in FIG.
[0084]
  When this read block search process is executed, the CPU 31 first writes the data obtained by adding 1 to the read block number indicating the block number of the block data buffer from which data was read in the previous process in S121. The search block number indicating the block number of the block data buffer to be searched is set (however, if the value is 15, the search block number is set to 0 (zero)).
[0085]
  Subsequently, in S122, the CPU 31 reads the write side identification information and the state identification information in the R / W semaphore of the block corresponding to the search block number, and based on the read information, the write side of the search block is the main body side in S123. The (control unit 23 side) determines whether or not data writing to the block has been completed. When it is determined that the writing of data to the block has been completed and the writing side is the main body side, the sequential number written in the R / W semaphore is read in S124, and the previous SRAM I / O is read in S125. It is determined whether or not the sequential number for reading stored in the DRAM 37 at the time of executing the F data read processing matches the sequential number written in the R / W semaphore.
[0086]
  If it is determined that the sequential numbers match, the CPU 31 sets the search block number as a read block number in S126, stores the read block number in the DRAM 37, and ends the process.
  On the other hand, if it is determined that the sequential numbers are different, the CPU 31 determines in S127 whether the search block number matches the read block number stored in the previous process, which is one less than the block number that started the search in the process. If NO in step S128, the search block number is incremented by 1 in step S128, and the process is updated. On the other hand, if it is determined in S127 that they match (that is, if all blocks have been searched), the calling task is notified that there is no read block storing data in S129, and processing is performed. The process proceeds to S140.
[0087]
  In S140, the CPU 31 determines whether there is a read block based on the result of the read block search process. That is, it is determined whether or not the read block search process has been completed through the process of S126. If the process has not been completed through the process of S126, the release value is written to the R / W semaphore area SRAM semaphore in S150. As a result, the SRAM semaphore for the R / W semaphore area is released, and in S155, the number of read data bytes is set to zero and the process is terminated.
[0088]
  On the other hand, if the CPU 31 determines that the processing is completed through the processing of S126, the CPU 31 writes a value indicating “reading” in the status identification of the R / W semaphore corresponding to the read block number in S160. Thereafter, in S170, the R / W semaphore area SRAM semaphore is released.
[0089]
  In S180, the block data (entire packet or part of the packet) stored in the block corresponding to the read block number is read, and this is temporarily stored in the DRAM 37 designated by the caller of the process. Write to the storage buffer.
[0090]
  Thereafter, the SRAM semaphore for the R / W semaphore area is acquired again in S190, and “free” is set as the write side identification information and state identification information of the R / W semaphore corresponding to the read block in S200. Write the indicated value.
  In step S210, the R / W semaphore area SRAM semaphore is released. In step S220, the read sequential number is incremented by 1 and stored in the DRAM 37. In step S230, the read data byte is read. The number (the number of read data bytes) is notified to the calling task, and the process is terminated.
[0091]
  Next, FIG. 8 is a flowchart showing SRAM I / F data write processing executed by the CPU 31 to write a packet to the block data buffer of the SRAM 40. FIG. 9 is a flowchart showing an empty block search process called during execution of the SRAM I / F data write process.
[0092]
  When the process is executed, the CPU 31 first acquires an R / W semaphore area SRAM semaphore in S310, and executes a free block search process shown in FIG. 9 in S320.
  When the free block search process is executed, the CPU 31 refers to the write side identification information and the state identification information stored in the 15 blocks of the R / W semaphore in the R / W semaphore area in S321, so that the LAN I / F 19 The number of blocks in which data remains (that is, blocks whose status identification is “writing complete” or “reading”) is determined.
[0093]
  Then, based on this result, it is determined whether the remaining blocks are less than 80% of the whole (all blocks) (S323). If it is determined that the number of blocks is 80% or more, the CPU 31 determines in S324 the caller. After notifying that there is no empty block to this task, the processing is terminated. On the other hand, if it is determined in S323 that the value is less than 80%, the CPU 31 continues to display the write side identification information and the state identification information stored in the R / W semaphore of 15 blocks in the R / W semaphore area in S325. By sequentially referencing, the number of the first empty block found during the reference is notified to the calling task of the process as an empty block number, and then the process proceeds to S340.
[0094]
  In S340, the CPU 31 determines whether or not there is an empty block based on the execution result of the empty block search process. If it is determined that there is not, the CPU 31 releases the R / W semaphore area SRAM semaphore in S350. At the same time, in S355, the caller task is notified of the write failure, and thereafter the processing is terminated.
[0095]
  On the other hand, when determining that there is an empty block, the CPU 31 writes a value indicating “LAN side write” as the write side identification information in the R / W semaphore corresponding to the empty block in subsequent S360, and as the state identification information, A value indicating "being written" is written, and as the sequential number, the sequential number for writing that has been held by itself in the previous processing is written, and then the R / W semaphore area SRAM semaphore is released ( S370).
[0096]
  In S380, the current sequential number, the number of bytes of data to be written to the block, and the data designated by the caller (the whole packet or a part of the packet) are written into the empty block of the block data buffer.
  Thereafter, the SRAM semaphore for the R / W semaphore area is acquired again in S390, and a value indicating “write complete” is set in the status identification of the R / W semaphore corresponding to the block in which the data is written in S400. In writing, in S410, the R / W semaphore area SRAM semaphore is released.
[0097]
  Then, in S420, an interrupt request process to the main body side (control unit 23 side) is executed. When this interrupt request process is executed, the CPU 31 acquires the first interrupt request setting area SRAM semaphore, writes an interrupt request signal in the first interrupt request setting area, and then sets the first interrupt request setting. The area SRAM semaphore is released and the interrupt request process is terminated. Thereafter, the CPU 31 updates the write sequential number by adding 1 in S430.
[0098]
  Next, each process corresponding to the protocol unit that reads out the SRAM I / F data read process and the SRAM I / F data write process according to a predetermined procedure and transfers data between the SRAM 40 and the DRAM 37 will be described.
  First, FIG. 10 is a flowchart showing protocol part polling task processing executed by the CPU 31.
[0099]
  This process is a process for defining a procedure for reading data from the SRAM 40, and the CPU 31 blocks the control unit 23 in the block data buffer in the SRAM 40 by the process on the control unit 23 side corresponding to the interrupt request process. When it is determined that an interrupt request indicating that data has been written has been made, or when it is determined that a periodic polling process request has been made by its own interval timer, this processing is executed.
[0100]
  When the protocol part polling task process is executed, the CPU 31 executes the received data polling process shown in FIG. 11 in S500, and notifies the task waiting for transmission in S800 that the process is resumed. FIG. 11 is a flowchart showing received data polling processing executed by the CPU 31.
[0101]
  When the received data polling process shown in FIG. 11 is executed, the CPU 31 first reads out the block data from the designated block of the block data buffer of the SRAM 40 by executing the SRAM I / F data read process in S510, and the block Data is written in the temporary storage buffer for received data in the DRAM 37. Subsequently, in S520, the CPU 31 determines whether or not the number of bytes of data read out in the SRAM I / F data reading process (the number of read data bytes) is zero. .
[0102]
  On the other hand, if it is determined that it is not zero (No in S520), the CPU 31 stores the reception buffer of the logical channel in which the data is to be stored based on the information regarding the channel ID described at the head of the read block data packet. The position is determined (S530). Further, based on the information about the packet length written at the head of the read block data (packet), the packet length is set as the remaining number of bytes (S540).
[0103]
  In S550, the data (block data) for each block stored in the temporary storage buffer for received data is stored in the storage location of the determined reception buffer. At this time, the value obtained by subtracting the number of bytes of block data fetched into the reception buffer from the number of remaining bytes is stored as a new number of remaining bytes, and a memory address indicating the storage position of the next block data to be read is obtained. To do.
[0104]
  Thereafter, in S560, the CPU 31 determines whether or not the updated number of remaining bytes is zero. If it is not zero (No in S560), the CPU 31 again reads data for one block (block) by the SRAM I / F data reading process. Data) is read (S570). Also, in S580, it is determined whether or not the number of read data bytes is zero. If it is zero (that is, if reading by the SRAM I / F data reading process is not successful), the process returns to S570, The above process is repeated until the block data can be read.
[0105]
  If it is determined in S580 that the number of read data bytes is not zero (that is, if reading by the SRAM I / F data reading process is successful), the CPU 31 returns the process to S550 and reads the data for one block. Are arranged and stored in the block data stored in the previous reception buffer, and the remaining number of bytes and the memory address for storing the next block data are updated.
[0106]
  If it is determined in S560 that the number of remaining bytes is zero (Yes in S560), the CPU 31 obtains the channel type corresponding to the channel from the channel property table based on the information regarding the channel ID of the packet in S590. To do. Then, in S600, it is determined whether or not the channel type is SYSTEM. If the channel type is SYSTEM, the system command process shown in FIG. 12 is executed in S610. Thereafter, the process returns to S510, and the SRAM I / F data read processing is executed, and the above-described processing is executed in the SRAM 40 until there is no data to be read.
[0107]
  On the other hand, when determining in S600 that the channel type is not SYSTEM, the CPU 31 determines in S620 whether or not the channel type is COMMAND. If it is determined that the channel type is COMMAND, in S630, a notification indicating that there is received data in the corresponding channel is sent to the task that uses the channel, and then the process returns to S510, where the SRAM I / F data Read processing is executed.
[0108]
  If CPU 31 determines that the channel type is not COMMAND in S620 (that is, if the channel type is determined to be DATA), CPU 31 registers the packet stored in the reception buffer as valid data for buffer management in S640. .
[0109]
  In step S650, the controller 23 side (main body side) credits stored in the channel state information area are updated by reducing the number of remaining credits by 1, and in step S660, the received data is sent to the task waiting for the received data. A notification of presence is made, and thereafter, the process returns to S510 to execute the SRAM I / F data read process.
[0110]
  Next, the system command process and the protocol part received data read process will be described.
  FIG. 12 is a flowchart showing system command processing executed by the CPU 31. When this process is executed, the CPU 31 first determines whether or not the packet received in S710 is an open packet. When it is determined that the packet is an open packet, information on the maximum data length per packet stored in the open packet and the maximum number of credits stored in S711 is stored in the channel state information area of the corresponding channel. The information in the channel state information area is initialized to the state when the channel was opened. In S713, information indicating the channel open wait state is stored in the channel state information area as information indicating the channel state. If there is a task waiting to receive an open packet of the channel, the task is notified of the continuation of processing (S715), and then the processing is terminated.
[0111]
  On the other hand, when CPU 31 determines that the received packet is not an open packet in S710, CPU 31 determines whether or not the received packet is an open reply packet in subsequent S720. If it is determined that the received packet is an open reply packet, in step S721, information on the maximum data length per packet and the maximum number of credits stored in the open reply packet is stored in the channel state information area of the corresponding channel. Store and initialize the channel state information area to the channel open state. In S723, when there is a task waiting for reception of the open reply packet of the channel, notification of processing continuation is given, and thereafter the processing is terminated.
[0112]
  In addition, if it is determined in S720 that the received packet is not an open reply packet, the CPU 31 determines whether or not the received packet is a closed packet in subsequent S730, and if so, in S731, the channel state is determined. Information indicating that the channel is in the closed state is stored as information indicating the channel state in the information area, and the process ends.
[0113]
  If it is determined in S730 that the received packet is not a closed packet, the CPU 31 determines whether or not the received packet is a credit packet in subsequent S740. If the received packet is a credit packet, in S741, Based on the information on the additional credit number stored in the credit packet, the additional credit number is added to the credit number stored in the channel state information area of the corresponding channel. In step S743, the task waiting for credit addition notification of the corresponding channel is notified of credit addition, thereby notifying the task of processing continuation, and thereafter the processing ends. On the other hand, if the CPU 31 determines that the received packet is not a credit packet (No in S740), the process ends.
[0114]
  Next, FIG. 13 is a flowchart showing a protocol part received data read process. When the CPU 31 executes this process based on a command from an application that uses a logical channel, first, in S810, the CPU 31 determines whether there is packet data in the reception buffer corresponding to the designated channel ID. If it is determined that there is received packet data, then in S820, the smaller number of bytes among the maximum number of read bytes designated by the application and the number of bytes of packet data is set as the number of read bytes. In step S830, data corresponding to the number of read bytes is read from the reception buffer and stored in the read destination buffer designated by the application.
[0115]
  Thereafter, the CPU 31 updates the information on the number of packets stored in the reception buffer stored in the channel state information area in S840, and in S850, the number of packets stored in the reception buffer and the number of remaining credits on the main body side (S650 is changed). The sum of the credits (see below) has reached the threshold for credit packet transmission (limit number of credits). If the threshold has been reached (that is, if the sum is less than or equal to the threshold), request credit addition for the channel. Is transmitted to the control unit 23 side (S860), and the process ends. If the total does not reach the threshold value, the process is terminated as it is.
[0116]
  On the other hand, if the CPU 31 determines in S810 that there is no received data, it determines in S870 whether or not the application side has designated the blocking mode. If not, the process ends.
  Here, the blocking mode is for switching whether to execute the process again when the protocol unit cannot execute the process specified by the application side. If the blocking mode is specified, the CPU 31 Run the process again
  That is, if CPU31 judges that blocking mode is designated in S870, it will wait until there is a data reception notification (notification performed in said S660) in S880, and will process again, if reception notification is received. Is returned to S810 and the above process is repeated.
[0117]
  The various processes related to data reading in the protocol unit have been described above. Next, various processes related to data writing will be described.
  FIG. 14A is a flowchart showing a channel open process for enabling a logical channel (data channel) whose channel type is DATA.
[0118]
  When this process is executed in response to an instruction from the application, the CPU 31 first refers to the server / client information in the channel property table in S910 to determine whether the designated channel is divided into servers. When it is determined that the server is not a server (No in S910), an open packet including the maximum data length per packet of the designated channel and the maximum number of credits is created by referring to the channel property table in S920, and the process proceeds to S925. Then, a transmission packet writing process (see FIG. 16) described later is executed, and the generated open packet is written in the SRAM 40.
[0119]
  After that, the CPU 31 waits until there is an open reply packet reception notification (notification by S723) transmitted from the control unit 23 side (S930), and when receiving the open reply packet reception notification, the channel state of the designated channel is obtained. Information indicating that the channel is in the open state is stored in the information area (S940), and the process is terminated.
[0120]
  On the other hand, if it is determined in S910 that the designated channel is classified as a server, the CPU 31 checks information on the channel state in the channel state information area in S950, and the LAN I / F 19 has already been controlled by the control unit 23. Receives an open packet, and determines whether it is in an open wait state (see S713). If the CPU 31 determines that it is not in the open waiting state, the CPU 31 waits until an open packet is received (S960), and upon receiving a notification informing that a channel open has been received (notification in S715), the process proceeds to S970. To do. If it is determined in S950 that the device is already in the open waiting state, the process of S960 is skipped and the process of S970 is executed.
[0121]
  In S970, the CPU 31 refers to the channel property table to create an open reply packet including information on the maximum data length per packet of the specified channel and the maximum number of credits. In S975, the transmission packet writing process is performed. By executing, the created packet is written in the SRAM 40.
[0122]
  Thereafter, in S980, the CPU 31 stores information indicating that the channel state is the open state in the channel state information area of the designated channel, and ends the process.
  Next, FIG. 14B is a flowchart showing the channel closing process executed by the CPU 31 to bring the logical channel (data channel) opened by the channel opening process into an unusable state, that is, a closed state. It is.
[0123]
  When the process is executed according to a command from the application, the CPU 31 first refers to the channel state information area in S1010 and determines whether or not the designated channel is in the closed state. If it is determined that it is already closed, the process is terminated. On the other hand, when determining that the channel is not in the closed state, the CPU 31 generates a close packet for notifying the control unit 23 side to set the designated channel in the closed state in subsequent S1020.
[0124]
  Thereafter, the CPU 31 executes a transmission packet writing process in S1030 to write the generated packet on the SRAM 40, and in S1040, confirms that the channel state is closed in its own channel state information area. The information shown is stored, and the process is terminated.
[0125]
  Next, the protocol part transmission data writing process executed when the logical channel divided into data channels is in an open state will be described. FIG. 15 is a flowchart showing the protocol part transmission data writing process.
  When the process is executed in response to a command from the application, in S1110, the CPU 31 temporarily stores the number of write bytes specified by the application (the number of bytes of data for transmission) as the number of remaining write bytes, and further, the CPU 31 specifies Temporarily stores the memory address of the transmission data. In S1120, the maximum data length per packet of the logical channel corresponding to the channel ID designated by the application is read from the channel state information area and temporarily stored.
[0126]
  Thereafter, in S1130, the CPU 31 determines whether or not the number of remaining write bytes is zero. If not, it continues in S1140 and the maximum data length per packet of the corresponding channel ID. And the smaller number of bytes is set as the number of bytes of data for transmission stored in one packet, and the transmission packet writing process is executed in S1150.
[0127]
  In step S1160, it is determined whether the packet has been written. If the packet has been written, in step S1170, a value obtained by subtracting the number of bytes of transmission data that has been written in step S1150 from the number of remaining written bytes is a new remaining written byte. After the stored memory address is updated to the memory address of the transmission data to be written next, the process returns to S1130. On the other hand, when determining that the packet has not been written in S1160, the CPU 31 determines whether or not the blocking mode is designated by the application in subsequent S1180, and if so, returns the processing to S1130 to write the packet. Try again. If the blocking mode is not designated, in S1185, the value obtained by subtracting the number of remaining write bytes from the number of write bytes designated by the application is notified to the application as the number of write completion bytes, and the process ends. To do.
[0128]
  When the process returns to S1130 as described above, the CPU 31 repeatedly executes the above process again. When the number of remaining write bytes becomes zero in S1130, the process proceeds to S1135 and the write completion byte. The number is notified to the application, and the process ends.
[0129]
  Next, the transmission packet writing process will be described. FIG. 16 is a flowchart showing a transmission packet writing process executed by the CPU 31.
  When the process is executed, the CPU 31 first acquires a packet writing semaphore in step S1210. This semaphore is intended to prevent the continuity of packets in the SRAM 40 from being lost due to the writing of packets from other processing units when one packet is written in the SRAM 40 over a plurality of blocks. That is, in this embodiment, the transmission packet writing process is not called from a plurality of applications simultaneously.
[0130]
  Upon acquiring this semaphore, the CPU 31 determines in S1220 whether the remaining credit number on the LAN side (LAN I / F 19 side) stored in the channel state information area is zero. Note that the number of credits is NA for logical channels other than the data channel, but in this process, the number of credits is always set to 1 for these logical channels.
[0131]
  If it is determined that the number of remaining credits on the LAN side is zero, the CPU 31 determines whether or not the blocking mode is designated by the application in subsequent S1230. If the blocking mode is not designated, the CPU 31 obtains in S1210. The released semaphore is released (S1235), the task that has read the process is notified that the number of written bytes is zero (S1237), and the process ends.
[0132]
  On the other hand, when determining in S1230 that the blocking mode has been designated, the CPU 31 waits until there is a credit addition notification (notification by S743) in S1240, and upon receiving the notification, returns the processing to S1220.
  If it is determined in S1220 that the remaining credit is not zero, the CPU 31 obtains a memory address indicating the transmission data storage location designated by the caller of the process in S1250, and the caller designates it. The number of bytes of transmission data stored in one packet is temporarily stored as the number of remaining bytes.
[0133]
  In step S1260, it is determined whether the remaining number of bytes is 504 or less. Here, the reason for this determination is that the maximum number of bytes of a packet that can be stored in each block of the block data buffer is 508 bytes, but at the beginning of the packet, as shown in FIG. Acquired from the application because an area for storing information on the 2-byte packet length, an area for storing information on the 1-byte channel ID, and an area for storing the 1-byte type code are secured. This is because the maximum number of stored bytes of the transmitted data is limited to 504 bytes.
[0134]
  Therefore, when CPU 31 determines that the remaining number of bytes is larger than 504 bytes in S1260, CPU 31 sets the current number of written bytes to 504 bytes in S1270, and determines that the remaining number of bytes is 504 bytes or less in S1260. Then, in S1280, the current write byte number is set to the remaining byte number.
[0135]
  In S1290, the CPU 31 reads the transmission data having the number of write bytes set in S1270 or S1280, reads the read data, information on the packet length, information on the channel ID, and a type code of the system command. (Only packets using the system command channel) and block data (entire packet or part of the packet) are generated and stored in a write buffer secured in the DRAM 37.
[0136]
  Thereafter, the CPU 31 executes the above-described SRAM I / F data writing process in S1300, transfers the generated block data from the DRAM 37 to the SRAM 40, and in S1310 writes data by the SRAM I / F data writing process. Determine if has succeeded.
[0137]
  If the CPU 31 determines that the block data could not be written, the CPU 31 waits until there is a notification of resuming writing by the protocol part polling task processing (S800) (S1320). The / F data writing process is executed, and it is determined in step S1310 whether or not the block data has been successfully written.
[0138]
  If it is determined that the writing has succeeded, the memory address of the transmission data to be written next is updated in S1330, and the value obtained by subtracting the number of bytes of transmission data written in S1300 from the remaining number of bytes is obtained. Update as new number of remaining bytes.
[0139]
  Thereafter, the CPU 31 determines in S1340 whether or not the remaining number of bytes is zero. If not, in S1350, the CPU 31 determines whether or not the remaining number of bytes is 508 bytes or less. If it is determined that the number of remaining bytes is larger than 508 bytes, the current number of bytes to be written is set to 508 bytes in S1360, and if the number of remaining bytes is determined to be 508 bytes or less, the number of remaining bytes is determined in S1370. Set to the number of bytes written this time.
[0140]
  Also, in S1380, block data (the latter half of the packet) storing the data is created and written to the write buffer in the DRAM 37, and the process returns to S1300 to execute the SRAM I / F data write process. Thus, the created packet is written on the SRAM 40.
[0141]
  On the other hand, if it is determined in S1340 that the remaining number of bytes is zero, CPU 31 determines in S1390 whether the credit type of the channel is NA, and if it is not NA, in S1400, the channel state is determined. The number of remaining credits on the LAN side stored in the information area is reduced by 1 and the process proceeds to S1410. If it is determined to be NA, the process of S1400 is skipped and the process proceeds to S1410.
[0142]
  In step S1410, the CPU 31 releases the semaphore acquired in step S1210. In step S1420, the CPU 31 notifies the calling task of the number of written bytes and ends the processing.
  Next, the main body side MIB access function calling process of the protocol section for calling the main body side MIB access function that operates as one of the application groups, and the LAN side MIB access function call of the protocol section for calling the LAN side MIB access function Processing will be described. FIG. 17A is a flowchart showing the main body side MIB access function call processing.
[0143]
  In this embodiment, the control unit 23 is provided with an MIB access function (hereinafter also referred to as “OBJACC function”) for accessing an object in the MIB on the control unit 23 side, which will be described below. In this way, the call is made from the LAN I / F 19 side to access the MIB.
[0144]
  When an instruction to execute the process is input from another task, the CPU 31 executes the process and first acquires a semaphore for reading the main body OBJACC function in S1510. Note that this semaphore prevents an object from being operated simultaneously by preventing an OBJACC function call from the main body side (control unit 23) and an OBJACC function call from the LAN I / F 19 side from being performed simultaneously. belongs to.
[0145]
  Subsequently, in S1520, the CPU 31 generates a packet for calling the OBJACC function based on the parameter acquired from the task that called the process, stores it in the write buffer in the DRAM 37, and in S1530, A transmission packet writing process is executed to write the packet into the SRAM 40.
[0146]
  Thereafter, the control unit 23 waits for a data storage notification (that is, a reception notification in S630) to the reception buffer of the main body side MIB access channel as a response from the control unit 23. The packet format data is read, the return value obtained by calling the OBJACC function on the main body side is converted into a parameter to be returned to the caller task, the parameter is transferred to the caller task, and further in S1510 The acquired semaphore is released (S1560), and the process ends.
[0147]
  FIG. 17B is a flowchart showing the LAN-side MIB access function call process.
  When there is a notification indicating that data has been stored in the reception buffer of the LAN-side MIB access channel from the control unit 23 side (notification in S630), the CPU 31 executes the processing. First, in S1610, the LAN-side OBJACC function Get the semaphore for the call. This semaphore is used for the same purpose as that of the main body side OBJACC function call semaphore.
[0148]
  Subsequently, in S1620, the CPU 31 obtains a packet from the reception buffer of the LAN side MIB access channel, converts it into a parameter for calling the OBJACC function on the LAN I / F 19 side, and calls the OBJACC function in S1630.
[0149]
  Thereafter, in S1640, the CPU 31 generates a packet including a return value from the function acquired as a result of calling the OBJACC function, and stores the packet in the write buffer. Also, the semaphore acquired in S1610 is released (S1650), the transmission packet writing process is executed in S1660, and the process ends.
[0150]
  Next, the EEPROM access calling process of the protocol unit for calling the EEPROM access process operating as an application group and the printer status notification calling process of the protocol unit for calling the printer status notification process will be described.
[0151]
  FIG. 18A is a flowchart showing the EEPROM access calling process.
  When there is a notification indicating that data has been stored in the reception buffer of the EEPROM access channel (the notification in S630), the CPU 31 executes this processing, and first acquires a semaphore for calling the EEPROM access processing in S1710. . Here, the EEPROM 35 has a hardware configuration that does not allow simultaneous access, and this semaphore is intended to exclusively control EEPROM access from the main body side and EEPROM access in the LAN I / F 19.
[0152]
  Upon acquiring this semaphore, the CPU 31 reads the packet from the reception buffer of the EEPROM access channel at S1720, generates a parameter for calling the EEPROM access process based on this, and based on this parameter, the EEPROM at S1730 Call the access process. By this EEPROM access processing, the data in the EEPROM 35 instructed from the control unit 23 side is manipulated, and the return value obtained by executing the EEPROM access processing in S1740 is the packet determined for the EEPROM access. This is stored in a write buffer in the DRAM 37.
[0153]
  Thereafter, the CPU 31 releases the semaphore acquired in S1710 (S1750), further executes a transmission packet writing process, writes the generated packet in the SRAM 40, and ends the process.
  FIG. 18B is a flowchart showing printer status notification calling processing.
[0154]
  When there is a notification indicating that data has been stored in the reception buffer of the printer status notification channel (the notification in S630), the CPU 31 executes the process, and first, in S1810, the packet is received from the reception buffer of the printer status notification channel. Based on this, a parameter for calling the printer status notification process is created, and the printer status notification process is called in S1820. Then, a printer status notification mail is created at the destination instructed by the control unit 23 and sent out on the LAN.
[0155]
  When the printer status notification processing is completed, the CPU 31 creates a response packet indicating that the printer status notification processing is completed in S1830, and stores it in the write buffer in the DRAM 37. Then, a transmission packet writing process is executed in S1840, a response packet is written on the SRAM 40, and the process ends.
[0156]
  The facsimile 10 according to the present embodiment has been described above. In the facsimile 10, each process corresponding to the protocol unit generates a packet including transmission data acquired from an application and information on the channel ID. By the method, the data is written on the SRAM 40 within a range that the receiving side can capture from the SRAM 40, and when the writing is completed, the receiving side is notified of the writing, and the receiving side immediately captures the packet from the SRAM 40. As a result, according to the facsimile 10 of the present embodiment, it is possible to sufficiently suppress problems such as subsequent communication stagnation due to packets remaining in the SRAM 40 for a long time.
[0157]
  In particular, in the system command channel, since the protocol unit executes the command received immediately, the packet in which the system command is stored for a long time does not stay on the SRAM 40, and as a result, communication control of the transmitted / received packet is smoothly performed. Can be done.
[0158]
  Further, since the system command channel and the command channel are configured to receive only one packet, the CPU executes processing corresponding to the commands in the order of received packets without explicitly performing flow control. be able to.
[0159]
  In addition, the protocol unit notifies the maximum number of credits as the maximum number of packets that can be taken into the reception buffer from the SRAM 40 when the data channel is opened, and thereafter, the sum of the number of credits on the transmission side and the number of stored packets in the reception buffer. Is configured to generate a credit packet and transmit this packet to the communicating party each time the value becomes less than a threshold value (limit credit number), and therefore must be exchanged between the control unit 23 and the LAN I / F 19. While minimizing the amount of data communication for communication control, it is possible to prevent data transmission from being temporarily stopped when the number of credits becomes zero on the transmission side, resulting in efficient communication. It can be performed.
[0160]
  The first channel of the present invention corresponds to a system command channel, the second channel corresponds to a command channel, and the third channel corresponds to a data channel.
  In addition, the present inventionData capture meansCorresponds to the SRAM I / F data read processing, protocol part polling task processing, and reception data polling processing of this embodiment.
[0161]
  In addition, the data delivery means of the present invention calls the system command process (S610) in the received data polling process of the present embodiment, and the data in the receive buffer is designated by the application in S830 of the protocol part received data read process. Operation for transferring to the read destination buffer, operation for calling an application using the corresponding command channel in the main body side MIB access function call processing, LAN side MIB access function call processing, EEPROM access call processing, and printer status call processing , Is realized.
[0162]
  In the received data polling process according to the present embodiment, when a packet transmitted through the command channel and the data channel is received, the CPU 31 notifies the task waiting for received data that there is received data, and the task receives the reception buffer. The CPU 31 is configured to directly call and execute the system command processing when receiving the packet transmitted through the system command channel.The latter behaviorThe data delivery means in the present inventionExecute processing according to the command included in the packetCorresponds to the action.
[0163]
  The data sending means corresponds to the SRAM I / F data writing process of this embodiment, and the communication control means corresponds to each process (protocol part transmission data writing process, transmission packet writing process, etc.) corresponding to the protocol part. .
  Specifically, the operation in which the communication control means acquires the external capacity information from the external processor is the maximum per packet included in the open packet or open replay packet from the communication partner when both the LAN I / F 19 and the control unit 23 open the channel. This corresponds to an operation of acquiring information on the data length and the maximum credit number, and further acquiring information on addition of the credit number included in the credit packet every predetermined period.
[0164]
[0165]
[0166]
  In addition, when the data sending means transmits a packet on the third channel, the communication control means controls the data sending means based on the external capacity information, and sends the data sending means to the range of the number of packets and the packet length. The CPU 31 determines whether or not the remaining credit number is zero in S1220 of the transmission packet writing process, and if the remaining credit number is zero, until the credit addition notification is received. This corresponds to the standby operation.
[0167]
  The initial capacity notifying means of the receiving capacity notifying means is such that the CPU 31 executes channel open processing, and an open packet or open reply packet storing the maximum data length per packet and the maximum number of credits as the initial data capacity is stored on the main body side. When the CPU 31 receives a packet through the data channel, the additional capacity notification means executes a protocol part received data read process to generate a credit packet for notifying the addition of a credit, It is realized by the operation to transmit to.
[0168]
  As mentioned above, although the Example of this invention was described, the communication apparatus of this invention is not limited to the said Example, It can take a various aspect.
  For example, in this embodiment, the data transmission amount on the transmission side is adjusted by the number of credits counted in units of packets, but instead of the number of credits, the reception side transmits the number of empty bytes in the reception buffer every predetermined period. You may make it transmit to the side. This complicates the communication control method, but it is possible to adjust the data transmission amount on the transmission side in more detail.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of a facsimile machine 10 according to an embodiment.
FIG. 2 is a block diagram showing a configuration of a LAN I / F 19;
FIG. 3 is an explanatory diagram showing a configuration in an SRAM 40;
FIG. 4 is an explanatory diagram functionally showing each process related to data transmission / reception and a data delivery mode.
FIG. 5 is an explanatory diagram (FIG. 5A) showing a configuration of a channel property table and an explanatory diagram (FIG. 5B) showing a data configuration of a packet stored in the SRAM 40;
FIG. 6 is a flowchart showing SRAM I / F data read processing.
FIG. 7 is a flowchart showing a read block search process.
FIG. 8 is a flowchart showing SRAM I / F data write processing.
FIG. 9 is a flowchart showing an empty block search process.
FIG. 10 is a flowchart showing protocol part polling task processing;
FIG. 11 is a flowchart showing a received data polling process.
FIG. 12 is a flowchart showing system command processing.
FIG. 13 is a flowchart showing a protocol part received data read process.
FIG. 14 is a flowchart showing a channel open process (FIG. 14A) and a flowchart showing a channel close process (FIG. 14B).
FIG. 15 is a flowchart showing a protocol part transmission data writing process.
FIG. 16 is a flowchart showing a transmission packet writing process.
FIG. 17 is a flowchart (FIG. 17A) showing main body side MIB access function call processing and a flowchart (FIG. 17B) showing LAN side MIB access function call processing.
FIG. 18 is a flowchart (FIG. 18A) showing an EEPROM access calling process and a flowchart (FIG. 18B) showing a printer status notification calling process.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 10 ... Facsimile, 19 ... LAN I / F, 23 ... Control part, 25, 31 ... CPU, 29, 37 ... DRAM, 29a, 37a ... Reception buffer, 27, 33 ... ROM, 35 ... EEPROM, 40 ... Dual port SRAM

Claims (8)

自身のプロセッサ、及び、外部のプロセッサよりアクセス可能な共有メモリを介して、前記自身のプロセッサにて動作する自己タスクと、外部のプロセッサにて動作する外部タスクとの間で、複数の論理チャネルを用いてデータ通信を行う通信装置であって、
前記外部タスクの動作により前記外部のプロセッサから前記共有メモリに書き込まれたデータを各論理チャネル毎に格納するための受信バッファと、
前記外部のプロセッサからチャネルIDに関する情報を含むデータが前記共有メモリに書き込まれると、このデータを前記共有メモリから読み出し、当該データ内の前記チャネルIDに関する情報に基づき、当該データを、対応する論理チャネルの前記受信バッファに書き込むデータ取込手段と、
前記データ取込手段が前記受信バッファに前記データを書き込むと、この受信バッファに対応する論理チャネルを使用する自己タスクに、この受信バッファに格納された前記データを受け渡すデータ受渡手段と、
前記自己タスクにより生成された送信用データとチャネルIDに関する情報とを含むデータを、前記共有メモリに書き込むデータ送出手段と、
前記複数の論理チャネルの夫々について、前記受信バッファに格納可能な当該論理チャネルのデータ容量に関する自己容量情報を、前記外部のプロセッサに通知する受信容量通知手段と、
前記外部タスクが前記共有メモリより取り込み可能な前記論理チャネル毎のデータ容量に関する外部容量情報を、前記外部のプロセッサから取得し、この外部容量情報に基づき、前記データ送出手段を制御して、前記外部タスクがデータを前記共有メモリより取り込み可能な範囲内で、前記データ送出手段に前記データを前記共有メモリに書き込ませる通信制御手段と、
を備えたことを特徴とする通信装置。
A plurality of logical channels are set between a self-task operating on the processor and an external task operating on the external processor via the processor and a shared memory accessible from the external processor. A communication device that performs data communication using
A reception buffer for storing, for each logical channel , data written to the shared memory from the external processor by the operation of the external task;
When the data including the information on the channel ID from the external processor is written into the shared memory, it reads the data from the shared memory based on the information on the channel ID in the data, the data, the corresponding logical channel Data take-in means for writing to the reception buffer;
When the data acquisition unit writes the data to the reception buffer, the self task using logical channel corresponding to the receiving buffer, and a data transfer means for transferring the data stored in the receiving buffer,
Data sending means for writing data including transmission data generated by the self-task and information related to a channel ID into the shared memory;
For each of the plurality of logical channels, reception capacity notification means for notifying the external processor of self-capacity information regarding the data capacity of the logical channel that can be stored in the reception buffer;
The external volume information about the external task data capacity of each uptake possible the logical channel from the shared memory, the external processor or al acquired, on the basis of the external capacity information, and controls the data transmission means, said the external task data in the uptake extent possible from the shared memory, and communication control means for writing said data to said shared memory to said data transmission means,
A communication apparatus comprising:
前記受信容量通知手段は、前記データ送出手段に前記自己容量情報を前記共有メモリに書き込ませることにより、前記自己容量情報を、前記共有メモリを介して前記外部のプロセッサに通知し、The reception capacity notifying means notifies the external processor of the self capacity information via the shared memory by causing the data sending means to write the self capacity information to the shared memory.
前記通信制御手段は、前記外部のプロセッサから前記共有メモリに書き込まれた前記外部容量情報を、前記データ受渡手段を介して取得することにより、前記外部容量情報を、前記外部のプロセッサから前記共有メモリを介して取得すること  The communication control means obtains the external capacity information written in the shared memory from the external processor via the data delivery means, thereby obtaining the external capacity information from the external processor. To get through
を特徴とする請求項1記載の通信装置。  The communication device according to claim 1.
前記受信容量通知手段は、
前記外部タスクとの間で通信を開始する際に、当該通信で用いる論理チャネルに対応する前記受信バッファ格納可能な初期データ容量を、前記外部のプロセッサに通知する初期容量通知手段と、
前記論理チャネル毎に、当該論理チャネルに対応する前記受信バッファに格納されたデータを前記データ受渡手段が前記自己タスクに受け渡すことにより新たに受信バッファに格納可能となった追加データ容量を、所定の契機で前記外部のプロセッサに通知する追加容量通知手段と、
を備え、
前記自己容量情報として、前記論理チャネル毎に、前記初期データ容量と、前記追加データ容量とを、前記外部のプロセッサに通知する構成にされていることを特徴とする請求項1又は請求項2に記載の通信装置。
The reception capacity notification means includes:
When starting the communication with the external task, the initial capacity notifying means the initial data capacity that can be stored in the receiving buffer corresponding to the logical channel used in the communication, and notifies the external processor,
For each logical channel, an additional data capacity that can be newly stored in the reception buffer by the data delivery means passing the data stored in the reception buffer corresponding to the logical channel to the self-task is predetermined. Additional capacity notification means for notifying the external processor at the opportunity of,
With
As the self-capacitance information, for each of the logical channel, and the initial data volume, and the additional data capacity, to claim 1 or claim 2, characterized in that it is a configuration that notifies the outside of the processor The communication device described.
前記外部タスクとの間で行われる前記論理チャネル毎のデータ通信は、パケットにより構成される前記チャネルIDに関する情報を含むデータを、前記共有メモリに書き込む動作、及び、前記外部のプロセッサによって前記共有メモリに書き込まれた前記パケットを取り込む動作を通じて行われ、
前記初期容量通知手段は、前記初期データ容量として、前記通信で用いる論理チャネルに対応する前記受信バッファに格納可能な最大パケット数と、そのパケット長とを、前記外部のプロセッサに通知し、
前記追加容量通知手段は、前記追加データ容量として、前記論理チャネル毎に、当該論理チャネルに対応する前記受信バッファに格納されたパケットを前記データ受渡手段が自己タスクに受け渡すことにより新たに受信バッファに格納可能となったパケット数を前記外部のプロセッサに通知することを特徴とする請求項3に記載の通信装置。
The data communication for each logical channel performed with the external task includes an operation of writing data including information on the channel ID configured by a packet into the shared memory, and the shared memory by the external processor. Is performed through an operation of capturing the packet written in
The initial capacity notification means notifies the external processor of the maximum number of packets that can be stored in the reception buffer corresponding to the logical channel used in the communication and the packet length as the initial data capacity ,
The additional capacity notifying means newly receives the packet stored in the reception buffer corresponding to the logical channel as the additional data capacity by the data delivery means to the own task for each logical channel. The communication apparatus according to claim 3 , wherein the external processor is notified of the number of packets that can be stored in the external processor.
前記外部タスクとの間で行われる前記論理チャネル毎のデータ通信は、パケットにより構成される前記チャネルIDに関する情報を含むデータを、前記共有メモリに書き込む動作、及び、前記外部タスクによって前記共有メモリに書き込まれた前記パケットを取り込む動作を通じて行われ、
前記複数の論理チャネルは、
前記外部タスクと前記自己タスクとの間の通信制御に必要な処理の実行を指令するコマンドを含むパケットを送受信するための第一チャネル、
前記コマンドを除くデータであって、前記外部タスクと前記自己タスクとの間で、単一パケットにて構成可能なデータを送受信するための第二チャネル、及び、
前記コマンドを除くデータであって、前記外部タスクと前記自己タスクとの間で、複数パケットにて構成されるデータを送受信するための第三チャネ
のいずれかのチャネルタイプに区分されており、
更に、当該装置において、
前記第三チャネルに区分されている論理チャネルの前記受信バッファは、複数パケットを格納可能に構成され、
前記通信制御手段は、前記データ送出手段に、前記第三チャネルに区分されている論理チャネルの前記チャネルIDに関する情報を含むパケットを、前記共有メモリに書き込ませる場合に、当該論理チャネルについての前記外部容量情報を前記外部のプロセッサから取得して、この外部容量情報に基づき、前記データ送出手段を制御することを特徴とする請求項1〜請求項4のいずれかに記載の通信装置。
In the data communication for each logical channel performed with the external task, data including information on the channel ID configured by a packet is written to the shared memory, and the shared memory is used by the external task. It is performed through an operation of capturing the written packet,
The plurality of logical channels are:
Said external task and the first channel for transmitting and receiving a packet containing a command for instructing the execution of the processing required for communication control between the self task,
A data excluding the command, the external tasks and between the self-task, the second channel for transmitting and receiving a configurable data in a single packet and,
A data excluding the command, between the self-task and the external task, a third channel for receiving and transmitting data formed by a plurality of packets
Are classified into one of the channel types
Furthermore, in the device,
The reception buffer of the logical channel divided into the third channel is configured to store a plurality of packets,
When the communication control unit causes the data transmission unit to write a packet including information on the channel ID of the logical channel divided into the third channel into the shared memory, the communication control unit It acquires the capacity information from the external processor, based on the external volume information, the communication device according to any one of claims 1 to 4, wherein the controller controls the data transmission means.
前記第一チャネルに区分されている論理チャネルの前記チャネルIDに関する情報を含むパケットが、前記受信バッファに書き込まれた場合には、前記データ受渡手段によって、当該パケットに含まれるコマンドに従った処理を実行し、前記第二チャネル及び第三チャネルのいずれかに区分されている論理チャネルの前記チャネルIDに関する情報を含むパケットが、前記受信バッファに書き込まれた場合には、前記データ受渡手段によって、当該論理チャネルを使用する自己タスクにパケットを受け渡すことで、この自己タスクに、当該パケットに対応した処理を実行させることを特徴とする請求項5記載の通信装置。 When a packet including information on the channel ID of the logical channel classified as the first channel is written in the reception buffer, the data delivery unit performs processing according to the command included in the packet. And when a packet including information on the channel ID of the logical channel divided into one of the second channel and the third channel is written in the reception buffer, the data delivery means 6. The communication apparatus according to claim 5 , wherein a packet is delivered to a self-task that uses a logical channel to cause the self-task to execute processing corresponding to the packet . 前記通信制御手段は、前記データ送出手段に、前記第三チャネルに区分されている論理チャネルの前記チャネルIDに関する情報を含むパケットを、前記共有メモリに書き込ませる場合、当該論理チャネルにおいて前記外部タスクが前記共有メモリより取り込み可能なパケット数と、そのパケット長とを、前記外部容量情報として、取得すると共に、前記データ送出手段を制御して、前記データ送出手段に、このパケット数及びパケット長の範囲内で前記パケットを前記共有メモリに書き込ませることを特徴とする請求項5又は請求項6に記載の通信装置。When the communication control unit causes the data transmission unit to write a packet including information on the channel ID of the logical channel divided into the third channel into the shared memory, the external task is connected to the logical channel. The number of packets that can be fetched from the shared memory and the packet length thereof are acquired as the external capacity information, and the data sending means is controlled so that the data sending means has a range of the number of packets and the packet length . The communication apparatus according to claim 5, wherein the packet is written in the shared memory. プロセッサを備える第一及び第二の処理実行装置、並びに、当該第一及び第二の処理実行装置よりアクセス可能で前記第一の処理実行装置と前記第二の処理実行装置との間に介在する共有メモリを備え、前記共有メモリを介して、前記第一の処理実行装置のプロセッサにて動作するタスクと、前記第二の処理実行装置のプロセッサにて動作するタスクとの間で、複数の論理チャネルを用いてデータ通信を行う通信システムであって、First and second process execution apparatuses including a processor, and accessible between the first and second process execution apparatuses and interposed between the first process execution apparatus and the second process execution apparatus A plurality of logics between a task operating on the processor of the first processing execution device and a task operating on the processor of the second processing execution device via the shared memory. A communication system for performing data communication using a channel,
前記第一の処理実行装置は、  The first process execution device includes:
前記第二の処理実行装置から前記共有メモリに書き込まれたデータを前記論理チャネル毎に格納するための受信バッファと、  A reception buffer for storing the data written in the shared memory from the second processing execution device for each logical channel;
前記第二の処理実行装置からチャネルIDに関する情報を含むデータが前記共有メモリに書き込まれると、このデータを前記共有メモリから読み出し、当該データ内の前記チャネルIDに関する情報に基づき、当該データを、対応する論理チャネルの前記受信バッファに書き込むデータ取込手段と、  When data including information on the channel ID is written from the second processing execution device to the shared memory, the data is read from the shared memory, and the data is handled based on the information on the channel ID in the data. Data capture means for writing to the receive buffer of the logical channel
前記データ取込手段が前記受信バッファに前記データを書き込むと、自装置のプロセッサにて動作するタスクであって、その受信バッファに対応する論理チャネルを使用するタスクに、前記受信バッファに格納された前記データを受け渡すデータ受渡手段と、  When the data fetching means writes the data into the reception buffer, it is stored in the reception buffer in a task that operates in its own processor and that uses a logical channel corresponding to the reception buffer. Data delivery means for delivering the data;
前記複数の論理チャネルの夫々について、前記受信バッファに格納可能な当該論理チャネルのデータ容量に関する受信容量情報を、前記第二の処理実行装置に通知する受信容量通知手段と、  For each of the plurality of logical channels, reception capacity notification means for notifying the second processing execution device of reception capacity information related to the data capacity of the logical channel that can be stored in the reception buffer;
を備え、  With
前記第二の処理実行装置は、  The second process execution device includes:
自装置の前記プロセッサにて動作するタスク、により生成された送信用データとチャネルIDに関する情報とを含むデータを、前記共有メモリに書き込むデータ送出手段と、  Data sending means for writing data including data for transmission generated by a task operating in the processor of its own device and information relating to a channel ID to the shared memory;
前記第一の処理実行装置から前記受信容量情報を取得し、この受信容量情報に基づき、前記データ送出手段を制御して、前記第一の処理実行装置がデータを前記共有メモリより取り込み可能な範囲内で、前記データ送出手段に前記データを前記共有メモリに書き込ませる通信制御手段と、  The reception capacity information is acquired from the first process execution device, and the data sending means is controlled based on the reception capacity information, so that the first process execution device can capture data from the shared memory. Communication control means for causing the data sending means to write the data into the shared memory;
を備えたことを特徴とする通信システム。  A communication system comprising:
JP2001256681A 2001-08-27 2001-08-27 Communication apparatus and communication system Expired - Fee Related JP4403677B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001256681A JP4403677B2 (en) 2001-08-27 2001-08-27 Communication apparatus and communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001256681A JP4403677B2 (en) 2001-08-27 2001-08-27 Communication apparatus and communication system

Publications (2)

Publication Number Publication Date
JP2003067318A JP2003067318A (en) 2003-03-07
JP4403677B2 true JP4403677B2 (en) 2010-01-27

Family

ID=19084465

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001256681A Expired - Fee Related JP4403677B2 (en) 2001-08-27 2001-08-27 Communication apparatus and communication system

Country Status (1)

Country Link
JP (1) JP4403677B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6600175B1 (en) 1996-03-26 2003-07-29 Advanced Technology Materials, Inc. Solid state white light emitter and display using same
JP4443474B2 (en) * 2005-06-14 2010-03-31 株式会社ソニー・コンピュータエンタテインメント Command transfer control device and command transfer control method
JP2008003658A (en) * 2006-06-20 2008-01-10 Delta Electronics Inc Human-machine interface system having device bridge, and its design method and operating method
JP5349515B2 (en) * 2011-03-14 2013-11-20 株式会社東芝 Buffer management device, buffer management method, and storage device
JP6164823B2 (en) * 2012-11-30 2017-07-19 キヤノン株式会社 Printing device
CN107885671B (en) 2016-09-30 2021-09-14 华为技术有限公司 Nonvolatile memory persistence method and computing device

Also Published As

Publication number Publication date
JP2003067318A (en) 2003-03-07

Similar Documents

Publication Publication Date Title
JP4865358B2 (en) Print control apparatus, control method, storage medium, and program having print request acceptance order guarantee
JP3769449B2 (en) Capture controller and image capture processing method
US20030035140A1 (en) Image processing apparatus, management unit, and program
JP4403677B2 (en) Communication apparatus and communication system
US9134785B2 (en) Information processing apparatus with power saving mode, and control method and communication apparatus therefor
JP3603577B2 (en) Image processing system
JP2007221239A (en) Extended image processing system
JP3189269B2 (en) Network printer
JP4571455B2 (en) Image forming apparatus, information processing method, information processing program, recording medium, and distributed file system
JP3312886B2 (en) Facsimile modem device
JP4474873B2 (en) Image processing device
JP2005074928A (en) Data processing system, data processor, and data receiving program
JP5332923B2 (en) Image forming apparatus
JP4602705B2 (en) Image forming apparatus, information processing method, information processing program, and recording medium
JPH11143665A (en) Print control system and method
JP4708818B2 (en) Network device and control method thereof
JP3289826B2 (en) Network printer and network printing method
JP7305710B2 (en) PRINT CONTROL DEVICE AND CONTROL METHOD THEREOF
KR100600794B1 (en) Network node for restricting packet receiving activity and method thereof
JP2023077923A (en) PRINTING DEVICE, CONTROL METHOD THEREOF, AND PROGRAM
JP6033383B2 (en) Information processing apparatus, control method thereof, and control program
JP3994569B2 (en) Image processing device
JP2002051100A (en) Relay device and control method thereof
JP2001209503A (en) Printer and printer job data transfer method
JP2022160736A (en) PRINTING SYSTEM, PRINT CONTROL APPARATUS, IMAGE FORMING APPARATUS, CONTROL METHOD AND PROGRAM THEREOF

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060315

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081226

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090120

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090323

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20091013

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091026

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121113

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4403677

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131113

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees