public void Connect() { _spaceSensorWirelessDongleObj = new SpaceSensorWirelessDongle(COM_PORT); _spaceSensorWirelessDongleObj.Connect(); _spaceSensor1 = new SpaceSensorDevice(_sensor1LogicalID, _spaceSensorWirelessDongleObj); _spaceSensor2 = new SpaceSensorDevice(_sensor2LogicalID, _spaceSensorWirelessDongleObj); _spaceSensor1.SetRange(); _spaceSensor2.SetRange(); _spaceSensorWirelessDongleObj.Disconnect(); _spaceSensorWirelessDongleObj.Connect(); _spaceSensor1 = new SpaceSensorDevice(_sensor1LogicalID, _spaceSensorWirelessDongleObj); _spaceSensor2 = new SpaceSensorDevice(_sensor2LogicalID, _spaceSensorWirelessDongleObj); }
public void Connect() { try { _spaceSensorWirelessDongleObj = new SpaceSensorWirelessDongle(COM_PORT); _spaceSensorWirelessDongleObj.Connect(); _spaceSensor1 = new SpaceSensorDevice(_sensor1LogicalID, _spaceSensorWirelessDongleObj); _spaceSensor2 = new SpaceSensorDevice(_sensor2LogicalID, _spaceSensorWirelessDongleObj); _spaceSensor1.SetRange(); _spaceSensor2.SetRange(); _spaceSensorWirelessDongleObj.Disconnect(); _spaceSensorWirelessDongleObj.Connect(); _spaceSensor1 = new SpaceSensorDevice(_sensor1LogicalID, _spaceSensorWirelessDongleObj); _spaceSensor2 = new SpaceSensorDevice(_sensor2LogicalID, _spaceSensorWirelessDongleObj); } catch (Exception ex) { throw; } }