public void MarkAsDead() { lock (_controllerLock) { _connector = null; } }
public OneWireControl(IOneWireConnector oneWireConnector) { _oneWireConnector = oneWireConnector; InitializeComponent(); _oneWireConnector.OnNewOnWireDevice += _oneWireConnector_OnNewOnWireDevice; _oneWireConnector.OnOneWireDeviceIsDead += _oneWireConnector_OnOneWireDeviceIsDead; _oneWireConnector.RaiseAllObjectEvents(); }
internal OneWireDevice(IReadOnlyList<byte> romAddress, IOneWireConnector connector) { _connector = connector; _controllerLock = new object(); RomNumber = romAddress.ToArray(); SerialNumber = string.Empty; foreach (var byteValue in romAddress) { SerialNumber += byteValue.ToString("x2")?.ToUpper(); } FamilyCode = romAddress[0]; }