예제 #1
0
 public void TestToHexDigit()
 {
     Assert.AreEqual((byte)0x68, ByteUtility.ToHexDigit(68));
     Assert.AreEqual((byte)0x27, ByteUtility.ToHexDigit(27));
     Assert.AreEqual((byte)0x93, ByteUtility.ToHexDigit(93));
     Assert.AreEqual((byte)0x40, ByteUtility.ToHexDigit(40));
     Assert.AreEqual((byte)0x08, ByteUtility.ToHexDigit(08));
 }
예제 #2
0
 private static void AssignAddress(byte[] dltData, long address)
 {
     for (var i = 1; i <= 6; ++i)
     {
         var twoDigit = (byte)(address % 100);
         var hexDigit = ByteUtility.ToHexDigit(twoDigit);
         dltData[i] = hexDigit;
         address   /= 100;
     }
 }