예제 #1
0
 private bool IsEqual(FaHDeviceAddress address)
 {
     for (int i = 0; i < FAHAddress.Length; i++)
     {
         if (FAHAddress[i] != address.byteValue[i])
         {
             return(false);
         }
     }
     return(true);
 }
예제 #2
0
        /*
         * public static FaHDeviceAddress FromHexString(string hexstring)
         * {
         *  return FromByteArray(KNXHelpers.StringToByteArray(hexstring), 0);
         * }
         */

        public static FaHDeviceAddress FromByteArray(byte[] input, UInt16 begin)
        {
            if (input.Length - begin < 6)
            {
                throw new InternalBufferOverflowException();
            }

            byte[] target = new byte[6];
            Array.Copy(input, begin, target, 0, 6);
            FaHDeviceAddress n = new FaHDeviceAddress
            {
                byteValue = target
            };

            return(n);
        }