This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

When does a BLE Master Device Ready to Receive HID reports?

Hi,

Currently, I am trying to understand how HIDEmuKbd app works. I am looking for a point of code, where slave (keyfob) connects to master device and ready to send  HID reports.

When I create a task on hidemukbd.c file that report key presses every 250 msec increamentally, on the master device's notepad application, I start to receive characters from beginning character. For example:


Case 1: cdefghijkl...

Case 2: oprstuvwxy....

So basically, the connection time and being ready to report hid reports time span changes connection to connection and moreover, device to device. For instance, it varies iPhone to Android phones as well.

As a conclusion, is there case, or a callback on the example code that I can get this moment, or is there a way to figure it out.

Thank you for your helps,

/dnz

  • Ok, after some investigation in the template code, I found there is a callback GAP_LINK_ESTABLISHED_EVENT in peripheral.c file. This callback help me to find the moment when the connection is established and I am ready to send HID reports. However, when I just turned on BLE module on the master device (iOS device or Android device), sending takes more time than sending HID reports when the BLE module is turned on and already connected and disconnected to master device at least once. If slave device is connected to master device before and master device did not turned off BLE module, then GAP_LINK_ESTABLISHED_EVENT callback works for me. However, I need more stable solution. 


    It would be very helpful for me to give me a hand.

    Thank you so much!

  • Hi there,

    I am still working on this issue. I have been reading Bluetooth Specs but on the slave side, I haven't find any clue about a flag say: Master is ready to take receive reports.


    I would really appreciate if someone can help me with this.

    Thank you so much!