Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(Console.WindowWidth * 2, Console.WindowHeight);

            KNXUartConnection kNXUart = new KNXUartConnection(AppSettings.Default.ComPort)
            {
                AllowWrite = true
            };

            kNXUart.OnKNXMessage += KNXUart_OnKNXMessage;
            kNXUart.ResetAndInit();
            kNXUart.AddKNXAddressToAck(new KNXAddress(0x00, 0x02));

            SysApEmulator = new FreeAtHomeDevices.FaHDevice
            {
                FaHAddress = FaHDeviceAddress.FromByteArray(new byte[] { 0xAB, 0xB7, 0x00, 0xD2, 0x32, 0x48 }, 0),
            };
            SysApEmulator.SetAddressInformation(new KNXAddress(0x00, 0x02), SystemID);

            if (!DiscoverDevice(ref kNXUart))
            {
                Console.WriteLine("Cannot find a device");
                return;
            }
            LearnDevice(ref kNXUart);

            Console.ReadLine();
        }
 public override bool SaveToDevice(ref FaHDevice faHDevice, out bool moreIndices)
 {
     faHDevice.SetAddressInformation(kNXAddress, FahSystemID);
     moreIndices = false;
     return(true);
 }