Esempio n. 1
0
        public static void Main(string[] args)
        {
            // NOTE: To disable debug output uncomment the following two lines
            //LogManager.Configuration.LoggingRules.RemoveAt(0);
            //LogManager.Configuration.Reload();

            Console.WriteLine("W800RF32 Test Program");

            var x10rf = new RfReceiver();

            // Listen to W800RF32 events
            x10rf.ConnectionStatusChanged += X10rf_ConnectionStatusChanged;
            x10rf.RfDataReceived          += X10rf_RfDataReceived;
            x10rf.RfCommandReceived       += X10rf_RfCommandReceived;
            x10rf.RfSecurityReceived      += X10rf_RfSecurityReceived;
            // Set the serial port to use
            x10rf.PortName = "/dev/ttyUSB0";
            // Connect to the receiver
            x10rf.Connect();

            // Prevent the program from quitting with a noop loop
            while (true)
            {
                Thread.Sleep(1000);
            }
        }
Esempio n. 2
0
 public bool Connect()
 {
     w800Rf32.PortName = this.GetOption("Port").Value;
     if (InterfaceModulesChangedAction != null)
     {
         InterfaceModulesChangedAction(new InterfaceModulesChangedAction()
         {
             Domain = this.Domain
         });
     }
     return(w800Rf32.Connect());
 }
 public bool Connect()
 {
     w800Rf32.PortName = this.GetOption("Port").Value;
     OnInterfaceModulesChanged(this.GetDomain());
     return(w800Rf32.Connect());
 }