Environment :
-
Custom Board with MCU NordicSemi nRF51822-QFAA
-
Softdevice S110 7.1
-
IAR for ARM 7.1
-
SDK 7.2 using HID keyboard example + testing with iPhone 5S, 6 and iPad air (iOS 8.1.3)
/ Nexus 5 and Galaxy Note 3 (Android 4.4.2).
/***************************************************************************************/
After the iOS devices connect with the HID peripheral, the examples works.
- First, while the phone and the peripheral are bonded,
I did "Settings -> Bluetooth -> Bluetooth Off", so the BLE_EVT_DISCONNECT has occurred.
(I pressed the button which is pointed by a red arrow.)
Since I didn't deleted the peripheral on the "Settings" list, it will be connected
due to direct advertising mode.
So, when the peripheral is connected by direct advertising mode, the example code still works.
The meaning of working is, when I press the button 6 times, it sends h, e, l, l, o , and return.
Also, the virtual keyboard does not appear after I press the button.
- Second, this is the problem I faced.
If I didn't turned off the Bluetooth and (instead) deleted the device from the
"Settings -> Bluetooth -> Devices", the HID peripheral falls into the BLE_EVT_DISCONNECT.
When I try to bond again together, the bonding seems to be fine. However,
the virtual keyboard pops up and when I press the button, the string does not shows up.
(As you see, the red box shows that the phone is connected with the peripheral.
However, the keyboard shows up and the string "hello" does not appear.)
This phenomenon also appears when I test with the Android devices as well.
- Third, after I download the code several times (7 to 8 times or sometimes more), the connection keeps fails.
Plus, in this case, the iPhone shows connection error number 6 which is timeout error.
(ref :
)
(The link was provided by Petter Myhre. Thanks for always helping me Petter :D )
In this case, I erased the flash by nRFgo and burned the flash again.
/***************************************************************************************************************************************************************************/
In short, when the phone and the peripheral is connected by direct advertising,
it works fine, but when it is connected again after deleting the device from the settings menu,
it does not work properly.
Also after several downloads sometimes the connection fails even
though the code hasn't changed.
What could be the problem? Does the BLE stack gets tangled up?
-Regards, Mango922