JP2014209282A - Terminal device and communication program - Google Patents

Terminal device and communication program Download PDF

Info

Publication number
JP2014209282A
JP2014209282A JP2013085933A JP2013085933A JP2014209282A JP 2014209282 A JP2014209282 A JP 2014209282A JP 2013085933 A JP2013085933 A JP 2013085933A JP 2013085933 A JP2013085933 A JP 2013085933A JP 2014209282 A JP2014209282 A JP 2014209282A
Authority
JP
Japan
Prior art keywords
peripheral device
communication
interface circuit
terminal device
control unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013085933A
Other languages
Japanese (ja)
Inventor
中村 邦彦
Kunihiko Nakamura
邦彦 中村
裕也 本多
Yuya Honda
裕也 本多
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.)
Sumitomo Electric Networks Inc
Original Assignee
Sumitomo Electric Networks Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sumitomo Electric Networks Inc filed Critical Sumitomo Electric Networks Inc
Priority to JP2013085933A priority Critical patent/JP2014209282A/en
Publication of JP2014209282A publication Critical patent/JP2014209282A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a terminal device capable of restarting communication without troubling a user in the case that a communication error with a peripheral device occurs without providing a special component in the peripheral device, and a communication program.SOLUTION: A terminal device 101 for performing communication with a detachable peripheral device 102 includes: an interface circuit 22 to be started when the peripheral device 102 is mounted to transmit and receive a signal to/from the peripheral device 102; and a communication control part 12 for recognizing the peripheral device 102 when the interface circuit 22 is started, and controlling communication between the recognized peripheral device 102 and the own terminal device 101. The communication control part 12 detects whether to communicate with the peripheral device 102, and restarts the interface circuit 22 after stopping the interface circuit 22 in the case of detecting that the communication is not possible.

Description

本発明は、端末装置および通信プログラムに関し、特に、取り外し可能な周辺機器との通信を行う端末装置および当該端末装置において用いられる通信プログラムに関する。   The present invention relates to a terminal device and a communication program, and more particularly to a terminal device that performs communication with a removable peripheral device and a communication program used in the terminal device.

従来、USB(Universal Serial Bus)通信規格に対応した端末装置など、電源を入れたまま周辺機器の取り外しを行うことが可能な端末装置が知られている。このような端末装置では、静電気の発生等の影響で、端末装置と周辺機器との通信エラーが生じることがあり、このような場合、周辺機器を端末装置から取り外し、再び接続させることにより通信の再開を行っていた。   2. Description of the Related Art Conventionally, terminal devices capable of removing peripheral devices while the power is on, such as terminal devices compatible with the USB (Universal Serial Bus) communication standard, are known. In such a terminal device, a communication error may occur between the terminal device and the peripheral device due to the occurrence of static electricity, etc. In such a case, it is possible to remove the peripheral device from the terminal device and reconnect it. I was restarting.

また、ユーザの手を煩わすことなく通信の再開を可能にするため、たとえば、特許文献1(特開2001−306413号公報)には、USB通信規格に対応した通信をホストとの間で行うUSB通信デバイスにおいて、USB通信ラインのD+ラインと電源ラインとの間、または、D−ラインと電源ラインとの間に挿入されたプルアップ抵抗と、プルアップ抵抗に対して直列に挿入された電子スイッチと、電子スイッチを必要に応じて制御し、電子スイッチの再起動動作を行う制御回路と、を有することを特徴とするUSB通信デバイスが開示されている。   In addition, in order to enable communication to be resumed without bothering the user, for example, Patent Document 1 (Japanese Patent Laid-Open No. 2001-306413) discloses a USB that performs communication corresponding to a USB communication standard with a host. In a communication device, a pull-up resistor inserted between a D + line and a power line of a USB communication line or between a D- line and a power line, and an electronic switch inserted in series with the pull-up resistor And a control circuit that controls the electronic switch as necessary and performs a restarting operation of the electronic switch.

特開2001−306413号公報JP 2001-306413 A

しかしながら、特許文献1に記載の技術では、周辺機器であるUSB通信デバイスに電子スイッチなどの部品を別途設ける必要があり、このような電子スイッチ等が設けられていない既存の周辺機器に対して特許文献1に記載の技術を適用させることは困難である。   However, in the technique described in Patent Document 1, it is necessary to separately provide components such as an electronic switch in a USB communication device that is a peripheral device, and patents are provided for existing peripheral devices that are not provided with such an electronic switch. It is difficult to apply the technique described in Document 1.

この発明は、上述の課題を解決するためになされたもので、その目的は、特別な部品を周辺機器に設けることなく、当該周辺機器との通信エラーが生じた場合にユーザの手を煩わすことなく通信を再開することができる端末装置および通信プログラムを提供することである。   The present invention has been made in order to solve the above-described problems, and its purpose is not to provide a special part in a peripheral device, but to bother the user when a communication error occurs with the peripheral device. It is to provide a terminal device and a communication program that can resume communication without any problems.

(1)上記課題を解決するために、この発明のある局面に係わる端末装置は、取り外し可能な周辺機器との通信を行う端末装置であって、前記周辺機器が取り付けられると起動し、前記周辺機器との間で信号を送受信するインタフェース回路と、前記インタフェース回路が起動すると前記周辺機器を認識し、認識した前記周辺機器と自己の前記端末装置との通信の制御を行う通信制御部とを備え、前記通信制御部は、前記周辺機器との通信の可否を検知し、通信が可能ではないことを検知した場合、前記インタフェース回路を停止させた後、前記インタフェース回路を再起動させる。   (1) In order to solve the above-described problem, a terminal device according to an aspect of the present invention is a terminal device that communicates with a removable peripheral device, and is activated when the peripheral device is attached, An interface circuit that transmits and receives signals to and from the device, and a communication control unit that recognizes the peripheral device when the interface circuit is activated, and controls communication between the recognized peripheral device and the terminal device. The communication control unit detects whether or not communication with the peripheral device is possible. When detecting that communication is not possible, the communication control unit stops the interface circuit and then restarts the interface circuit.

(4)上記課題を解決するために、この発明のある局面に係わる通信プログラムは、取り外し可能な周辺機器との通信を行う端末装置において用いられる通信プラグラムであって、前記端末装置は、前記周辺機器との間で信号を送受信するインタフェース回路を備え、前記通信プログラムは、コンピュータに、前記周辺機器が取り付けられると前記インタフェース回路を起動させるステップと、前記インタフェース回路が起動すると前記周辺機器を認識するステップと、前記周辺機器との通信の可否を検知し、通信が可能ではないことを検知した場合、前記インタフェース回路を停止させるステップと、前記インタフェース回路を再起動させるステップとを実行させるためのプログラムである。   (4) In order to solve the above problem, a communication program according to an aspect of the present invention is a communication program used in a terminal device that communicates with a removable peripheral device, and the terminal device includes the peripheral device An interface circuit for transmitting and receiving signals to and from the device, wherein the communication program activates the interface circuit when the peripheral device is attached to a computer; and recognizes the peripheral device when the interface circuit is activated A program for executing a step, and a step of stopping the interface circuit and a step of restarting the interface circuit when it is detected whether communication with the peripheral device is possible and communication is not possible It is.

本発明によれば、特別な部品を周辺機器に設けることなく、当該周辺機器との通信エラーが生じた場合にユーザの手を煩わすことなく通信を再開することができる。   According to the present invention, communication can be resumed without bothering a user when a communication error with the peripheral device occurs without providing a special component in the peripheral device.

図1は、本発明の実施の形態に係る端末装置のソフトウェア構成およびインタフェース構成を示す図である。FIG. 1 is a diagram showing a software configuration and an interface configuration of a terminal device according to an embodiment of the present invention. 図2は、本発明の実施の形態に係る端末装置と周辺機器との通信動作の手順を定めたシーケンス図である。FIG. 2 is a sequence diagram that defines the procedure of the communication operation between the terminal device and the peripheral device according to the embodiment of the present invention.

最初に、本発明の実施形態の端末装置及び通信プログラムを列記して説明する。   First, the terminal device and the communication program according to the embodiment of the present invention will be listed and described.

(1)端末装置は、取り外し可能な周辺機器との通信を行う端末装置であって、前記周辺機器が取り付けられると起動し、前記周辺機器との間で信号を送受信するインタフェース回路と、前記インタフェース回路が起動すると前記周辺機器を認識し、認識した前記周辺機器と自己の前記端末装置との通信の制御を行う通信制御部とを備え、前記通信制御部は、前記周辺機器との通信の可否を検知し、通信が可能ではないことを検知した場合、前記インタフェース回路を停止させた後、前記インタフェース回路を再起動させる。   (1) The terminal device is a terminal device that communicates with a removable peripheral device. The terminal device is activated when the peripheral device is attached, and transmits and receives signals to and from the peripheral device; and the interface A communication control unit that recognizes the peripheral device when the circuit is activated and controls communication between the recognized peripheral device and its own terminal device, and the communication control unit determines whether or not communication with the peripheral device is possible When it is detected that communication is not possible, the interface circuit is stopped and then the interface circuit is restarted.

このように、端末装置側で通信エラーを検知し、インタフェース回路を再起動させる構成により、周辺機器を取り外さなくても、当該周辺機器を取り外して再び取り付けた場合と同様に、当該周辺機器の再認識が行われる。これにより、特別な部品を周辺機器に設けることなく、当該周辺機器との通信エラーが生じた場合にユーザの手を煩わすことなく通信を再開することができる。   In this way, by detecting a communication error on the terminal device side and restarting the interface circuit, the peripheral device can be restarted in the same manner as when the peripheral device is removed and reinstalled without removing the peripheral device. Recognition is performed. Accordingly, communication can be resumed without bothering the user when a communication error with the peripheral device occurs without providing a special component in the peripheral device.

(2)また、前記通信制御部は、前記周辺機器との通信が可能ではない場合、前記インタフェース回路の停止要求を出力する管理部と、前記管理部から前記停止要求を受けて、前記インタフェース回路を停止させる制御および再起動させる制御を行う回路制御部とを含む。   (2) When the communication control unit is not capable of communicating with the peripheral device, the communication control unit outputs a stop request for the interface circuit, and receives the stop request from the management unit. And a circuit control unit that performs control for stopping and restarting.

このような構成により、通信制御部において適切な役割分担を行い、通信制御部における各ユニットの処理を簡易化することができる。   With such a configuration, it is possible to perform appropriate division of roles in the communication control unit and simplify processing of each unit in the communication control unit.

(3)また、前記通信制御部は、OS(Operating System)によって実現され、前記管理部は、前記OSにおけるカーネルであり、前記回路制御部は、前記OSにおけるデーモンである。   (3) The communication control unit is realized by an OS (Operating System), the management unit is a kernel in the OS, and the circuit control unit is a daemon in the OS.

このように、通信制御部がソフトウェアによって実現されることにより、本発明における端末装置の管理部および回路制御部による機能を、既存の端末装置に対して容易に適用させることができる。また、インタフェース回路を停止および再起動させるための制御をデーモンが担うことにより、デーモンの処理をカーネルに対するバックグラウンド処理として扱うことも可能となる、すなわち、カーネルにかかる負荷を軽減させることができる。   Thus, by realizing the communication control unit by software, the functions of the management unit and the circuit control unit of the terminal device according to the present invention can be easily applied to the existing terminal device. In addition, since the daemon takes control for stopping and restarting the interface circuit, the daemon processing can be handled as background processing for the kernel, that is, the load on the kernel can be reduced.

(4)通信プログラムは、取り外し可能な周辺機器との通信を行う端末装置において用いられる通信プラグラムであって、前記端末装置は、前記周辺機器との間で信号を送受信するインタフェース回路を備え、前記通信プログラムは、コンピュータに、前記周辺機器が取り付けられると前記インタフェース回路を起動させるステップと、前記インタフェース回路が起動すると前記周辺機器を認識するステップと、前記周辺機器との通信の可否を検知し、通信が可能ではないことを検知した場合、前記インタフェース回路を停止させるステップと、前記インタフェース回路を再起動させるステップとを実行させるためのプログラムである。   (4) The communication program is a communication program used in a terminal device that performs communication with a removable peripheral device, and the terminal device includes an interface circuit that transmits and receives signals to and from the peripheral device, The communication program detects, in the computer, the step of activating the interface circuit when the peripheral device is attached, the step of recognizing the peripheral device when the interface circuit is activated, and the availability of communication with the peripheral device, A program for executing a step of stopping the interface circuit and a step of restarting the interface circuit when it is detected that communication is not possible.

このように、端末装置側で通信エラーを検知し、インタフェース回路を再起動させる構成により、周辺機器を取り外さなくても、当該周辺機器を取り外して再び取り付けた場合と同様に、当該周辺機器の再認識が行われる。これにより、特別な部品を周辺機器に設けることなく、当該周辺機器との通信エラーが生じた場合にユーザの手を煩わすことなく通信を再開することができる。   In this way, by detecting a communication error on the terminal device side and restarting the interface circuit, the peripheral device can be restarted in the same manner as when the peripheral device is removed and reinstalled without removing the peripheral device. Recognition is performed. Accordingly, communication can be resumed without bothering the user when a communication error with the peripheral device occurs without providing a special component in the peripheral device.

以下、本発明の実施の形態について図面を用いて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰り返さない。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated.

[構成および基本動作]
図1は、本発明の実施の形態に係る端末装置のソフトウェア構成およびインタフェース構成を示す図である。
[Configuration and basic operation]
FIG. 1 is a diagram showing a software configuration and an interface configuration of a terminal device according to an embodiment of the present invention.

図1を参照して、本発明の実施の形態に係る端末装置101は、たとえば、宅内に設けられる1または複数の電気機器と接続され、各電気機器における消費電力の管理を行うためのホームゲートウェイ等の情報処理装置である。   Referring to FIG. 1, terminal device 101 according to an embodiment of the present invention is connected to, for example, one or a plurality of electric devices provided in a home, and manages a power consumption in each electric device. And the like.

端末装置101は、インタフェース部11を備え、インタフェース部11は、ソケット21と、インタフェース回路22とを含む。また、端末装置101のソフトウェアは、OS(Operating System)(通信制御部)12と、アプリケーション13と、ドライバ14とを備える。OS12は、たとえばLinux(登録商標)であり、カーネル(管理部)24と、デーモン(回路制御部)25とを含む。   The terminal device 101 includes an interface unit 11, and the interface unit 11 includes a socket 21 and an interface circuit 22. Further, the software of the terminal device 101 includes an OS (Operating System) (communication control unit) 12, an application 13, and a driver 14. The OS 12 is, for example, Linux (registered trademark), and includes a kernel (management unit) 24 and a daemon (circuit control unit) 25.

インタフェース部11において、ソケット21には、USB(Universal Serial Bus)メモリなど、USB通信規格に対応した取り外し可能な周辺機器102が取り付けられる。インタフェース回路22は、ソケット21に周辺機器102が取り付けられると起動する。   In the interface unit 11, a removable peripheral device 102 corresponding to the USB communication standard such as a USB (Universal Serial Bus) memory is attached to the socket 21. The interface circuit 22 is activated when the peripheral device 102 is attached to the socket 21.

ここで、ソケット21に周辺機器102が取り付けられることにより、インタフェース回路22と周辺機器102とは、USB通信規格に準拠した接続ケーブルを介して接続される。そして、インタフェース回路22と周辺機器102とは、この接続ケーブルにおける「D+ライン」および「D−ライン」の2本の信号ラインを用いて信号の送受信を行う。   Here, by attaching the peripheral device 102 to the socket 21, the interface circuit 22 and the peripheral device 102 are connected via a connection cable compliant with the USB communication standard. The interface circuit 22 and the peripheral device 102 transmit and receive signals using two signal lines of “D + line” and “D− line” in the connection cable.

これら「D+ライン」および「D−ライン」は、インタフェース回路22側においてグランド(GND)に接続されているため、ソケット21に周辺機器102が取り付けられていない場合には、「D+ライン」および「D−ライン」がローレベルの状態となる。一方、ソケット21に周辺機器102が取り付けられると、「D+ライン」または「D−ライン」がハイレベルの状態となる。   Since these “D + line” and “D− line” are connected to the ground (GND) on the interface circuit 22 side, when the peripheral device 102 is not attached to the socket 21, the “D + line” and “D + line” The “D-line” is in a low level state. On the other hand, when the peripheral device 102 is attached to the socket 21, the “D + line” or “D− line” is in a high level state.

このため、インタフェース回路22は、「D+ライン」または「D−ライン」がハイレベルの状態であることを検出することにより、ソケット21に周辺機器102が取り付けられたことを検出して起動する。そして、周辺機器102は、インタフェース回路22が起動すると、ソケット21を介してインタフェース回路22側から電源供給を受ける。   For this reason, the interface circuit 22 is activated by detecting that the peripheral device 102 is attached to the socket 21 by detecting that the “D + line” or the “D− line” is in a high level state. The peripheral device 102 receives power supply from the interface circuit 22 side via the socket 21 when the interface circuit 22 is activated.

アプリケーション13は、たとえば、電気機器において使用されている使用電力量を示す情報を取得し、取得した情報に基づいて統計情報を作成する電力監視バンドル、または、電気機器と接続してホームセキュリティ機能をユーザに提供するホームセキュリティバンドルなどである。   For example, the application 13 acquires information indicating the amount of power used in the electric device, and creates a statistical information based on the acquired information, or connects to the electric device to provide a home security function. Home security bundles provided to users.

ドライバ14は、インタフェース回路22が起動したことを検出すると、ソケット21に取り付けられている周辺機器102を認識し、認識した周辺機器102に対する各種設定を行う。   When the driver 14 detects that the interface circuit 22 is activated, the driver 14 recognizes the peripheral device 102 attached to the socket 21 and performs various settings for the recognized peripheral device 102.

具体的には、ドライバ14は、ソケット21およびインタフェース回路22を介して、設定要求を周辺機器102へ送信する。そして、ドライバ14は、周辺機器102から設定要求に対する応答信号を受信すると、たとえば端末装置101の保有する複数のアドレスのうち使用されていないアドレスを特定し、特定したアドレスを用いて信号の送受信を行うことを指示するセットアップ要求を、周辺機器102へ送信する。   Specifically, the driver 14 transmits a setting request to the peripheral device 102 via the socket 21 and the interface circuit 22. When the driver 14 receives a response signal to the setting request from the peripheral device 102, for example, the driver 14 specifies an unused address among a plurality of addresses held by the terminal device 101, and transmits / receives a signal using the specified address. A setup request instructing to be transmitted is transmitted to the peripheral device 102.

そして、ドライバ14と周辺機器102とは、ドライバ14により特定されたアドレスを用いて、たとえば端末装置101側のリソースに関する情報など各種情報の送受信を行い、ドライバ14と周辺機器102との各種設定が完了する。   The driver 14 and the peripheral device 102 use the address specified by the driver 14 to transmit and receive various information such as information related to resources on the terminal device 101 side, and various settings between the driver 14 and the peripheral device 102 are made. Complete.

また、ドライバ14は、各種設定が行われた後の周辺機器102との通信の可否を検知する。すなわち、ドライバ14との間で各種設定が行われた周辺機器102であっても、静電気の発生等の影響で、端末装置101と周辺機器102との通信エラーが生じることがある。このため、ドライバ14は、端末装置101と周辺機器102との通信の可否を、たとえば定期的に検知する。   Further, the driver 14 detects whether or not communication with the peripheral device 102 after various settings are performed. That is, even in the peripheral device 102 in which various settings have been performed with the driver 14, a communication error between the terminal device 101 and the peripheral device 102 may occur due to the influence of static electricity. For this reason, the driver 14 periodically detects whether communication between the terminal device 101 and the peripheral device 102 is possible, for example.

具体的には、ドライバ14は、ソケット21およびインタフェース回路22を介して、周辺機器102へ通信エラーの検知のための信号を送信し、送信してから所定時間内にこの信号に対する応答信号を受信するか否かを検知する。そして、ドライバ14は、上記所定時間内に応答信号を受信しない場合、周辺機器102との通信が可能ではないこと、すなわち通信エラーが生じていることを示す検知結果をカーネル24へ出力する。   Specifically, the driver 14 transmits a signal for detecting a communication error to the peripheral device 102 via the socket 21 and the interface circuit 22, and receives a response signal for the signal within a predetermined time after the transmission. Detect whether to do. When the driver 14 does not receive a response signal within the predetermined time, the driver 14 outputs a detection result indicating that communication with the peripheral device 102 is not possible, that is, a communication error has occurred, to the kernel 24.

一方、ドライバ14は、上記所定時間内に応答信号を受信した場合、周辺機器102との通信が可能であること、すなわち通信エラーが生じていないことを示す検知結果をカーネル24へ出力する。   On the other hand, when the driver 14 receives the response signal within the predetermined time, the driver 14 outputs a detection result to the kernel 24 indicating that communication with the peripheral device 102 is possible, that is, no communication error has occurred.

OS12において、カーネル24は、たとえばLinux(登録商標)カーネルであり、デーモン25など、OS12に設けられた1または複数のソフトウェアモジュールの管理を行う。たとえば、カーネル24は、通信エラーが生じていることを示す検知結果をドライバ14から受けると、インタフェース回路22の停止要求をデーモン25へ出力する。   In the OS 12, the kernel 24 is, for example, a Linux (registered trademark) kernel, and manages one or a plurality of software modules provided in the OS 12 such as the daemon 25. For example, when the kernel 24 receives a detection result indicating that a communication error has occurred from the driver 14, the kernel 24 outputs a stop request for the interface circuit 22 to the daemon 25.

デーモン25は、たとえばLinux(登録商標)カーネル用のデバイス管理ツールであるudevである。デーモン25は、カーネル24からインタフェース回路22の停止要求を受けた場合、インタフェース回路22を停止させるための制御信号(以下、「停止制御信号」とも称する)をドライバ14へ出力する。そして、ドライバ14は、デーモン25から停止制御信号を受けると、インタフェース回路22を停止させる。   The daemon 25 is udev which is a device management tool for a Linux (registered trademark) kernel, for example. When the daemon 25 receives a request to stop the interface circuit 22 from the kernel 24, the daemon 25 outputs a control signal for stopping the interface circuit 22 (hereinafter also referred to as “stop control signal”) to the driver 14. When the driver 14 receives the stop control signal from the daemon 25, the driver 14 stops the interface circuit 22.

また、デーモン25は、停止制御信号を出力してから例えば所定時間経過後、インタフェース回路22を再起動させるための制御信号(以下、「再起動制御信号」とも称する)をドライバ14へ出力する。そして、ドライバ14は、デーモン25から再起動制御信号を受けると、インタフェース回路22を再起動させる。そして、ドライバ14は、インタフェース回路22が再起動すると、ソケット21に新たに周辺機器102が取り付けられた場合と同様に、周辺機器102の認識および各種設定を再び行う。   Further, the daemon 25 outputs a control signal (hereinafter also referred to as “restart control signal”) for restarting the interface circuit 22 to the driver 14 after a predetermined time elapses after outputting the stop control signal. When the driver 14 receives the restart control signal from the daemon 25, the driver 14 restarts the interface circuit 22. Then, when the interface circuit 22 is restarted, the driver 14 recognizes the peripheral device 102 and performs various settings again in the same manner as when the peripheral device 102 is newly attached to the socket 21.

なお、本発明の実施の形態による端末装置101では、ドライバ14が端末装置101と周辺機器102との通信の可否を検知する構成であるが、このような通信の可否の検知は、たとえばカーネル24により行われても良い。   In the terminal device 101 according to the embodiment of the present invention, the driver 14 is configured to detect whether or not the communication between the terminal device 101 and the peripheral device 102 is possible. May be performed.

[動作]
次に、本発明の実施の形態に係る端末装置101と周辺機器102との通信動作について説明する。
[Operation]
Next, communication operation between the terminal device 101 and the peripheral device 102 according to the embodiment of the present invention will be described.

端末装置101および周辺機器102の各々は、以下に示すシーケンスの各ステップを含むプログラムを図示しないメモリから読み出して実行する。これらのプログラムは、外部からインストールすることができる。このインストールされるプログラムは、たとえば記録媒体に格納された状態で流通する。   Each of the terminal device 101 and the peripheral device 102 reads and executes a program including each step of the following sequence from a memory (not shown). These programs can be installed from the outside. The installed program is distributed in a state stored in a recording medium, for example.

図2は、本発明の第1の実施の形態に係る端末装置と周辺機器との通信動作の手順を定めたシーケンス図である。   FIG. 2 is a sequence diagram that defines the procedure of the communication operation between the terminal device and the peripheral device according to the first embodiment of the present invention.

図2を参照して、まず、端末装置101のソケット21に周辺機器102が取り付けられると、「D+ライン」または「D−ライン」がハイレベルの状態となり(ステップS11)、インタフェース回路22は、この状態を検出すると起動する(ステップS12)。   Referring to FIG. 2, first, when the peripheral device 102 is attached to the socket 21 of the terminal device 101, the “D + line” or “D− line” is in a high level state (step S <b> 11), and the interface circuit 22 When this state is detected, it is activated (step S12).

次に、ドライバ14は、インタフェース回路22が起動したことを検出すると、周辺機器102を認識し、認識した周辺機器102に対する各種設定を行う(ステップS13)。そして、ドライバ14は、周辺機器102との通信の可否を検知して(ステップS14)、検知結果をカーネル24へ出力する(ステップS15)。   Next, when detecting that the interface circuit 22 is activated, the driver 14 recognizes the peripheral device 102 and performs various settings for the recognized peripheral device 102 (step S13). Then, the driver 14 detects whether communication with the peripheral device 102 is possible (step S14), and outputs the detection result to the kernel 24 (step S15).

次に、カーネル24は、通信エラーが生じていないことを示す検知結果を受けた場合(ステップS16において「No」)、「add通知」をデーモン25へ出力する(ステップS17)。そして、端末装置101と周辺機器102とは通信を継続し、ドライバ14による通信の可否の検知(ステップS13)およびステップS14からステップS17までの動作が繰り返し行われる。   Next, when receiving a detection result indicating that no communication error has occurred (“No” in step S16), the kernel 24 outputs “add notification” to the daemon 25 (step S17). The terminal device 101 and the peripheral device 102 continue to communicate, and the driver 14 detects whether communication is possible (step S13) and repeats the operations from step S14 to step S17.

一方、カーネル24は、通信エラーが生じていることを示す検知結果を受けた場合(ステップS16において「Yes」)、インタフェース回路22の停止要求である「remove通知」をデーモン25へ出力する(ステップS18)。   On the other hand, when receiving a detection result indicating that a communication error has occurred (“Yes” in step S16), the kernel 24 outputs a “remove notification” that is a request to stop the interface circuit 22 to the daemon 25 (step S16). S18).

そして、デーモン25は、カーネル24から「remove通知」を受けると、停止制御信号をドライバ14へ出力する(ステップS19)。次に、ドライバ14は、デーモン25から受けた停止制御信号に従い、インタフェース回路22を停止させる(ステップS20およびステップS21)。   When receiving the “remove notification” from the kernel 24, the daemon 25 outputs a stop control signal to the driver 14 (step S19). Next, the driver 14 stops the interface circuit 22 according to the stop control signal received from the daemon 25 (step S20 and step S21).

次に、デーモン25は、たとえば停止制御信号を出力してから所定時間経過後、再起動制御信号をドライバ14へ出力する(ステップS22)。そして、ドライバ14は、デーモン25から受けた再起動制御信号に従い、インタフェース回路22を再起動させる(ステップS23およびステップS24)。   Next, for example, the daemon 25 outputs a restart control signal to the driver 14 after a predetermined time has elapsed since the stop control signal was output (step S22). Then, the driver 14 restarts the interface circuit 22 according to the restart control signal received from the daemon 25 (Step S23 and Step S24).

そして、ドライバ14は、インタフェース回路22が再起動すると、周辺機器102の認識を再び行い(ステップS25)、上述したステップS14以降の動作と同様の動作が繰り返し行われる。   Then, when the interface circuit 22 is restarted, the driver 14 recognizes the peripheral device 102 again (step S25), and the same operations as those after step S14 described above are repeated.

なお、ドライバ14による周辺機器102の認識および各種設定(ステップS13)が行われた後に、たとえばユーザにより周辺機器102がソケット21から取り外されることがある。このような場合、ドライバ14は、通信の可否の検知、すなわち通信エラーが生じているか否かの検知(ステップS14)において、通信エラーの検知のために周辺機器102へ送信する信号、に対する応答信号を周辺機器102から受信することができないため、通信エラーが生じていることを示す検知結果をカーネル24へ出力する(ステップS15)。   Note that the peripheral device 102 may be removed from the socket 21 by the user, for example, after the driver 14 recognizes the peripheral device 102 and performs various settings (step S13). In such a case, the driver 14 responds to a signal transmitted to the peripheral device 102 for detecting a communication error in detecting whether communication is possible, that is, detecting whether a communication error has occurred (step S14). Cannot be received from the peripheral device 102, a detection result indicating that a communication error has occurred is output to the kernel 24 (step S15).

そして、カーネル24から「remove通知」が出力され、インタフェース回路22の停止および再起動が行われて、ドライバ14は、周辺機器102の認識および各種設定を再び行う(ステップS16、および、ステップS18からステップS25)。   Then, “remove notification” is output from the kernel 24, the interface circuit 22 is stopped and restarted, and the driver 14 recognizes the peripheral device 102 and performs various settings again (from step S16 and step S18). Step S25).

しかしながら、ソケット21には周辺機器102が取り付けられていないため、ドライバ14は、周辺機器102に対する各種設定において設定要求に対する応答信号を周辺機器102から受信することができない。このため、このような場合、ドライバ14は、たとえばソケット21に周辺機器102が取り付けられていないことを示すエラー通知をカーネル24へ出力する。そして、カーネル24は、エラー通知を受けると、端末装置101と周辺機器102との通信動作を終了させる。   However, since the peripheral device 102 is not attached to the socket 21, the driver 14 cannot receive a response signal for a setting request from the peripheral device 102 in various settings for the peripheral device 102. Therefore, in such a case, the driver 14 outputs an error notification indicating that the peripheral device 102 is not attached to the socket 21 to the kernel 24, for example. When receiving the error notification, the kernel 24 ends the communication operation between the terminal device 101 and the peripheral device 102.

ところで、特許文献1に記載の技術では、周辺機器であるUSB通信デバイスに電子スイッチなどの部品を別途設ける必要があり、このような電子スイッチ等が設けられていない既存の周辺機器に対して特許文献1に記載の技術を適用させることは困難である。   By the way, in the technique described in Patent Document 1, it is necessary to separately provide a component such as an electronic switch in a USB communication device that is a peripheral device. It is difficult to apply the technique described in Document 1.

これに対して、本発明の実施の形態に係る端末装置101では、インタフェース回路22は、周辺機器102が取り付けられると起動し、周辺機器102との間で信号を送受信する。また、通信制御部12は、インタフェース回路22が起動すると周辺機器102を認識し、認識した周辺機器102と自己の端末装置101との通信の制御を行う。また、通信制御部12は、周辺機器102との通信の可否を検知し、通信が可能ではないことを検知した場合、インタフェース回路22を停止させた後、インタフェース回路22を再起動させる。   On the other hand, in the terminal device 101 according to the embodiment of the present invention, the interface circuit 22 is activated when the peripheral device 102 is attached, and transmits / receives a signal to / from the peripheral device 102. Further, the communication control unit 12 recognizes the peripheral device 102 when the interface circuit 22 is activated, and controls communication between the recognized peripheral device 102 and its own terminal device 101. In addition, the communication control unit 12 detects whether communication with the peripheral device 102 is possible. If the communication control unit 12 detects that communication is not possible, the communication control unit 12 stops the interface circuit 22 and then restarts the interface circuit 22.

このように、端末装置101側で通信エラーを検知し、インタフェース回路22を再起動させる構成により、周辺機器102を取り外さなくても、周辺機器102を取り外して再び取り付けた場合と同様に、当該周辺機器102の再認識が行われる。これにより、特別な部品を周辺機器102に設けることなく、当該周辺機器102との通信エラーが生じた場合にユーザの手を煩わすことなく通信を再開することができる。   In this way, by detecting the communication error on the terminal device 101 side and restarting the interface circuit 22, the peripheral device 102 can be removed and reattached without removing the peripheral device 102, as in the case of the peripheral device 102. The device 102 is re-recognized. Thereby, communication can be resumed without bothering the user when a communication error with the peripheral device 102 occurs without providing a special component in the peripheral device 102.

また、本発明の実施の形態に係る端末装置101では、通信制御部12は、周辺機器102との通信が可能ではない場合、インタフェース回路22の停止要求である「remove通知」を出力する管理部24と、管理部24から「remove通知」を受けて、インタフェース回路22を停止させる制御および再起動させる制御を行う回路制御部25とを含む。   In the terminal device 101 according to the embodiment of the present invention, the communication control unit 12 outputs a “remove notification” that is a request to stop the interface circuit 22 when communication with the peripheral device 102 is not possible. 24, and a circuit control unit 25 that receives the “remove notification” from the management unit 24 and performs control to stop and restart the interface circuit 22.

このような構成により、通信制御部12において適切な役割分担を行い、通信制御部12における各ユニットの処理を簡易化することができる。   With such a configuration, it is possible to perform appropriate role assignment in the communication control unit 12 and simplify processing of each unit in the communication control unit 12.

また、本発明の実施の形態に係る端末装置101では、通信制御部12は、OSによって実現され、管理部24は、OS12におけるカーネルであり、回路制御部25は、OS12におけるデーモン25である。   In the terminal device 101 according to the embodiment of the present invention, the communication control unit 12 is realized by an OS, the management unit 24 is a kernel in the OS 12, and the circuit control unit 25 is a daemon 25 in the OS 12.

このように、通信制御部12がソフトウェアによって実現されることにより、本発明における端末装置101の管理部24および回路制御部25による機能を、既存の端末装置に対して容易に適用させることができる。また、インタフェース回路22を停止および再起動させるための制御をデーモン25が担うことにより、デーモン25の処理をカーネル24に対するバックグラウンド処理として扱うことも可能となる、すなわち、カーネル24にかかる負荷を軽減させることができる。   Thus, by realizing the communication control unit 12 by software, the functions of the management unit 24 and the circuit control unit 25 of the terminal device 101 according to the present invention can be easily applied to existing terminal devices. . In addition, since the daemon 25 takes control for stopping and restarting the interface circuit 22, the processing of the daemon 25 can be handled as background processing for the kernel 24, that is, the load on the kernel 24 is reduced. Can be made.

上記実施の形態は、すべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記説明ではなく特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The above embodiment should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

11 インタフェース部
12 OS(通信制御部)
13 アプリケーション
14 ドライバ
21 ソケット
22 インタフェース回路
24 カーネル(管理部)
25 デーモン(回路制御部)
101 端末装置
102 周辺機器
11 Interface unit 12 OS (communication control unit)
13 Application 14 Driver 21 Socket 22 Interface circuit 24 Kernel (Management part)
25 Daemon (circuit control unit)
101 Terminal device 102 Peripheral device

Claims (4)

取り外し可能な周辺機器との通信を行う端末装置であって、
前記周辺機器が取り付けられると起動し、前記周辺機器との間で信号を送受信するインタフェース回路と、
前記インタフェース回路が起動すると前記周辺機器を認識し、認識した前記周辺機器と自己の前記端末装置との通信の制御を行う通信制御部とを備え、
前記通信制御部は、前記周辺機器との通信の可否を検知し、通信が可能ではないことを検知した場合、前記インタフェース回路を停止させた後、前記インタフェース回路を再起動させる、端末装置。
A terminal device that communicates with a removable peripheral device,
An interface circuit that is activated when the peripheral device is attached, and that transmits and receives signals to and from the peripheral device;
A communication control unit for recognizing the peripheral device when the interface circuit is activated, and controlling communication between the recognized peripheral device and the terminal device of its own;
The terminal device, wherein the communication control unit detects whether communication with the peripheral device is possible and, when detecting that communication is not possible, stops the interface circuit and then restarts the interface circuit.
前記通信制御部は、
前記周辺機器との通信が可能ではない場合、前記インタフェース回路の停止要求を出力する管理部と、
前記管理部から前記停止要求を受けて、前記インタフェース回路を停止させる制御および再起動させる制御を行う回路制御部とを含む、請求項1に記載の端末装置。
The communication control unit
When communication with the peripheral device is not possible, a management unit that outputs a stop request for the interface circuit;
The terminal device according to claim 1, further comprising: a circuit control unit that receives the stop request from the management unit and performs control to stop and restart the interface circuit.
前記通信制御部は、OS(Operating System)によって実現され、
前記管理部は、前記OSにおけるカーネルであり、
前記回路制御部は、前記OSにおけるデーモンである、請求項2に記載の端末装置。
The communication control unit is realized by an OS (Operating System),
The management unit is a kernel in the OS,
The terminal device according to claim 2, wherein the circuit control unit is a daemon in the OS.
取り外し可能な周辺機器との通信を行う端末装置において用いられる通信プラグラムであって、
前記端末装置は、前記周辺機器との間で信号を送受信するインタフェース回路を備え、
前記通信プログラムは、
コンピュータに、
前記周辺機器が取り付けられると前記インタフェース回路を起動させるステップと、
前記インタフェース回路が起動すると前記周辺機器を認識するステップと、
前記周辺機器との通信の可否を検知し、通信が可能ではないことを検知した場合、前記インタフェース回路を停止させるステップと、
前記インタフェース回路を再起動させるステップとを実行させるための、通信プログラム。
A communication program used in a terminal device that communicates with a removable peripheral device,
The terminal device includes an interface circuit that transmits and receives signals to and from the peripheral device,
The communication program is
On the computer,
Activating the interface circuit when the peripheral device is attached;
Recognizing the peripheral device when the interface circuit is activated;
Detecting whether communication with the peripheral device is possible, and detecting that communication is not possible, stopping the interface circuit;
A communication program for executing the step of restarting the interface circuit.
JP2013085933A 2013-04-16 2013-04-16 Terminal device and communication program Pending JP2014209282A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013085933A JP2014209282A (en) 2013-04-16 2013-04-16 Terminal device and communication program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013085933A JP2014209282A (en) 2013-04-16 2013-04-16 Terminal device and communication program

Publications (1)

Publication Number Publication Date
JP2014209282A true JP2014209282A (en) 2014-11-06

Family

ID=51903480

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013085933A Pending JP2014209282A (en) 2013-04-16 2013-04-16 Terminal device and communication program

Country Status (1)

Country Link
JP (1) JP2014209282A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021018562A (en) * 2019-07-19 2021-02-15 セイコーエプソン株式会社 Method for controlling information processing apparatus, program, and communication system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007156921A (en) * 2005-12-06 2007-06-21 Y E Data Inc Failure detection/recovery system of usb device, program thereof, recording medium with the program recorded thereon, and failure detection/recovery method
JP2013008220A (en) * 2011-06-24 2013-01-10 Brother Ind Ltd Device control system and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007156921A (en) * 2005-12-06 2007-06-21 Y E Data Inc Failure detection/recovery system of usb device, program thereof, recording medium with the program recorded thereon, and failure detection/recovery method
JP2013008220A (en) * 2011-06-24 2013-01-10 Brother Ind Ltd Device control system and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021018562A (en) * 2019-07-19 2021-02-15 セイコーエプソン株式会社 Method for controlling information processing apparatus, program, and communication system
JP7287161B2 (en) 2019-07-19 2023-06-06 セイコーエプソン株式会社 Information processing device control method, program, and communication system

Similar Documents

Publication Publication Date Title
US9563442B2 (en) Baseboard management controller and method of loading firmware
US20120290761A1 (en) USB Converter and Related Method
WO2017172014A1 (en) Usb interface using repeaters with guest protocol support
US20170153680A1 (en) Power Management System and Method
JP5330348B2 (en) Motherboard adapted for fast charging of portable multimedia devices
US10042800B2 (en) Active USB device and switching method for operating mode thereof
TWI598815B (en) A bridge module for updating basic input/output system and updating method thereof
EP3674904B1 (en) Electronic device having type c usb interface, control method for type c usb interface, and storage medium
JP6725840B2 (en) Function expansion device, information processing system, and control program for function expansion device
US11175715B2 (en) Method of supplying electric power to a computer system
KR20190047526A (en) A method for performing communication via input output interface and a method thereof
KR101097556B1 (en) Power control for serial bus peripheral device
EP3812909B1 (en) Terminal, and type c interface anti-corrosion method
TWI528161B (en) Data transmitting system and data transmitting method
JP4646859B2 (en) USB device and USB connection system
US20150319327A1 (en) Information processing apparatus, method of controlling the same, and storage medium
JP2014209282A (en) Terminal device and communication program
JP2013045354A (en) Printer device, communication system, and communication method
US20170099401A1 (en) Information processing apparatus, information processing system, method of controlling the information processing apparatus, and storage medium
US10860789B2 (en) Management of multiple interface ports
US9423850B2 (en) System and method of power control for embedded systems without advanced configuration and power interface (ACPI)
JP2016218943A (en) Communication device, communication control method, and communication control program
WO2015151169A1 (en) Control device and electronic apparatus
CN105867954B (en) system data updating method, electronic equipment and system
US10235311B2 (en) Data acquisition system, electronic device, and data acquisition terminal

Legal Events

Date Code Title Description
A625 Written request for application examination (by other person)

Free format text: JAPANESE INTERMEDIATE CODE: A625

Effective date: 20160323

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20160408

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170131

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20170725