Hi there,
I would like to ask if there is a way to use serial2 library in order to create an application (probably run in the background) which notifies the user (with an msgbox or a sound notification) when a paired bluetooth device looses the contact with the smartphone.
Thanx in advance
PS: Not necessarily restricted to serial2 library, if there is another way (registry getvalue + timer or something) please let me know
Agraham's SystemState library can monitor a property named: ConnectionBluetoothCount.
You could use it to monitor the number of connected devices.
I didn't try it so I don't know whether each paired device is counted as a contacted device.
Note that this library is only available to users who bought Basic4ppc.
Thanks a lot Erel! One last question. Does anybody know if there is any value in the registry which changed in real-time when a device is paired or unpaired?
I know there are some keys in HKLM\Software\Microsoft\Bluetooth\ which may be related.
Thanks again, I really appreciate your help. :icon_clap:
Hi there,
I would like to ask if there is a way to use serial2 library in order to create an application (probably run in the background) which notifies the user (with an msgbox or a sound notification) when a paired bluetooth device looses the contact with the smartphone.
rtLocalMachine("System\State\Hardware\","Handsfree")
This key is 0 when my BT headset is 'not' connected, and '1' when it is.
I've attached a small example program.
Switch your headset on and press the 'monitor' button in the app.
If the connection is lost you get a notification.
If the connection is re-established you get another notification.
when connected to a device, try continously sending byte with a timer to bt serial port, it will generate error if connection lost. or, other device send byte, poll it with a timer. timer reset when when byte arrives. if byte stops arriving, timer will tick. notification is faster than with this.