Check if Bluetooth device is available

264 views
Skip to first unread message

Tobis Slamstas

unread,
Feb 27, 2021, 3:28:54 PM2/27/21
to Automate
Hi, is there any easy way to check if a particular Bluetooth device is available / is in range? "Connect BT device" block works OK (rooted device) if device is available but crashes with illegal argument error if it tries to connect to a device that's not in range. Thank You!

Henrik "The Developer" Lindqvist

unread,
Feb 27, 2021, 11:56:58 PM2/27/21
to Automate
Use the Bluetooth device scan block:

Henrik "The Developer" Lindqvist

unread,
Feb 27, 2021, 11:59:46 PM2/27/21
to Automate
If the goal is to connect to the device then just handle the failure using the Failure catch block, a prior scan/check if the device is "in range" will not guarantee it won't fail connecting anyway. See:
On Saturday, February 27, 2021 at 9:28:54 PM UTC+1 Tobis Slamstas wrote:

Tobis Slamstas

unread,
Feb 28, 2021, 4:39:45 PM2/28/21
to Automate
Failure catch block did the trick. Thank You very much! 
Reply all
Reply to author
Forward
0 new messages