Aperçu technique - protocole

 

 

Généralités

Le protocole de communication USB est très simple, avec seulement une communication du périphérique vers le PC hôte (aucune transmission de données du PC vers le périphérique). Tous les transferts ont la même longueur de 8 octets. Ainsi, aucune action n'est possible sur les leds à partir du PC.

 

Chaque touche appuyée / relâchée provoque le changement d'un bit (1 / 0) dans le message de 8 octets, ces changements sont cumulés (OU logique). L'état vert / rouge des leds est disponible sur le bit 3 de l'octet 8. Les appuis / relâche des boutons leds sont également enregistrés sur les bits 2 / 1 de l'octet 8.

 

Table de correspondance entre messages de huit octets et numéro de touche

 

Touche  Séquence d'octets (hex)       Touche  Séquence d'octets (hex)

1      01 00 00 00 00 00 00 00         25     00 00 00 01 00 00 00 00
2      02 00 00 00 00 00 00 00         26     00 00 00 02 00 00 00 00
3      04 00 00 00 00 00 00 00         27     00 00 00 04 00 00 00 00
4      08 00 00 00 00 00 00 00         28     00 00 00 08 00 00 00 00
5      10 00 00 00 00 00 00 00         29     00 00 00 10 00 00 00 00
6      20 00 00 00 00 00 00 00         30     00 00 00 20 00 00 00 00
7      40 00 00 00 00 00 00 00         31     00 00 00 40 00 00 00 00
8      80 00 00 00 00 00 00 00         32     00 00 00 80 00 00 00 00
9      00 01 00 00 00 00 00 00         33     00 00 00 00 01 00 00 00
10     00 02 00 00 00 00 00 00         34     00 00 00 00 02 00 00 00
11     00 04 00 00 00 00 00 00         35     00 00 00 00 04 00 00 00
12     00 08 00 00 00 00 00 00         36     00 00 00 00 08 00 00 00
13     00 10 00 00 00 00 00 00         37     00 00 00 00 10 00 00 00
14     00 20 00 00 00 00 00 00         38     00 00 00 00 20 00 00 00
15     00 40 00 00 00 00 00 00         39     00 00 00 00 40 00 00 00
16     00 80 00 00 00 00 00 00         40     00 00 00 00 80 00 00 00
17     00 00 01 00 00 00 00 00         41     00 00 00 00 00 01 00 00
18     00 00 02 00 00 00 00 00         42     00 00 00 00 00 02 00 00
19     00 00 04 00 00 00 00 00         43     00 00 00 00 00 04 00 00
20     00 00 08 00 00 00 00 00         44     00 00 00 00 00 08 00 00
21     00 00 10 00 00 00 00 00         45     00 00 00 00 00 10 00 00
22     00 00 20 00 00 00 00 00         46     00 00 00 00 00 20 00 00
23     00 00 40 00 00 00 00 00         47     00 00 00 00 00 40 00 00
24     00 00 80 00 00 00 00 00         48     00 00 00 00 00 80 00 00

49     00 00 00 00 00 00 01 00         Vert   00 00 00 00 00 00 00 01
50     00 00 00 00 00 00 02 00         Rouge  00 00 00 00 00 00 00 02

Aucun bouton appuyé, état led verte           00 00 00 00 00 00 00 00
Aucun bouton appuyé, état led rouge           00 00 00 00 00 00 00 04