Le tastiere USB trasmettono solo segnali o le ricevono anche?

Sommario:

Le tastiere USB trasmettono solo segnali o le ricevono anche?
Le tastiere USB trasmettono solo segnali o le ricevono anche?

Video: Le tastiere USB trasmettono solo segnali o le ricevono anche?

Video: Le tastiere USB trasmettono solo segnali o le ricevono anche?
Video: BASH TRICKS: le scorciatoie da terminale che ti migliorano la vita - YouTube 2024, Aprile
Anonim
La maggior parte di noi non pensa mai alle nostre tastiere finché funzionano bene, ma se si sofferma a pensarci per un momento, inviano solo segnali ai nostri computer o c'è un processo attivo avanti e indietro sul lavoro? ? Il post di Q & A di SuperUser di oggi ha la risposta alla domanda di un lettore curioso.
La maggior parte di noi non pensa mai alle nostre tastiere finché funzionano bene, ma se si sofferma a pensarci per un momento, inviano solo segnali ai nostri computer o c'è un processo attivo avanti e indietro sul lavoro? ? Il post di Q & A di SuperUser di oggi ha la risposta alla domanda di un lettore curioso.

La sessione di domande e risposte di oggi ci viene fornita per gentile concessione di SuperUser, una suddivisione di Stack Exchange, un raggruppamento di domande e risposte basato sulla comunità.

La domanda

Lettore SuperUser Ne Mo vuole sapere se le tastiere USB inviano solo segnali o se li ricevono anche:

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?

Le tastiere USB inviano solo segnali o ricevono anche loro?

La risposta

Collaboratori SuperUser LawrenceC e Dmitry Grigoryev hanno la risposta per noi. Innanzitutto, 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

Seguito dalla risposta di Dmitry Grigoryev:

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.

Hai qualcosa da aggiungere alla spiegazione? Audio disattivato nei commenti. Vuoi leggere più risposte dagli altri utenti di Stack Exchange esperti di tecnologia? Controlla la discussione completa qui.

Immagine di credito: Luke Jones (Flickr)

Consigliato: