Les claviers USB n'envoient-ils que des signaux ou les reçoivent-ils aussi?

Table des matières:

Les claviers USB n'envoient-ils que des signaux ou les reçoivent-ils aussi?
Les claviers USB n'envoient-ils que des signaux ou les reçoivent-ils aussi?

Vidéo: Les claviers USB n'envoient-ils que des signaux ou les reçoivent-ils aussi?

Vidéo: Les claviers USB n'envoient-ils que des signaux ou les reçoivent-ils aussi?
Vidéo: Vous devriez connaître ces commandes Terminal ! (macOS & Linux) - YouTube 2024, Avril
Anonim
La plupart d'entre nous ne pensons jamais beaucoup à nos claviers dans la mesure où ils fonctionnent correctement, mais si vous vous arrêtez un instant, n'envoyez-vous que des signaux à nos ordinateurs ou existe-t-il un processus actif de va-et-vient ? L’article d’aujourd’hui sur le SuperUser Q & R répond aux questions d’un lecteur curieux.
La plupart d'entre nous ne pensons jamais beaucoup à nos claviers dans la mesure où ils fonctionnent correctement, mais si vous vous arrêtez un instant, n'envoyez-vous que des signaux à nos ordinateurs ou existe-t-il un processus actif de va-et-vient ? L’article d’aujourd’hui sur le SuperUser Q & R répond aux questions d’un lecteur curieux.

La séance de questions et réponses d’aujourd’hui nous est offerte par SuperUser, une sous-division de Stack Exchange, un groupe de sites Web de questions-réponses dirigé par la communauté.

La question

Le lecteur SuperUser Ne Mo veut savoir si les claviers USB envoient uniquement des signaux ou s'ils les reçoivent également:

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?

Les claviers USB envoient-ils uniquement des signaux ou les reçoivent-ils aussi?

La réponse

Les contributeurs du super-utilisateur, LawrenceC et Dmitry Grigoryev, ont la réponse pour nous. Tout d'abord, 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

Suivi de la réponse de 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.

Avez-vous quelque chose à ajouter à l'explication? Sound off dans les commentaires. Voulez-vous lire plus de réponses d'autres utilisateurs de Stack Exchange doués en technologie? Découvrez le fil de discussion complet ici.

Crédit d'image: Luke Jones (Flickr)

Conseillé: