Klávesnice USB odosielajú iba signály alebo ich prijímajú?

Obsah:

Klávesnice USB odosielajú iba signály alebo ich prijímajú?
Klávesnice USB odosielajú iba signály alebo ich prijímajú?

Video: Klávesnice USB odosielajú iba signály alebo ich prijímajú?

Video: Klávesnice USB odosielajú iba signály alebo ich prijímajú?
Video: Cloud Computing - Computer Science for Business Leaders 2016 - YouTube 2024, Apríl
Anonim
Väčšina z nás nikdy nevenuje veľkú pozornosť na našich klávesniciach, pokiaľ fungujú dobre, ale ak na chvíľu prestanete o tom premýšľať, posielajú iba signály do našich počítačov alebo je v práci aktívny proces spätného chodu ? Dnešný príspevok SuperUser Q & A má odpoveď na otázku zvedavého čitateľa.
Väčšina z nás nikdy nevenuje veľkú pozornosť na našich klávesniciach, pokiaľ fungujú dobre, ale ak na chvíľu prestanete o tom premýšľať, posielajú iba signály do našich počítačov alebo je v práci aktívny proces spätného chodu ? Dnešný príspevok SuperUser Q & A má odpoveď na otázku zvedavého čitateľa.

Dnešná relácia otázok a odpovedí sa k nám pridelí zdvorilosťou SuperUser - podskupiny Stack Exchange, skupín webových stránok týkajúcich sa otázok a odpovedí.

Otázka

Čítačka SuperUser Ne Mo chce vedieť, či klávesnice USB posielajú iba signály alebo ich tiež prijímajú:

A USB keyboard does not need to receive any signals from a computer, just power, right? Or does it need to receive signals as well as send them?

Klávesnice USB odosielajú iba signály alebo ich tiež prijímajú?

Odpoveď

Príslušníci SuperUser LawrenceC a Dmitrij Grigoryev majú odpoveď pre nás. Po prvé, LawrenceC:

From the “Device Class Definition for Human Interface Devices (HID)” specification:

To change the keyboard LEDs, the keyboard accepts a command to do so. So it is not an “input-only” device (meaning it only outputs data to the host). That being said, there is a negotiation and enumeration process with all USB devices that require a back-and-forth conversation between the host and the device. You cannot have a “read-only” USB device. Even before USB, the computer’s keyboard controller would accept commands because it did a few things besides read the keyboard (reference):
To change the keyboard LEDs, the keyboard accepts a command to do so. So it is not an “input-only” device (meaning it only outputs data to the host). That being said, there is a negotiation and enumeration process with all USB devices that require a back-and-forth conversation between the host and the device. You cannot have a “read-only” USB device. Even before USB, the computer’s keyboard controller would accept commands because it did a few things besides read the keyboard (reference):
Image
Image

Nasledovala odpoveď od Dmitrija Grigoryjeva:

Any USB device regardless of its class requires bidirectional communication to function. Every USB device (or function in terms of USB specifications) is represented as a set of endpoints which can be thought of as buffers which accept or receive data. However, even endpoints which can only send data wait for a special packet called a token before they can reply:

The gray boxes represent the USB host while the white boxes represent USB functions (chart source).
The gray boxes represent the USB host while the white boxes represent USB functions (chart source).

Even so-called interrupt transfers are done in this way, with the USB host polling connected devices using token packets. What differs between regular (bulk) transfers and interrupt transfers is that the polling time is small and guaranteed in the latter case. Still, all transfers are initiated by the host.

Máte niečo doplniť vysvetlenie? Znížte komentáre. Chcete si prečítať viac odpovedí od iných používateľov technológie Stack Exchange? Pozrite sa na celý diskusný príspevok tu.

Obrazový kredit: Luke Jones (Flickr)

Odporúča: