Beispiel #1
0
 public void TestFromHexDigit()
 {
     Assert.AreEqual((byte)68, ByteUtility.FromHexDigit(0x68));
     Assert.AreEqual((byte)27, ByteUtility.FromHexDigit(0x27));
     Assert.AreEqual((byte)93, ByteUtility.FromHexDigit(0x93));
     Assert.AreEqual((byte)40, ByteUtility.FromHexDigit(0x40));
     Assert.AreEqual((byte)08, ByteUtility.FromHexDigit(0x08));
 }
Beispiel #2
0
        private static long ParseAddress(byte[] dltData)
        {
            var address = 0L;

            for (var i = 6; i >= 1; --i)
            {
                var twoDigit = ByteUtility.FromHexDigit(dltData[i]);
                address *= 100;
                address += twoDigit;
            }

            return(address);
        }