コード例 #1
0
 public void StartReceiver()
 {
     if (IRProtocol == Protocol.Sony)
     {
         IrReceiver sony = new SonyReceiver(_receiverPin);
         _instance          = sony;
         sony.DataReceived += IrDataReceived;
     }
     else
     {
         IrReceiver nec = new NECReceiver(_receiverPin);
         _instance         = nec;
         nec.DataReceived += IrDataReceived;
     }
 }
コード例 #2
0
 void IrDataReceived(IrReceiver sender, int command, int address, DateTime time)
 {
     OnIrEvent(new IrEventArgs {
         IrProtocol = IRProtocol, DeviceType = address, Button = command, ReadTime = time
     });
 }