Ejemplo n.º 1
0
 public void MarkAsDead()
 {
     lock (_controllerLock)
     {
         _connector = null;
     }
 }
Ejemplo n.º 2
0
        public OneWireControl(IOneWireConnector oneWireConnector)
        {
            _oneWireConnector = oneWireConnector;
            InitializeComponent();

            _oneWireConnector.OnNewOnWireDevice     += _oneWireConnector_OnNewOnWireDevice;
            _oneWireConnector.OnOneWireDeviceIsDead += _oneWireConnector_OnOneWireDeviceIsDead;

            _oneWireConnector.RaiseAllObjectEvents();
        }
Ejemplo n.º 3
0
        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];
        }