Loss of contact with a paired Bluetooth device notification

Discussion in 'Questions (Windows Mobile)' started by Doctor_E, Mar 21, 2009.

  1. Doctor_E

    Doctor_E New Member

    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 :cool:
     
  2. Doctor_E

    Doctor_E New Member

    Any ideas?

    Any ideas guys??

    :sign0085:
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    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.
     
  4. Doctor_E

    Doctor_E New Member

    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:
     
    Last edited: Mar 22, 2009
  5. taximania

    taximania Well-Known Member Licensed User

    Im going to spend a bit of time on this one.

    Watch this space . . . . . .
     
  6. taximania

    taximania Well-Known Member Licensed User

    ConnectionBluetoothCount always returns::confused: Invalid.
     
  7. taximania

    taximania Well-Known Member Licensed User

    I now have a working basic4ppc.dll that can show all bluetooth devices in range :)

    What I don't have yet, is the ability to detect if they are connected,
    or connect to them :sign0137:

    Half way there :cool:
     
    Last edited: Mar 29, 2009
  8. taximania

    taximania Well-Known Member Licensed User

    I've found a registry key that sort of works.

    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.
     

    Attached Files:

    Last edited: Apr 4, 2009
  9. pinoy_ako

    pinoy_ako Member Licensed User

    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice