Os teclados USB só enviam sinais ou eles também os recebem?

Índice:

Os teclados USB só enviam sinais ou eles também os recebem?
Os teclados USB só enviam sinais ou eles também os recebem?

Vídeo: Os teclados USB só enviam sinais ou eles também os recebem?

Vídeo: Os teclados USB só enviam sinais ou eles também os recebem?
Vídeo: 30 Comandos do Terminal Linux BÁSICOS que você PRECISA SABER para ser um HACKER - YouTube 2024, Abril
Anonim
A maioria de nós nunca dá muita atenção aos nossos teclados enquanto eles funcionam bem, mas se você parar para pensar por um momento, eles só enviam sinais para nossos computadores ou há um processo ativo de ir e voltar no trabalho? ? A postagem de perguntas e respostas do SuperUser de hoje tem a resposta para a pergunta de um leitor curioso.
A maioria de nós nunca dá muita atenção aos nossos teclados enquanto eles funcionam bem, mas se você parar para pensar por um momento, eles só enviam sinais para nossos computadores ou há um processo ativo de ir e voltar no trabalho? ? A postagem de perguntas e respostas do SuperUser de hoje tem a resposta para a pergunta de um leitor curioso.

A sessão de perguntas e respostas de hoje nos é oferecida por cortesia do SuperUser, uma subdivisão do Stack Exchange, um agrupamento de sites de perguntas e respostas conduzido pela comunidade.

A questão

O leitor SuperUser Ne Mo quer saber se os teclados USB só enviam sinais ou se os recebem também:

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?

Os teclados USB só enviam sinais ou eles também os recebem?

A resposta

Os contribuidores do SuperUser LawrenceC e Dmitry Grigoryev têm a resposta para nós. Primeiro, 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

Seguido pela resposta 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.

Tem algo a acrescentar à explicação? Som desligado nos comentários. Quer ler mais respostas de outros usuários do Stack Exchange com experiência em tecnologia? Confira o tópico de discussão completo aqui.

Crédito de imagem: Luke Jones (Flickr)

Recomendado: