software you can take with you

SetServiceState function of the latest version 3.3.909.0

Last post 02-09-2012 6:17 AM by PeterFoot. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-08-2012 5:05 PM

    • mravi
    • Not Ranked
    • Joined on 12-07-2011
    • Posts 2

    SetServiceState function of the latest version 3.3.909.0

    Locked Reply Contact

     I am trying to connect desktop windows version of windows XP, Vista 32bit, 64bit, Win7 32bit, 64 bit. to  bluetooth adapter (parani ESD110V2 2.0.0). The bluetooth radio used is also parani UD100. The code down below is used to install bluetooth and the outgoing virtual com port is used and passed to a serial handle where the communication is handled.

    The bluetooth adapter is used in two modes .

    mode 0: connectable and discoverable

    mode1: connectable but NON-discoverable.

     As the code executes the SetServiceState(BluetoothService.SerialPort,true,true) does not install the incoming virtual com port.It neither works in mode 0  nor mode 1.The normal pairing that is usually done by selecting the Bluetooth Devices from the control panel works and the bluetooth communication is absolutely fine. 

    Is there a problem with the library?? Can you suggest a possible solution of how this could be handled?? 

    Can you please suggest a better way to install bluetooth apart from SetServiceState.Our application has to use the virtual com port.

     

    using InTheHand.Net.Bluetooth;
    using InTheHand.Net.Bluetooth.Factory;
    using InTheHand.Net.Ports;
    using InTheHand.Net.Sockets;
    using InTheHand.Windows.Forms;
    using InTheHand.Net;
       BluetoothAddress addr;
            BluetoothDeviceInfo Ldevice;
            ManagementEventWatcher m_inWatcher;
            private BluetoothListener bl;


     if (!BluetoothRadio.IsSupported)
                    {
                        label4.Text = " ";
                        CMessages.ShowErrorMessage("Bluetooth Radio is not available.");
                        _Connect.Enabled = true;
                        return;
                    }

                    if (BluetoothRadio.PrimaryRadio.Mode == RadioMode.PowerOff)
                        BluetoothRadio.PrimaryRadio.Mode = RadioMode.Connectable;
                   
                        addr = BluetoothAddress.Parse(BTh_MacAddress.ToStringAddress().ToLower());
                        CDataSet.DataSet.MacAddr = BTh_MacAddress.ToStringAddress().ToLower();
                        Ldevice = new BluetoothDeviceInfo(addr);

    if (!BluetoothSecurity.PairRequest(addr, edit_Code1.Text))
                            {                          
                                CMessages.ShowErrorMessage("Bluetooth Pairing Request Failed.");                           
                                return;
                            }
                            else
                            {
                                BT_Found = true;                          
                                bool state = true;
                                VirtPortName = CSystemDeviceInfo.GetVirtualCommPorts(addr.ToString());
                                if (VirtPortName == "")
                                {
                                    Ldevice.SetServiceState(BluetoothService.SerialPort, state, true);
                                

                                }
                                Ldevice.Update(); Ldevice.Refresh();
                                //break;
                            }

     

    Thanks,

    Ravi M.

    Filed under: ,
  • 02-09-2012 6:17 AM In reply to

    Re: SetServiceState function of the latest version 3.3.909.0

    Locked Reply Contact

    This forum is for Mobile In The Hand support. Please post your question to the 32feet.NET discussions at:-

    http://32feet.codeplex.com/discussions

    Regards,

    Peter

Page 1 of 1 (2 items)
Copyright © 2001-2013 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting