public setBTscanner() { InitializeComponent(); m_deleInfo = new EventHandler(loginfoCallback); log = new logging(ref textBox1, m_deleInfo); log.WriteLog("+++++ START +++++"); }
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(); }
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"); }
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"); }