detecting if a switch is connected

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

detecting if a switch is connected

Post by jmburnod » Fri Apr 08, 2016 4:17 pm

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
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: detecting if a switch is connected

Post by Mark » Sat Apr 09, 2016 8:37 am

Perhaps you should give a little more information, e.g. about how you communicate with the switch.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: detecting if a switch is connected

Post by [-hh] » Sat Apr 09, 2016 1:58 pm

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
shiftLock happens

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: detecting if a switch is connected

Post by jmburnod » Sun Apr 10, 2016 10:28 am

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
https://alternatic.ch

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: detecting if a switch is connected

Post by [-hh] » Sun Apr 10, 2016 12:12 pm

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)]
shiftLock happens

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”