.NET Components for Mobility

Creation of virtual COM Port on WM6 Professionnal

Last post 10-10-2008 10:37 AM by Thibault. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-09-2008 8:16 AM

    Creation of virtual COM Port on WM6 Professionnal

    Hello,

    I'm trying to connect my PDA and create a virtual COM Port dynamically.
    The Pairing and com port are closed after each command i send.

    I've successfully paired the PDA with : "BluetoothSecurity.PairRequest(BTAdress, PinCode)"
    After i create the com port with         :  "BTDevInfo.SetServiceState(BluetoothService.SerialPort, true)"
    With my PDA It create by default the COM port 0.
    I've modified a little the "BTDevInfo.SetServiceState(BluetoothService.SerialPort, true)" because i want to be sure that it will use COM3.

    Everithing works great but i still have a little problem :

    When i completely turn off the PDA and after restart it, the pairing of devices and Com port creation works great
    but i cannot open the COM port i've just created.
    If i pair manually the devices and create the virtual COM port just one time, then after my code works great.
    (I can pair and unpair the devices and create or destroy the COM port)

    Do you know why i have to pair manually one time ?
    Would it bet better for me to always keep a connexion and the COM3 port opened before reset the device ?
    I only have one Bluetooth card for now, but in future the application has to connect to many different Bluetooth card,
    will i have the same problem if the mac adress change ?

  • 10-10-2008 9:47 AM In reply to

    Re: Creation of virtual COM Port on WM6 Professionnal

    Is it only the program itself that uses the virtual COM port?  If so, don't use a one, just create a direct connection with BluetoothClient.  That will be much more robust and maintainable than virtual COM port usage.  See more in the user's guide document included in the recent releases.

    If another third-party application needs to access the virtual COM port, then hopefully someone else will be able to help as I've done very little work with them...

    Alan

    Alan J. McFarlane
    http://www.alanjmcf.me.uk/
    Please follow-up in the newsgroup for the benefit of all.
    Have I helped? Consider visiting my Amazon wishlist, see my homepage.
  • 10-10-2008 10:37 AM In reply to

    Re: Creation of virtual COM Port on WM6 Professionnal

    In my case, it's a third-party program in another languange that opens and uses the port, i have created a program in C# juste to make the connexion, it takes in parameters the bluetooth name, pin code, eventually mac adress, Com port desired and the parameter to connect or close the connexion.

    To solve my problem now i have removed the deconnexion in the third-party software so i always keep connected to one device with com port created and when i restart the pda, it seems to work even if i change the bluetooth name of the card and reset the PDA.

    But i'm afraid that if the mac adress change, the link will be broken and my com port won't open, is it possible ?

    I don't have another card for now but in future, our PDA will have to connect randomly to many bluetooth card embedded in hazard games
    in lunapark.

Page 1 of 1 (3 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.