Closed emanuellopes closed 8 months ago
Hi Emmanuel
BTstack expects that hid_device_request_can_send_now_event is called if the user wants to send and that the user calls hid_device_send_interrupt_message upon
In your code, you're starting a timer upon HID_SUBEVENT_CAN_SEND_NOW.
text_timer.process = &text_timer_handler;
is identical to
btstack_run_loop_set_timer_handler(&text_timer, text_timer_handler);
Describe the bug I used the hid_keyboard_demo and reimplemented the code in raspberry pico W. After some debug testing I notice the loop handler doesn't fire after bluetooth reconnection.
To Reproduce
Steps to reproduce the behavior:
Expected behavior The loop timer handler should run in a loop until device is connected.
On my side I've fixed the issue using the example led_bliking.c Instead of using function btstack_run_loop_set_timer_handler(&text_timer, text_timer_handler);
I have changed to text_timer.process = &text_timer_handler; on device connection.
I'm not sure if this is the correct implementation but solved my issue.
Do you have any recommendation to improve this?
Thank you