Esempio n. 1
0
        public setBTscanner()
        {
            InitializeComponent();

            m_deleInfo = new EventHandler(loginfoCallback);

            log = new logging(ref textBox1, m_deleInfo);

            log.WriteLog("+++++ START +++++");
        }
Esempio n. 2
0
        public setBTscanner()
        {
            InitializeComponent();

            m_deleInfo = new EventHandler(loginfoCallback);

            log = new logging(ref textBox1, m_deleInfo);

            log.WriteLog("+++++ START +++++");
        }
Esempio n. 3
0
        public setBTscanner(string sBT)
        {
            InitializeComponent();

            _sBT = sBT;
            txtBTmacAddress.Text = _sBT;

            m_deleInfo = new EventHandler(loginfoCallback); //calback delegate for log display

            log = new logging(ref textBox1, m_deleInfo);

            log.WriteLog("+++++ START +++++");
            bAutoClose = true;

            threadConnect = new System.Threading.Thread(connectthread);
            threadConnect.Start();
        }
Esempio n. 4
0
        public setBTscanner(string sBT)
        {
            InitializeComponent();

            _sBT = sBT;
            txtBTmacAddress.Text = _sBT;

            m_deleInfo = new EventHandler(loginfoCallback); //calback delegate for log display

            log = new logging(ref textBox1, m_deleInfo);

            log.WriteLog("+++++ START +++++");
            bAutoClose = true;

            threadConnect = new System.Threading.Thread(connectthread);
            threadConnect.Start();
        }
Esempio n. 5
0
        public BTdevice(ref logging lg)
        {
            log = lg;
            try
            {
                preparePSWMD0C();
#if USE_SSAPI
                BTpower btPower = new BTpower();
                if (btPower.IsBluetoothOn() == false)
                {
                    log.WriteLog("BT power is OFF, trying to switch ON...");
                    btPower.TurnOnBluetooth();
                    if (btPower.IsBluetoothOn() == false)
                    {
                        log.WriteLog("BT power switch ON failed");
                    }
                    else
                    {
                        log.WriteLog("BT power is now ON");
                    }
                }
                else
                {
                    log.WriteLog("BT power was ON, no change");
                }

                //btPower.Dispose();
#endif
                _deviceUtility = new DeviceUtility();
                _deviceUtility.Initialize(xmlFileName);
            }
            catch (DeviceUtilityException ex)
            {
                log.WriteLog("DeviceUtilityException in BTdevice(): " + ex.Message);
                _deviceUtility = null;
            }
            catch (Exception ex)
            {
                log.WriteLog("Exception in BTdevice(): " + ex.Message);
                _deviceUtility = null;
            }
            log.WriteLog("BTdevice() OK");
        }
Esempio n. 6
0
        public BTdevice(ref logging lg)
        {
            log = lg;
            try
            {
                preparePSWMD0C();
#if USE_SSAPI 
                BTpower btPower = new BTpower();
                if (btPower.IsBluetoothOn() == false)
                {
                    log.WriteLog("BT power is OFF, trying to switch ON...");
                    btPower.TurnOnBluetooth();
                    if (btPower.IsBluetoothOn() == false)
                        log.WriteLog("BT power switch ON failed");
                    else
                        log.WriteLog("BT power is now ON");
                }
                else
                    log.WriteLog("BT power was ON, no change");
                
                //btPower.Dispose();
#endif
                _deviceUtility = new DeviceUtility();
                _deviceUtility.Initialize(xmlFileName);
            }
            catch (DeviceUtilityException ex)
            {
                log.WriteLog("DeviceUtilityException in BTdevice(): " + ex.Message);
                _deviceUtility = null;
            }
            catch (Exception ex)
            {
                log.WriteLog("Exception in BTdevice(): " + ex.Message);
                _deviceUtility = null;
            }
            log.WriteLog("BTdevice() OK");

        }