public SensorProcessor(Sensor Sensor) { DeviceNumber = 0; TransmissionType = 0; _Sensor = Sensor; Status = SensorStatus.Disconnected; }
public void Search() { if (_Sensor == null) { _Sensor = SensorFactory.GetSensor(_SensorType); } if (_Sensor.Status == SensorStatus.Disconnected) { // Consoldate this with actual sensor and processor status _Sensor.Search(); } }
public void Initialise(SensorType deviceType) { _SensorType = deviceType; _Sensor = SensorFactory.GetSensor(_SensorType); _Sensor.SensorStatusChanged += new SensorStatusChangedHandler(StatusChanged); _Sensor.SensorMessage += new SensorMessageHandler(SensorMessageReceived); Name = _Sensor.Name; }
// Unlike Initialise, Reinit takes serialized valuesa public void Reinitialise() { _Sensor = SensorFactory.GetSensor(_SensorType); // Do any pairing _Sensor.DeviceNumber = this.DeviceNumber; _Sensor.TransmissionType = this.TransmissionType; _Sensor.SensorStatusChanged += new SensorStatusChangedHandler(StatusChanged); _Sensor.SensorMessage += new SensorMessageHandler(SensorMessageReceived); }
public void Disconnect() { if (_Sensor == null) { _Sensor = SensorFactory.GetSensor(_SensorType); } if (_Sensor.Status == SensorStatus.Connected) { _Sensor.Disconnect(); } }