Ejemplo 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);
            }
        }
Ejemplo n.º 2
0
 public W800RF()
 {
     w800Rf32 = new RfReceiver();
     w800Rf32.RfCommandReceived += W800Rf32_RfCommandReceived;
     w800Rf32.RfDataReceived += W800Rf32_RfDataReceived;
     w800Rf32.RfSecurityReceived += W800Rf32_RfSecurityReceived;
     modules = new List<InterfaceModule>();
     // Add RF receiver module
     InterfaceModule module = new InterfaceModule();
     module.Domain = this.GetDomain();
     module.Address = "RF";
     module.ModuleType = ModuleTypes.Sensor;
     modules.Add(module);
 }