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); }
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 { } }
public static byte[] ToByteArray(this FaHDeviceType thisDeviceType) { UInt16 deviceID = (UInt16)thisDeviceType; return(KNXHelpers.uint16ToKnx(deviceID)); }