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

Keyboard example failure in sending keys after power-cycle with Android KitKat

Hello

We are facing problem and please help us how to solve this problem.


> Condition,

- NRF52 DK
- SDK version: nRF5_SDK_14.2.0_17b948a
- Examble: ble_peripheral\ble_app_hids_keyboard

> Problem:

- Pairing to Android KitKat 4.4.2 or 4.4.4

- Sending characters "hello" by pressing button 1 is working well

- Power-cycle and connected again(previously bonded device)

- Sending characters "hello" by pressing button 1 is not working....(Higher Android version and Windows 10, iOS is OK)

- Our developing keyboard (based on ble_peripheral\ble_app_hids_keyboard) has same problem.

> Under analysis

sd_ble_gatts_hvx returns NRF_ERROR_INVALID_STATE in ble_hids_inp_rep_send() even after normal connection.

I'm finding a answers in Q&A, but not easy to get answers,

Please give us any tips or help for this problem.

Sincerely yours,

Parents Reply Children
  • Your log is showing only the data packets and seems like it cannot be filtered based on protocol. I cannot debug it since to do that i need to decode each and every data packet. I am not an expert in wireshark, but there must be a way where your output log will allow me to filter packets based on protocol (for example, L2CAP or HCI etc)

  • Hello Nordic,

    We got a support from local channel FAE.
    Their opinion is that KitKat seems to be wrong.
    The logs with Ellisys analyzer were attatched.
    Could you help us what the problem is?

    Sincerely yours,

    test logs.zip

  • Hi Kim,

    I have compared your logs and I only found two differences between working and not-working logs

    1. Not-working device does an LLCP feature exchange where as on working, there is no LLCP feature exchange.
    2. On working the notification is reached to the slave the second time it is connected, but on not working your button press is not visible in air, so for some reason, with notWorking phone, when you press the button, it is not sending notification. I do not know why.

    I am not sure but it could be because of the incompatibility of some vendors able to support the value of 0 for WinOffset in the connect request parameter. Try the below code while initializing softdevice

    ble_opt_t ble_opt;
    memset(&ble_opt, 0, sizeof(ble_opt));
    
    ble_opt.gap_opt.compat_mode_1.enable = 1;
    
    err_code = sd_ble_opt_set(BLE_GAP_OPT_COMPAT_MODE_2,&ble_opt); 
    APP_ERROR_CHECK(err_code);

    The documentation for that can be found here

Related