Ejemplo n.º 1
0
 protected OneWireBase(OneWireGate gate, byte[] rom, string declarer) {
   this.gate=gate;
   this._decl=declarer;
   this.rom=rom;
   if(gate!=null) {
     gate.AddDevice(this);
   }
 }
Ejemplo n.º 2
0
 public DS18B20(OneWireGate gate, byte[] rom)
   : base(gate, rom, "DS18B20") {
 }
Ejemplo n.º 3
0
 public void SetOwner(Topic owner) {
   if(!object.ReferenceEquals(owner, _owner)) {
     if(_owner!=null) {
       _owner.Unsubscribe("#", ChildChaged);
     }
     _owner=owner;
     if(_owner!=null) {
       _tPresent=_owner.Get<bool>("_present");
       _tPresent.saved=false;
       _owner.Get<string>("_declarer", _owner).value=_decl;
       PSetOwner();
       _owner.Subscribe("#", ChildChaged);
     } else if(_gate!=null) {
       _gate.DelDevice(this);
       var dev=Topic.root.Get("/dev/1Wire").children.Select(z => z.GetValue() as OneWireBase).FirstOrDefault(z => z!=null && z!=this && this.rom.SequenceEqual(z.rom));
       if(dev!=null) {
         dev.gate=_gate;
       }
       _gate=null;
     }
   }
 }
Ejemplo n.º 4
0
 public DS2406(OneWireGate gate, byte[] rom)
   : base(gate, rom, "DS2406") {
 }