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

why the INVALID_STATE error code appear???And how to solve??

Hi all,

In my keyboard application, I found sometimes it return the INVALID_STATE error code , when called keys_send() , once this error code appeared, no others return by keys_send() again.
But the connection state is always CONNECTED, both in device side and the host side (it displays CONNECTED in the host side).
I want to know:

1.why will it happen while CONNECTED? 2.what could I do to excute the keys_send() correctly?

Thanks a lot.

Jim

Parents
  • The stable way to reappearance is : 1.Set the KB into advertising by pressing the bond button to delete the bond info; 2.Pair the iPad successfully and any key could be received correctly; 3.Re-power on the KB and the function is OK; 4.When KB standby, ignore the KB from iPad side but keep the KB side no change, and the KB will go into advertising again, then re-pair with the iPad, the function is OK, too; 5.Re-power on the KB and found it was CONNECTED in iPad side but no key function, and check the err-code was INVALID_STATE, so the function keys_send() not excute correctly;

    Maybe something loaded not correctly when power on??Could you guide how to disappear the INVALID_STATE?

    BTW, the SDK version is 4.4.1 and SD is 5.2.1 while silicon is C0.

    Thanks.

Reply
  • The stable way to reappearance is : 1.Set the KB into advertising by pressing the bond button to delete the bond info; 2.Pair the iPad successfully and any key could be received correctly; 3.Re-power on the KB and the function is OK; 4.When KB standby, ignore the KB from iPad side but keep the KB side no change, and the KB will go into advertising again, then re-pair with the iPad, the function is OK, too; 5.Re-power on the KB and found it was CONNECTED in iPad side but no key function, and check the err-code was INVALID_STATE, so the function keys_send() not excute correctly;

    Maybe something loaded not correctly when power on??Could you guide how to disappear the INVALID_STATE?

    BTW, the SDK version is 4.4.1 and SD is 5.2.1 while silicon is C0.

    Thanks.

Children
No Data
Related