Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nUSB HID Remote I/O Device Information Query Test\n");

            IO.Objects.USB.HID.Messenger m   = new IO.Objects.USB.HID.Messenger();
            IO.Remote.Device             dev = new IO.Remote.Device(m);

            // Display some device information

            Console.WriteLine(m.Info);
            Console.WriteLine(dev.Version);
            Console.WriteLine(dev.Capabilities);
            Console.WriteLine();

            // Display the available ADC inputs

            Console.Write("ADC inputs:  ");

            foreach (int input in dev.ADC_Available())
            {
                Console.Write(input.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available DAC outputs

            Console.Write("DAC outputs: ");

            foreach (int input in dev.DAC_Available())
            {
                Console.Write(input.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available GPIO pins

            Console.Write("GPIO Pins:   ");

            foreach (int pin in dev.GPIO_Available())
            {
                Console.Write(pin.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available I2C buses

            Console.Write("I2C buses:   ");

            foreach (int bus in dev.I2C_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available PWM outputs

            Console.Write("PWM outputs: ");

            foreach (int bus in dev.PWM_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available SPI devices

            Console.Write("SPI devices: ");

            foreach (int bus in dev.SPI_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nUDP Remote I/O Device Information Query Test\n");

            if (args.Length != 1)
            {
                Console.WriteLine("Usage: test_query_udp <hostname>");
                Environment.Exit(1);
            }

            IO.Interfaces.Message64.Messenger m =
                new IO.Objects.Message64.UDP.Messenger(args[0], 8087);

            var remdev = new IO.Remote.Device(m);

            Console.WriteLine(remdev.Version);
            Console.WriteLine(remdev.Capabilities);
            Console.WriteLine();

            // Display the available ADC inputs

            Console.Write("ADC inputs:  ");

            foreach (int input in remdev.ADC_Available())
            {
                Console.Write(input.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available DAC outputs

            Console.Write("DAC outputs: ");

            foreach (int output in remdev.DAC_Available())
            {
                Console.Write(output.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available GPIO pins

            Console.Write("GPIO Pins:   ");

            foreach (int pin in remdev.GPIO_Available())
            {
                Console.Write(pin.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available I2C buses

            Console.Write("I2C buses:   ");

            foreach (int bus in remdev.I2C_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available PWM outputs

            Console.Write("PWM outputs: ");

            foreach (int bus in remdev.PWM_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available SPI devices

            Console.Write("SPI devices: ");

            foreach (int bus in remdev.SPI_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();
        }