P
P
prilichny2018-12-30 15:44:46
Android
prilichny, 2018-12-30 15:44:46

Why won't my app disconnect from my BLE device?

I have a homemade BLE device (peripheral) with a single characteristic and two LEDs. When another device is connected to my device, my device flashes green LED once per second.
When I write a value to a characteristic, my device checks the conditions, and if everything is ok, it makes three short winks of one LED or blinks one of the other LEDs (sorry for the chaotic description).
I have a task to create an Android remote control application for this device. The application connects to the MAC address to my device, writes to the characteristics and disconnects from the device. The problem is that after writing to the characteristic and disconnecting the application from the device, my device continues to blink the LED, as if the smartphone is still connected (it used to help to turn off the application completely or turn off the Bluetooth adapter, but at some point this stopped helping) .
On the other hand, if I connect to the device using other BLE applications (for developers) that allow you to write to the characteristic, everything works out normally, as intended: the LED indicating the connection of the device starts blinking, one or another LED blinks at the time of recording , and when the device is turned off, the diodes stop flashing.
Until some point, I thought that the problem was in my application, and not in the device (after all, when connected through third-party programs, everything works correctly), but when even turning off the phone completely does not turn off the LED, it makes you think.
The question is difficult to formulate. What is the best way to approach debugging? From thoughts:
1. Make an analogue of the device in the form of a separate application on another phone - this would make sure that my application works normally (or would suggest where the problem is)
2. Understand what this bug is fraught with: I am primarily concerned about the power consumption of the device and potential inability to connect to it (denial of service?). That is, get to the oscilloscope and measure the power consumption when the device is supposedly not turned off? (I can turn off the debug blinking of the LED at the time of connection. Firmware). About the second part - while the application calmly works out as much as you like.
3. I'm having some trouble debugging my device based on the Nordic chip. On Android, debugging is easier - so I follow the path of least resistance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
prilichny, 2018-12-30
@prilichny

And I take the question. It helped to make a second delay between recording the characteristics and disconnecting from the device.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question