Ejemplo n.º 1
0
 public static KnxNetIPHeader Parse(byte[] buffer, int index)
 {
     return(new KnxNetIPHeader
     {
         HeaderSize = buffer[index],
         Version = buffer[index + 1],
         ServiceType = KnxBitConverter.ToShort(buffer, index + 2),
         Size = KnxBitConverter.ToShort(buffer, index + 4)
     });
 }
Ejemplo n.º 2
0
        public byte[] GetBytes()
        {
            byte[] buffer = new byte[6];

            buffer[0] = HeaderSize;
            buffer[1] = Version;

            Array.Copy(KnxBitConverter.GetBytes(ServiceType), 0, buffer, 2, 2);
            Array.Copy(KnxBitConverter.GetBytes(Size), 0, buffer, 4, 2);

            return(buffer);
        }