Esempio n. 1
0
        public void CanDeserializeHeader()
        {
            ComFileHeader header = ComFileHeader.FromBytes(comFileHeaderBuffer);

            Assert.AreEqual(0x80, header.MagicBytes[0]);
            Assert.AreEqual(0x08, header.MagicBytes[1]);
            Assert.AreEqual(0x0200, header.LoadAddress);
            Assert.AreEqual(0x12D1, header.ObjectSize);
            Assert.AreEqual("BS93", Encoding.ASCII.GetString(header.Bs93Signature));
        }
Esempio n. 2
0
        public void UploadComFile(string portName, byte[] file, int baudRate = 62500)
        {
            ComFileHeader header = ComFileHeader.FromBytes(file);

            //if (!header.Verify())
            //{
            //	Console.WriteLine("Invalid Lynx Com file");
            //}

            UploadCore(portName, header, file, ComFileHeader.HEADER_SIZE,
                       file.Length - ComFileHeader.HEADER_SIZE, baudRate);
        }