Bonjour à tous
J’ai un problème avec un RN42, firmware 6.15 en HID, et un pro mini 8 mhz en 3.3v.
Apres avoir lu la doc , lorsque j’envoie 2 caractères avec le code suivant :
shorthand(2,4,5);
delay(100);
shorthand(0,0);
delay(100);
void shorthand(uint8_t numcar, uint8_t keycode1, uint8_t keycode2 = 0, uint8_t keycode3 = 0, uint8_t keycode4 = 0, uint8_t keycode5 = 0, uint8_t keycode6 = 0) {
BT.write(0xFE); // our command
BT.write(numcar); // ! longueur
BT.write((byte)0x00); // 0x00
BT.write(keycode1); // key code #1
BT.write(keycode2); // key code #2
BT.write(keycode3); // key code #3
BT.write(keycode4); // key code #4
BT.write(keycode5); // key code #5
BT.write(keycode6); // key code #6
}
Je reçois bien « ab « .
Mais le problème est que si je veux envoyer juste après
shorthand(2,6,7);
delay(100);
shorthand(0,0);
delay(100);
je ne reçois que « ab »
je dois envoyer au pc une chaine de 8 caractères , donc je pensais envoyer deux fois 4 caractères :
shorthand(4,4,5,6,7);
delay(100);
shorthand(0,0);
delay(100);
shorthand(2,8,9,10,11);
delay(100);
shorthand(0,0);
delay(100);
je pense avoir suivi la doc :
The Roving Networks HID profile supports shorthand for implementing keyboards. The
advantage of this mode is that multiple keyboard keys can be sent with minimal characters over the UART, which optimizes bandwidth because the module does not have
to send a keyboard report. Shorthand reports start with 0xFE and have variable length.
The shorthand format is:
0xFE ,Length, Modifier, Scan Code 1, Scan Code 2,Scan Code 3,Scan Code 4,Scan Code 5, Scan Code 6
where Length = 0, 2, 3, 4, 5, 6, or 7, depending on how many keys are sent.
For example, shorthand for the a, b, and c keys is:
0xFE 0x3 0x0 0x4 0x05 0x06
The Bluetooth module converts this shorthand into the following raw HID reports that
are sent over the Bluetooth link:
Shorthand to release all three keys is:
0xFE 0x0
Si quelqu’un à une idée, elle serait bien venue