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; } }
void IrDataReceived(IrReceiver sender, int command, int address, DateTime time) { OnIrEvent(new IrEventArgs { IrProtocol = IRProtocol, DeviceType = address, Button = command, ReadTime = time }); }