示例#1
0
 /// <summary>
 /// Raises the rf data received event.
 /// </summary>
 /// <param name="args">Arguments.</param>
 protected virtual void OnRfDataReceived(RfDataReceivedEventArgs args)
 {
     if (RfDataReceived != null)
         RfDataReceived(this, args);
 }
示例#2
0
 private void X10lib_RfDataReceived(object sender, RfDataReceivedEventArgs args)
 {
     var code = BitConverter.ToString(args.Data).Replace("-", " ");
     OnInterfacePropertyChanged(this.GetDomain(), "RF", "X10 RF Receiver", ModuleEvents.Receiver_RawData, code);
     if (rfPulseTimer == null)
     {
         rfPulseTimer = new Timer(delegate(object target)
         {
             OnInterfacePropertyChanged(this.GetDomain(), "RF", "X10 RF Receiver", ModuleEvents.Receiver_RawData, "");
         });
     }
     rfPulseTimer.Change(1000, Timeout.Infinite);
 }
示例#3
0
文件: X10.cs 项目: guytpetj/HomeGenie
 private void X10lib_RfDataReceived(object sender, RfDataReceivedEventArgs args)
 {
     if (InterfacePropertyChangedAction != null)
     {
         try
         {
             InterfacePropertyChangedAction(new InterfacePropertyChangedAction() {
                 Domain = this.Domain,
                 SourceId = "RF",
                 SourceType = "X10 RF Receiver",
                 Path = "Receiver.RawData",
                 Value = BitConverter.ToString(args.Data).Replace("-", " ")
             });
         }
         catch
         {
             // TODO: add error logging
         }
         //
         if (rfPulseTimer == null)
         {
             rfPulseTimer = new Timer(delegate(object target)
             {
                 try
                 {
                     InterfacePropertyChangedAction(new InterfacePropertyChangedAction() {
                         Domain = this.Domain,
                         SourceId = "RF",
                         SourceType = "X10 RF Receiver",
                         Path = "Receiver.RawData",
                         Value = ""
                     });
                 }
                 catch
                 {
                     // TODO: add error logging
                 }
             });
         }
         rfPulseTimer.Change(1000, Timeout.Infinite);
     }
 }