Beispiel #1
0
        public void TestGetConfiguration()
        {
            using (SerialPort serial = new SerialPort("/dev/ttyACM0"))
            {
                serial.Open();
                using (DVRPTR dvrptr = new DVRPTR(new PCP2DVRPTRio(serial.BaseStream, false)))
                {
                    dvrptr.TimeOut = TimeSpan.FromMilliseconds(-1);//this will give us infinite timeout so we can debug
                    dvrptr.Open();
                    Configuration config = dvrptr.GetConfiguration();

                    Assert.IsNotNull(config, "config should not be null");
                    Console.WriteLine(config);
                }
            }
        }
Beispiel #2
0
        public void TestGetSerial()
        {
            using (SerialPort serial = new SerialPort("/dev/ttyACM0"))
            {
                serial.Open();
                using (DVRPTR dvrptr = new DVRPTR(new PCP2DVRPTRio(serial.BaseStream, false)))
                {
                    dvrptr.TimeOut = TimeSpan.FromMilliseconds(-1);//this will give us infinite timeout so we can debug
                    dvrptr.Open();
                    DVRPTRSerialNumber serialNumber = dvrptr.GetSerialNumber();

                    Assert.IsNotNull(serialNumber, "version should not be null");
                    Console.WriteLine("Year {0} Week {1} Number : {2}", serialNumber.Year, serialNumber.Week, serialNumber.Number);
                    Console.WriteLine(serialNumber.ToString());
                }
            }
        }