示例#1
0
        public static FaHDeviceType FromByteArray(this FaHDeviceType dummy, byte[] input, UInt16 begin)
        {
            if (input.Length - begin < 1)
            {
                throw new InternalBufferOverflowException();
            }

            FaHDeviceType DeviceType = (FaHDeviceType)KNXHelpers.knxToUint16(input, begin);

            return(DeviceType);
        }
示例#2
0
        public void WriteOut(KNXmessage Message)
        {
            if (!write)
            {
                throw new InvalidOperationException();
            }
            try
            {
                string dtFormat = Message.Timestamp.ToString("yyyy-MM-dd HH:mm:ss.fff");

                string str = string.Format("{0}; {1}", dtFormat, KNXHelpers.GetStringHex(Message.toByteArray()));
                if (!string.IsNullOrEmpty(str))
                {
                    fReg.WriteLine(str);
                    fReg.Flush();
                }
            }
            catch { }
        }
示例#3
0
        public static byte[] ToByteArray(this FaHDeviceType thisDeviceType)
        {
            UInt16 deviceID = (UInt16)thisDeviceType;

            return(KNXHelpers.uint16ToKnx(deviceID));
        }