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

HID Mouse example on nRF51822, bluetooth connection error!

Good morning.

I use Google Translator to transcribe my articles. Please understand if the context is not right.

I am currently testing HID Protocol with a mobile phone.

SoftDevice is using S110, The SDK is using version 9.0.0.

The problem is that after checking the operation after connecting with the mobile phone, unregistering (disconnecting) it from the mobile phone and trying to connect again, HID_Mouse will not appear when the mobile phone finds the connectable list.

In summary, when you connect to your mobile phone and check the operation, you can unregister it from your cell phone and try to connect again.

I do not know if I should look at the event handling part when disconnecting, or if there is a problem with advertising. Help

  • In addition, HID Mouse connection from mobile phone -> Check operation -> Disconnect -> If you try to connect from computer (Win10), it does not appear in the list or connection is not possible.

    So if you try to reconnect to your computer after working on your mobile phone, you can re-upload the Softdevice and application and use it again.

    Is there any action required when disconnecting? Whether you initialize the stack or restart the advertising section ...?

  • Hi,

    If you have removed the mouse as a paired/bonded device, the phone will delete the bond data and you will not be able to bond or connect again using the old bond data.

    If the mouse have stored any previously bond data, it will do advertising with Whitelist(directed advertising) and therefore only bonded device will be able to find the mouse. After some time doing advertising with whitelist, it will switch over to regular advertising, and non-bonded devices will be able to see the mouse also. But, if the mouse have the old bond data, and the phone/computer don’t have the bond data, you will not be able to connect before you delete the bond data on the mouse.

    In order to delete the bond data, reset the device while pressing Button 2. See this link for more information.

  • Good morning, Thank you very much for your reply first.

    When I say what I understand,

    First, the first connection was able to connect both the computer and the mobile phone because there is no binding data in the whitelist.

    When connected to a telephone or computer, the bond data is stored and added to the whitelist, so only the devices in the whitelist are advertised.

    Second, connect to your phone using hid_mouse. Unregister from connected phone (connect Off) will delete the phone's bond data. Therefore, when you re-advertise using the mouse, only the devices in the whitelist are advertised. Cell phones do not appear in the linked list because they do not have any bond data.

    Third, to reconnect, you must disable the whitelist function or initialize the old bond data.

    Is that what I understand?

  • In addition, I am using only the nRF51822 chip without using the button now. Is there any way to delete the bond data without pressing the button?

  • In the advertising_init function "BLE_ADV_WHITELIST_ENABLED" -> "BLE_ADV_WHITELIST_DISABLED".

    The above problem seems to be solved to some extent because it is modified like this.

    In my opinion, if you want to use WHITELIST enabled, you will need to initialize the bond data or whitelist when you receive a specific signal.

Related