This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

HID mouse example getting disconnected from android

Hi,

I was working on the HID mouse example and noticed that the example gets disconnected from my mobile phone once i start moving the cursor.

I also noticed that the auto bonding function is not working with my phone.

Make: Xiaomi

OS: Android 7.0 (MIUI Global 9.6.2.0)[Latest]

But when I tried the same with an older phone, it seems to work more efficiently. The board rarely gets disconnected and the auto bonding function also works.

Make: LYF

OS: Android 5.1.1

Parents Reply Children
  • What ppm lfclk tolerance and lfclk source have you enabled the softdevice with?

    Kenneth

  • Hi,

    Am not really sure if this is what you were really looking for, but this is what I could find.

    NRF_SDH_CLOCK_LF_ACCURACY 7 // 20 PPM

    NRF_SDH_CLOCK_LF_SRC 1 // XTAL

  • Hi,

    It may be that the accuracy of the lfclk on the peer side is not within specifications.

    It is difficult to prove this is the case without a sniffer log, however for test you may try to use:

    #define NRF_SDH_CLOCK_LF_ACCURACY 0 // 250ppm

    Best regards,
    Kenneth

  • Hi,

    I tried making above mentioned modification, but unfortunately didn't make any difference.

    By the way, let me ask you something else. It was regarding HID device descriptor.

    I tried using below mentioned descriptor, but it really didn't work as expected.

    exports.report = new Uint8Array([
      0x05,   0x01,                    // USAGE_PAGE (Generic Desktop)
      0x09,   0x05,                    // USAGE (Game Pad) - Hut1_12v2.pdf p28 of 128
      0xA1,   0x01,                    // COLLECTION (Application)

      0xA1,   0x00,                    //   COLLECTION (Physical)
      0x05,   0x09,                    //     USAGE_PAGE (Button)
      0x19,   0x01,                    //     USAGE_MINIMUM (Button 1)
      0x29,   0x10,                    //     USAGE_MAXIMUM (Button 16)

      0x15,   0x00,                    //     LOGICAL_MINIMUM (0)
      0x25,   0x01,                    //     LOGICAL_MAXIMUM (1)
      0x95,   0x10,                    //     REPORT_COUNT (16)
      0x75,   0x01,                    //     REPORT_SIZE (1)

      0x81,   0x02,                    //     INPUT (Data,Var,Abs)

      0x05,   0x01,                    //     USAGE_PAGE (Generic Desktop)
      0x09,   0x30,                    //     USAGE (X)
      0x09,   0x31,                    //     USAGE (Y)
      0x09,   0x32,                    //     USAGE (Z) - Hut1_12v2.pdf p26 = represents R X-axis
      0x09,   0x33,                    //     USAGE (Rx) - Hut1_12v2.pdf p26 = represents R Y-axis

      0x15,   0x81,                    //     LOGICAL_MINIMUM (-127)
      0x25,   0x7F,                    //     LOGICAL_MAXIMUM (127)
      0x75,   0x08,                    //     REPORT_SIZE (8)
      0x95,   0x04,                    //     REPORT_COUNT (4)

      0x81,   0x06,                    //     INPUT (Data,Var,Abs) - absolute for joysticks ( != rel for mouse )
      0xC0,                            //   END_COLLECTION

      0xc0 ]                           // END_COLLECTION
    );

    I couldn't understand below mentioned instruction and its argument

    0x81,   0x06,                    //     INPUT (Data,Var,Abs) - absolute for joysticks ( != rel for mouse )

    0x81,   0x02,                    //     INPUT (Data,Var,Abs)

    If you are familiar with these, kindly help me figure this out. I also looking into hut1_12v2.pdf but so far couldn't find any details regarding the command mentioned.

Related