I find a tricky problem when we connect a BLE keyboard with Raspberry. Ok, let's discript it with detail:
1、I am working on raspberry zero W with my project. And the os version is （get it using uname -a）:
2、I code a nrf52832 as a keyboard. For saving power, I let it to sleep 10s later after a key is pressed.
Code: Select all
Linux raspberrypi 4.19.58+ #1245 Fri Jul 12 17:20:08 BST 2019 armv6l GNU/Linux
After raspi connect with keyboard. keyboard can get the press event.
But after keyboard wakeup from sleep, it can not get the first keypress event.
I test it in windows, It also have this problem. It is because nrf52 soft reset from wakeup and miss the press event. So I find a way to get the soft wakeup event. And sent the key after wakeup. It work in windows but not good for raspberry pi.