Page 1 of 1

detecting if a switch is connected

Posted: Fri Apr 08, 2016 4:17 pm
by jmburnod
Hi All,
I use a switch called blue2 in an app for OS X, Windows and iOS.
Is there a way to know if a switch is connected ?
Here is the doc about blue2 switch : https://www.ablenetinc.com/blue2-bluetooth-switch
Best regards
Jean-Marc

Re: detecting if a switch is connected

Posted: Sat Apr 09, 2016 8:37 am
by Mark
Perhaps you should give a little more information, e.g. about how you communicate with the switch.

Mark

Re: detecting if a switch is connected

Posted: Sat Apr 09, 2016 1:58 pm
by [-hh]
Hi Jean-Marc,

you are looking for commandline tools, I presume.

On Mac I use the built-in "system_profiler":
put shell("system_profiler -timeout 20 SPBluetoothDataType") into fld 1
Timeout, if any, is here in seconds.

On Windows 7/10 I use (seldom) third-party tools:

http://www.nirsoft.net/utils/bluetoothcl.html
http://bluetoothinstaller.com/bluetooth ... ine-tools/

Hermann

Re: detecting if a switch is connected

Posted: Sun Apr 10, 2016 10:28 am
by jmburnod
Hi Hermann,
Thanks a lot.
you are looking for commandline tools, I presume.
You presume that my knowledge is larger than it is

Exactly what I need for OS X but I haven't enough knowledge to understand what i have to do for windows. :oops:

I also search an iOS way.

@ Mark
This is a bluetooth switch. It can send two keyboard messages

Best regards
Jean-Marc

Re: detecting if a switch is connected

Posted: Sun Apr 10, 2016 12:12 pm
by [-hh]
J-M.

For iOS (and also MacOS) you could use "mergBLE" (scroll down page):
https://livecode.com/merging-with-mergext/
For the demo you could look** into the app's contents:
"LiveCode Indy 8.0.0 (rc 1).app/Contents/Tools/MergExt/mergBLE-1.1.4/mergBLE.livecode".

For windows you could download the tools
http://bluetoothinstaller.com/bluetooth ... ine-tools/
and then use
get shell("btdiscovery -d"&quote&"%a%"&quote)

H.
_________
[** Edit. MergExt is contained in the new LC 800-rc1 Indy-release (of Apr 12, 2016)]