Exemplo n.º 1
0
        private static void flash_the_busy_led()
        {
            byte   num  = 0xc1;
            string str  = "";
            string str2 = "";

            byte[] array   = new byte[0x41];
            byte[] buffer2 = new byte[0x41];
            if (Utilities.m_flags.HID_read_handle != IntPtr.Zero)
            {
                Array.Clear(array, 0, array.Length);
                Array.Clear(buffer2, 0, buffer2.Length);
                if (Get_Status_Packet(ref buffer2))
                {
                    buffer2[7] = (byte)(buffer2[7] | 0x20);
                    USBWrite.configure_outbound_control_block_packet(ref array, ref str, ref buffer2);
                    USBWrite.write_and_verify_config_block(ref array, ref str2, true, ref str);
                    if (USBWrite.Send_LED_State_Cmd(1, num))
                    {
                        buffer2[7] = (byte)(buffer2[7] & 0xdf);
                        Thread.Sleep(0x7d0);
                        USBWrite.configure_outbound_control_block_packet(ref array, ref str, ref buffer2);
                        USBWrite.write_and_verify_config_block(ref array, ref str2, true, ref str);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private static void flash_the_busy_led()
        {
            byte   p_value = 193;
            string text    = "";
            string text2   = "";

            byte[] array  = new byte[65];
            byte[] array2 = new byte[65];
            if (Utilities.m_flags.HID_DeviceReady != false)            //(Utilities.m_flags.HID_read_handle != IntPtr.Zero)
            {
                Array.Clear(array, 0, array.Length);
                Array.Clear(array2, 0, array2.Length);
                if (!Basic.Get_Status_Packet(ref array2))
                {
                    return;
                }
                byte[] expr_66_cp_0 = array2;
                int    expr_66_cp_1 = 7;
                expr_66_cp_0[expr_66_cp_1] |= 32;
                USBWrite.configure_outbound_control_block_packet(ref array, ref text, ref array2);
                USBWrite.write_and_verify_config_block(ref array, ref text2, true, ref text);
                if (USBWrite.Send_LED_State_Cmd(1, p_value))
                {
                    byte[] expr_9E_cp_0 = array2;
                    int    expr_9E_cp_1 = 7;
                    expr_9E_cp_0[expr_9E_cp_1] &= 223;
                    Thread.Sleep(2000);
                    USBWrite.configure_outbound_control_block_packet(ref array, ref text, ref array2);
                    USBWrite.write_and_verify_config_block(ref array, ref text2, true, ref text);
                }
            }
        }