Did anybody know how I could determine the connection interval for a established ble connection between an android (4.4) central and a (e.g. nRF51822) peripheral?
Did anybody know how I could determine the connection interval for a established ble connection between an android (4.4) central and a (e.g. nRF51822) peripheral?
The simplest and cross platform way would be to have a characteristic that sets the link timing, this characteristic can be read or notified from the Peripheral. There is an example for this in the BLE over UART project for Arduino using the github.com/.../ble-sdk-arduino , see the ble_uart_project_template. You can view the XML file in that project using nRFgo studio and the Characteristic is called "UART link timing current". This example is for the nRF8001 however it should be trivial to do the same for the nRF51.
Of cause, this may be a way, as long as the peripheral code is under my control. But I rather desire a way which works independ of the peripherals implementation. I'm quite shure, that the central has this information. But I fear that this wasn't provided by the bluedroid Api.
Unfortunately this is the best possible to directly find the connection interval. The other indirect method would be to send a read from the app and check the time it takes to get a read response.
Read the parameters in HCI Event LE_Connection_Complete or HCI Event LE_Connection_Update_Complete from the btsnoop_hci.log log. To get this log file: 1 Settings->Developer options->Enable Bluetooth HCI snoop log (if Developer options screen is hidden then make it available. Go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.) 2 Bluetooth must be toggled to make this settings work. 3 adb pull /sdcard/btsnoop_hci.log . (the path might be different and you can find it out by adb shell cat etc/bluetooth/bt_stack.conf | grep BtSnoopFileName) 4 Open btsnoop_hci.log in www.fte.com/.../CPAS-download.aspx or in wireshark
this worked well, thank you