In this block initially it scans Bluetooth device and stores MAC address in itoo. Now, when I start background process. It connects to the stored MAC address and send RELAY_ON to esp32. My aim is to Disconnect after 3 second. Issue lies here. In Android 12 devices it disconnects after certain time interval. where as in android 14 device it does not disconnect. Please help me out.
Thanks,
Prashanth.
Did you add debug statements?
Which part of the blocks works for Android 12 and does not work for 14?
Provide a screenshot of those blocks including your debug statements
You can do that or use Store/Fetch Property blocks
In Android 12 device. Once the data RELAY_ON or RELAY_OFF sent, after 3 second procProcessStopClock runs i.e bluetooth disconnects. where as in Android 14 device sends data but it does not disconnects from esp32 device.
I have attached two file One is Android 12 device, other once is of android 14.
Initially Scan Pick and Connect button selects required MAC address.
Save Button stores the MAC address in itoo store.
Connect and disconnect button does connection and disconnection operation.
Now, If I press Start button(GREEN). Check two Serial monitor outputs of both Android 12 and 14 device.
In Android 12, when start button pressed, it connects (Connected) after 3 seconds app sends data RELAY_ON, i.e procSendOnClock clock runs. once the data is sent after 3 seconds procProcessStopClock clock executes and disconnects from ESP32.
In android 14, when start button pressed, it connects (Connected) after 3 seconds app sends data RELAY_ON, i.e procSendOnClock clock runs. once the data is sent after 3 seconds procProcessStopClock clock executes (Till here everything works fine) but BluetoothLE1.disconnect does not disconnect from the connected ESP32 module.
Yes. I wrote the ESP32 code such a way that if the device (App) is disconnected from ESP32 it displays Disconnected. and ESP32 is ready to connect other device (App).
At first I connect ESP32 from Android 12 device. once the data sent, device disconnects. If I connect from Android 14. App sends data but it does not disconnects. Now, If I start process again from Android 12, device does not connect because it is still connected to Android 14 which I can see in Setting - Bluetooth tab. App disconnects only when I completely close from recent app.