Ejemplo n.º 1
0
 public MultipleArguments(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command        = command;
     DefineCommands();
     _randomNumber = new System.Random(DateTime.Now.Millisecond);
 }
Ejemplo n.º 2
0
        public CommandMessengerTest()
        {
            // Set up board & transport mode
            var teensy31 = new systemSettings()
            {
                Description = @"Teensy 3.1",
                MinReceiveSpeed     = 2000000,         // Bits per second
                MinSendSpeed        = 1250000,         // Bits per second
                MinDirectSendSpeed  = 47500,           // Bits per second
                BoardType           = BoardType.Bit32, // 32 architecture, needed from binary value conversion
                sendBufferMaxLength = 512,             // Maximum send buffer size
                Transport = new SerialTransport
                    {
                        CurrentSerialSettings = new SerialSettings()
                            {
                                PortName = "COM15",    // Can be different!
                                BaudRate = 115200,     // Bits per second
                                DataBits = 8,          // Data bits
                                Parity = Parity.None,  // Bit parity
                                DtrEnable = false,     // Some boards need to send this to enabled
                            },

                    }
            };
            var arduinoNano = new systemSettings()
            {
                Description = @"Arduino Nano /w AT mega328",
                MinReceiveSpeed     = 84000,              // Bits per second
                MinSendSpeed        = 90000,              // Bits per second
                MinDirectSendSpeed  = 52000,              // Bits per second
                BoardType           = BoardType.Bit16,    // 32 architecture, needed from binary value conversion
                sendBufferMaxLength = 60,                 // Maximum send buffer size
                Transport = new SerialTransport
                {
                    CurrentSerialSettings = new SerialSettings()
                    {
                        PortName = "COM6",                // Can be different!
                        BaudRate = 115200,                // Bits per second
                        DataBits = 8,                     // Data bits
                        Parity = Parity.None,             // Bit parity
                        DtrEnable = false,                // Some boards need to send this to enabled
                    },

                }
            };

            // Set up Command enumerators
            var command = DefineCommands();

            // Initialize tests
            InitializeTests(teensy31, command);

            // Open log file for testing
            Common.OpenTestLogFile(@"TestLogFile.txt");

            // Run tests
            RunTests();

            Common.CloseTestLogFile();
        }
Ejemplo n.º 3
0
 public MultipleArguments(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command = command;
     DefineCommands();
     _randomNumber = new System.Random(DateTime.Now.Millisecond);
 }
Ejemplo n.º 4
0
        public CommandMessengerTest()
        {
            // Set up board & transport mode
            var teensy31 = new systemSettings()
            {
                Description         = @"Teensy 3.1",
                MinReceiveSpeed     = 2000000,         // Bits per second
                MinSendSpeed        = 1250000,         // Bits per second
                MinDirectSendSpeed  = 47500,           // Bits per second
                BoardType           = BoardType.Bit32, // 32 architecture, needed from binary value conversion
                sendBufferMaxLength = 512,             // Maximum send buffer size
                Transport           = new SerialTransport
                {
                    CurrentSerialSettings = new SerialSettings()
                    {
                        PortName  = "COM15",           // Can be different!
                        BaudRate  = 115200,            // Bits per second
                        DataBits  = 8,                 // Data bits
                        Parity    = Parity.None,       // Bit parity
                        DtrEnable = false,             // Some boards need to send this to enabled
                    },
                }
            };
            var arduinoNano = new systemSettings()
            {
                Description         = @"Arduino Nano /w AT mega328",
                MinReceiveSpeed     = 84000,              // Bits per second
                MinSendSpeed        = 90000,              // Bits per second
                MinDirectSendSpeed  = 52000,              // Bits per second
                BoardType           = BoardType.Bit16,    // 32 architecture, needed from binary value conversion
                sendBufferMaxLength = 60,                 // Maximum send buffer size
                Transport           = new SerialTransport
                {
                    CurrentSerialSettings = new SerialSettings()
                    {
                        PortName  = "COM6",               // Can be different!
                        BaudRate  = 115200,               // Bits per second
                        DataBits  = 8,                    // Data bits
                        Parity    = Parity.None,          // Bit parity
                        DtrEnable = false,                // Some boards need to send this to enabled
                    },
                }
            };

            // Set up Command enumerators
            var command = DefineCommands();

            // Initialize tests
            InitializeTests(teensy31, command);

            // Open log file for testing
            Common.OpenTestLogFile(@"TestLogFile.txt");

            // Run tests
            RunTests();

            Common.CloseTestLogFile();
        }
Ejemplo n.º 5
0
        public static CmdMessenger Connect(systemSettings systemSettings)
        {
            CmdMessenger = new CmdMessenger(systemSettings.Transport, systemSettings.sendBufferMaxLength) {BoardType = systemSettings.BoardType};
            // Attach to NewLineReceived and NewLineSent for logging purposes
            LogCommands(true);

            CmdMessenger.StartListening();
            return CmdMessenger;
        }
 private void InitializeTests(systemSettings systemSettings, Enumerator command)
 {
     _setupConnection   = new SetupConnection(systemSettings, command);
     _acknowledge       = new Acknowledge(systemSettings, command);
     _clearTextData     = new ClearTextData(systemSettings, command);
     _binaryTextData    = new BinaryTextData(systemSettings, command);
     _multipleArguments = new MultipleArguments(systemSettings, command);
     _transferSpeed     = new TransferSpeed(systemSettings, command);
 }
Ejemplo n.º 7
0
        public static CmdMessenger Connect(systemSettings systemSettings)
        {
            CmdMessenger = new CmdMessenger(systemSettings.Transport, systemSettings.sendBufferMaxLength)
            {
                BoardType = systemSettings.BoardType
            };
            // Attach to NewLineReceived and NewLineSent for logging purposes
            LogCommands(true);

            CmdMessenger.Connect();
            return(CmdMessenger);
        }
Ejemplo n.º 8
0
        public static CmdMessenger Connect(systemSettings systemSettings)
        {
            if (CmdMessenger == null)
            {
                CmdMessenger = new CmdMessenger(systemSettings.Transport, systemSettings.sendBufferMaxLength,
                    systemSettings.BoardType);
            }

            // Attach to NewLineReceived and NewLineSent for logging purposes
            LogCommands(true);

            Connected = CmdMessenger.Connect();
            return CmdMessenger;
        }
Ejemplo n.º 9
0
        public static CmdMessenger Connect(systemSettings systemSettings)
        {
            if (CmdMessenger == null)
            {
                CmdMessenger = new CmdMessenger(systemSettings.Transport, systemSettings.sendBufferMaxLength,
                                                systemSettings.BoardType);
                CmdMessenger.PrintLfCr = true;
            }

            // Attach to NewLineReceived and NewLineSent for logging purposes
            LogCommands(true);

            Connected = CmdMessenger.Connect();
            return(CmdMessenger);
        }
Ejemplo n.º 10
0
 public TransferSpeed(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command = command;
     DefineCommands();
 }
Ejemplo n.º 11
0
 public Acknowledge(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command        = command;
     DefineCommands();
 }
        private void InitializeTests(systemSettings systemSettings, Enumerator command)
        {
            _setupConnection   = new SetupConnection(systemSettings, command);
            _acknowledge       = new Acknowledge(systemSettings, command);
            _clearTextData     = new ClearTextData(systemSettings, command);
            _binaryTextData    = new BinaryTextData(systemSettings, command);
            _multipleArguments = new MultipleArguments(systemSettings, command);
            _transferSpeed     = new TransferSpeed(systemSettings, command);

        }
        public CommandMessengerTest()
        {
            // Set up board & transport mode
            var teensy31 = new systemSettings()
            {
                Description = @"Teensy 3.1",
                MinReceiveSpeed     = 2000000,         // Bits per second    
                MinSendSpeed        = 1250000,         // Bits per second                                       
                MinDirectSendSpeed  = 45000,           // Bits per second                     
                BoardType           = BoardType.Bit32, // 32-bit architecture, needed from binary value conversion
                sendBufferMaxLength = 512,             // Maximum send buffer size, optimally buffer size is similar to embedded controller
                Transport = new SerialTransport
                    {
                        CurrentSerialSettings = new SerialSettings()
                            {
                                PortName = "COM15",    // Can be different!
                                BaudRate = 115200,     // Bits per second
                                DataBits = 8,          // Data bits
                                Parity = Parity.None,  // Bit parity
                                DtrEnable = false,     // Some boards need to send this to enabled                                    
                            },
                            
                    }
            };

            var arduinoNano = new systemSettings()
            {
                Description = @"Arduino Nano /w AT mega328",
                MinReceiveSpeed     = 82000,              // Bits per second 
                MinSendSpeed        = 85000,              // Bits per second                                      
                MinDirectSendSpeed  = 52000,              // Bits per second                
                BoardType           = BoardType.Bit16,    // 16-bit architecture, needed from binary value conversion
                sendBufferMaxLength = 60,                 // Maximum send buffer size, optimally buffer size is similar to embedded controller
                Transport = new SerialTransport
                {
                    CurrentSerialSettings = new SerialSettings()
                    {
                        PortName  = "COM16",                  // Can be different!
                        BaudRate  = 115200,                  // Bits per second
                        DataBits  = 8,                       // Data bits
                        Parity    = Parity.None,             // Bit parity
                        DtrEnable = false,                   // Some boards need to send this to enabled                                    
                    },

                }
            };


            var arduinoNanoBluetooth = new systemSettings()
            {
                Description         = @"Arduino Nano /w AT mega328 - Bluetooth",
                MinReceiveSpeed     = 6500,                         // Bits per second 
                MinSendSpeed        = 7400,                         // Bits per second                                      
                MinDirectSendSpeed  = 8000,                         // Bits per second                
                BoardType           = BoardType.Bit16,              // 16-bit architecture, needed from binary value conversion
                sendBufferMaxLength = 60,                           // Maximum send buffer size, optimally buffer size is similar to embedded controller
                Transport           = new BluetoothTransport()
                {
                    CurrentBluetoothDeviceInfo = BluetoothUtils.DeviceByAdress("20:13:07:26:10:08"),
                    LazyReconnect              = true,              // Only reconnect if really necessary
                }
            };

            var arduinoLeonardoOrProMicro = new systemSettings()
            {
                Description         = @"Arduino Leonardo or Sparkfun ProMicro /w AT mega32u4",
                MinReceiveSpeed     = 82000,               // Bits per second 
                MinSendSpeed        = 90000,               // Bits per second                                      
                MinDirectSendSpeed  = 52000,               // Bits per second                
                BoardType           = BoardType.Bit16,     // 16-bit architecture, needed from binary value conversion
                sendBufferMaxLength = 60,                  // Maximum send buffer size, optimally buffer size is similar to embedded controller
                Transport           = new SerialTransport
                {
                    CurrentSerialSettings = new SerialSettings()
                    {
                        PortName  = "COM13",                 // Can be different!
                        BaudRate  = 115200,                  // Bits per second
                        DataBits  = 8,                       // Data bits
                        Parity    = Parity.None,             // Bit parity
                        DtrEnable = true,                    // Some boards need to send this to enabled                                    
                    },

                }
            };

            // Set up Command enumerators
            var command = DefineCommands();

            // Initialize tests, CHANGE "DEVICE" VARIABLE TO YOUR DEVICE!
            var device = teensy31;
            InitializeTests(device, command);

            // Open log file for testing 
            Common.OpenTestLogFile(@"TestLogFile.txt");
            
            // Run tests
            RunTests();

            Common.CloseTestLogFile();
        }
 public TransferSpeed(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command        = command;
     DefineCommands();
 }
Ejemplo n.º 15
0
        public CommandMessengerTest()
        {
            // Set up board & transport mode
            var teensy31 = new systemSettings()
            {
                Description         = @"Teensy 3.1",
                MinReceiveSpeed     = 2000000,         // Bits per second
                MinSendSpeed        = 1250000,         // Bits per second
                MinDirectSendSpeed  = 45000,           // Bits per second
                BoardType           = BoardType.Bit32, // 32-bit architecture, needed from binary value conversion
                sendBufferMaxLength = 512,             // Maximum send buffer size, optimally buffer size is similar to embedded controller
                Transport           = new SerialTransport
                {
                    CurrentSerialSettings = new SerialSettings()
                    {
                        PortName  = "COM15",           // Can be different!
                        BaudRate  = 115200,            // Bits per second
                        DataBits  = 8,                 // Data bits
                        Parity    = Parity.None,       // Bit parity
                        DtrEnable = false,             // Some boards need to send this to enabled
                    },
                }
            };

            var arduinoNano = new systemSettings()
            {
                Description         = @"Arduino Nano /w AT mega328",
                MinReceiveSpeed     = 82000,              // Bits per second
                MinSendSpeed        = 85000,              // Bits per second
                MinDirectSendSpeed  = 52000,              // Bits per second
                BoardType           = BoardType.Bit16,    // 16-bit architecture, needed from binary value conversion
                sendBufferMaxLength = 60,                 // Maximum send buffer size, optimally buffer size is similar to embedded controller
                Transport           = new SerialTransport
                {
                    CurrentSerialSettings = new SerialSettings()
                    {
                        PortName  = "COM16",                 // Can be different!
                        BaudRate  = 115200,                  // Bits per second
                        DataBits  = 8,                       // Data bits
                        Parity    = Parity.None,             // Bit parity
                        DtrEnable = false,                   // Some boards need to send this to enabled
                    },
                }
            };


            var arduinoNanoBluetooth = new systemSettings()
            {
                Description         = @"Arduino Nano /w AT mega328 - Bluetooth",
                MinReceiveSpeed     = 6500,                         // Bits per second
                MinSendSpeed        = 7400,                         // Bits per second
                MinDirectSendSpeed  = 8000,                         // Bits per second
                BoardType           = BoardType.Bit16,              // 16-bit architecture, needed from binary value conversion
                sendBufferMaxLength = 60,                           // Maximum send buffer size, optimally buffer size is similar to embedded controller
                Transport           = new BluetoothTransport()
                {
                    CurrentBluetoothDeviceInfo = BluetoothUtils.DeviceByAdress("20:13:07:26:10:08"),
                    LazyReconnect = true,                           // Only reconnect if really necessary
                }
            };

            var arduinoLeonardoOrProMicro = new systemSettings()
            {
                Description         = @"Arduino Leonardo or Sparkfun ProMicro /w AT mega32u4",
                MinReceiveSpeed     = 82000,               // Bits per second
                MinSendSpeed        = 90000,               // Bits per second
                MinDirectSendSpeed  = 52000,               // Bits per second
                BoardType           = BoardType.Bit16,     // 16-bit architecture, needed from binary value conversion
                sendBufferMaxLength = 60,                  // Maximum send buffer size, optimally buffer size is similar to embedded controller
                Transport           = new SerialTransport
                {
                    CurrentSerialSettings = new SerialSettings()
                    {
                        PortName  = "COM13",                 // Can be different!
                        BaudRate  = 115200,                  // Bits per second
                        DataBits  = 8,                       // Data bits
                        Parity    = Parity.None,             // Bit parity
                        DtrEnable = true,                    // Some boards need to send this to enabled
                    },
                }
            };

            // Set up Command enumerators
            var command = DefineCommands();

            // Initialize tests, CHANGE "DEVICE" VARIABLE TO YOUR DEVICE!
            var device = teensy31;

            InitializeTests(device, command);

            // Open log file for testing
            Common.OpenTestLogFile(@"TestLogFile.txt");

            // Run tests
            RunTests();

            Common.CloseTestLogFile();
        }
Ejemplo n.º 16
0
 public ClearTextData(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command = command;
     DefineCommands();          
 }
Ejemplo n.º 17
0
 public SetupConnection(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command = command;
     DefineCommands();
 }
Ejemplo n.º 18
0
 public ClearTextData(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command        = command;
     DefineCommands();
 }
Ejemplo n.º 19
0
 public SetupConnection(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command        = command;
     DefineCommands();
 }
Ejemplo n.º 20
0
 public Acknowledge(systemSettings systemSettings, Enumerator command)
 {
     _systemSettings = systemSettings;
     _command = command;
     DefineCommands();
 }