esp32 custom bluetooth hid "keyboard"

Kubbur
Posts: 1
Joined: Thu Aug 16, 2018 4:20 pm

esp32 custom bluetooth hid "keyboard"

Postby Kubbur » Thu Aug 16, 2018 4:56 pm

im building a custom keyboard that connects through bluetooth to my pc, i managed to set up the esp32 as i need and found a code that kind of works, i can see the keyboard and connect to it and it sends random letters as its supposed to, but i cant fingure out how it works, thus im having a bad time trying to modify it to my needs


uint8_t v[] = {0x0, 0x0, 0x0, 0x0,0x0,0x0,0x0,0x0};

void loop() {
// put your main code here, to run repeatedly:
delay(1000);
if(connected){
uint8_t a[] = {0x0, 0x0, random(0x04,0x26), 0x0,0x0,0x0,0x0,0x0};
reportChar1->setValue(a,sizeof(a));
reportChar1->notify();


reportChar1->setValue(v, sizeof(v));
reportChar1->notify();

}
}


can anyone elaborate what the bold lines do, i kind of understand that its reading from the arrays and it sets the value of the array to reportchar1 but in what format, im lost

https://pastebin.com/J17n9RUX here is the whole code

i used to use a teensy 2 ++ but wanted to go wireless
https://pastebin.com/mjtyDHTh here is the code that i used on the teensy

Who is online

Users browsing this forum: Bing [Bot] and 16 guests