NRF52840 as a dnogle for the mouse

   I made a dongle by merging nrf\samples\bluetooth\central_hids with zephyr\samples\subsys\usb\hid-mouse.

   When a keyboard or mouse is connected, its report map data is read and used as a descriptor for the HID.

   When you receive the Notify of the HID, send it to the USB immediately. If a keyboard is connected, it seems to be working fine. 

   But when connected to a mouse, the operation of the mouse becomes sluggish and difficult to control. I don't know where the problem is and how to solve it.

   Does anyone know what's going on?

hid_dongle.rar

  • Hello,

    Can you specify the connection parameters you use for the hid mouse and hid keyboard? Are you scanning while hid mouse or keyboard is connected? If yes, what scanning parameters are you using?

    Kenneth

  •     

     

    Can you specify the connection parameters you use for the hid mouse and hid keyboard?

     Haven't tried to see if the connection parameters can be modified.I thought I could try it.Do you have any valid parameters to offer?

     

    Are you scanning while hid mouse or keyboard is connected?

    Yes, my purpose is to connect more than two hids, only tested the mouse at the moment. So, after the mouse is connected, dongle still scans the broadcast again.

    If yes, what scanning parameters are you using?

     central_hids default parameters are used, I looked up the parameters:

     BT_LE_CONN_PARAM(BT_GAP_INIT_CONN_INT_MIN, BT_GAP_INIT_CONN_INT_MAX, 0, 400)

     #define BT_GAP_INIT_CONN_INT_MIN                 0x0018  /* 30 ms    */

     #define BT_GAP_INIT_CONN_INT_MAX                0x0028  /* 50 ms    */

     Do you think scanning affects mouse control, If so, how to avoid it?

  • Hello,

    Typically I would expect that a mouse would have a connection interval of 7.5ms and a keyboard for instance 30ms.

    To ensure that scanning have the least influence of the already connected devices, I would suggest that the scanning window is set to minimum. I think that is 2.5ms (or 3.75ms) is the minimum window, the scanning interval you can set to the same value (if you want to save current you can set the interval to a higher value).

    Kenneth

  •    Thank you very much for your help, now the problem has been solved and it is working fine.

       

Related