Exemplo n.º 1
0
            public static int per_to_hex(String min)
            {
                int lmin = int.Parse(min);
                OsramDaliInterface atest = new OsramDaliInterface();

                TypeDaliCommand[] dali_command_1 = new TypeDaliCommand[1];
                dali_command_1[0].type       = 0x00;
                dali_command_1[0].highByte   = 0xFE;
                dali_command_1[0].lowByte    = 0xFF;
                dali_command_1[0].thirdByte  = 0xFF;
                dali_command_1[0].replyType  = 0x01;
                dali_command_1[0].replyValue = 0x01;
                atest.Init();
                atest.ScanForDaliUnitDevices();
                atest.GetDaliUnitCount();
                atest.OpenDaliUnit(0);
                atest.DaliVoltageGetState(0, 0);
                atest.DaliSupplyOn(0, 0);
                atest.DaliSupplyGetState(0, 0);
                dali_command_1[0].highByte = 0xA3;
                dali_command_1[0].lowByte  = 0x01;
                atest.SendDaliCommandSequenz(0, 0, dali_command_1, 1);
                dali_command_1[0].highByte = 0xC1;
                dali_command_1[0].lowByte  = 0x06;
                atest.SendDaliCommandSequenz(0, 0, dali_command_1, 1);
                dali_command_1[0].highByte = 0xFF;
                dali_command_1[0].lowByte  = 0xE3;
                atest.SendDaliCommandSequenz(0, 0, dali_command_1, 1);
                dali_command_1[0].highByte = 0xFF;
                dali_command_1[0].lowByte  = 0xE3;
                atest.SendDaliCommandSequenz(0, 0, dali_command_1, 1);
                return((254 * 100) / lmin);
            }
Exemplo n.º 2
0
            public static void set_level_max()
            {
                OsramDaliInterface atest = new OsramDaliInterface();

                TypeDaliCommand[] dali_command_1 = new TypeDaliCommand[1];
                dali_command_1[0].type       = 0x00;
                dali_command_1[0].highByte   = 0xFE;
                dali_command_1[0].lowByte    = 0xFF;
                dali_command_1[0].thirdByte  = 0xFF;
                dali_command_1[0].replyType  = 0x01;
                dali_command_1[0].replyValue = 0x01;
                atest.SendDaliCommandSequenz(0, 0, dali_command_1, 1);
            }
Exemplo n.º 3
0
            public static bool Link()
            {
                bool a = false;
                OsramDaliInterface b = new OsramDaliInterface();

                b.Init();
                b.ScanForDaliUnitDevices();
                int c = b.GetDaliUnitCount();

                if (c != 0)
                {
                    a = true;
                }
                return(a);
            }