Esempio n. 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);
        }
Esempio n. 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 { }
        }
Esempio n. 3
0
        public static byte[] ToByteArray(this FaHDeviceType thisDeviceType)
        {
            UInt16 deviceID = (UInt16)thisDeviceType;

            return(KNXHelpers.uint16ToKnx(deviceID));
        }