Example #1
0
        public static int Encode(System.IO.Stream buffer, System.Net.NetworkInformation.PhysicalAddress destination, System.Net.NetworkInformation.PhysicalAddress source, Type type)
        {
            //destination
            DCP.EncodeOctets(buffer, destination.GetAddressBytes());

            //source
            DCP.EncodeOctets(buffer, source.GetAddressBytes());

            //type
            DCP.EncodeU16(buffer, (ushort)type);

            return(14);
        }
Example #2
0
        public static int Encode(System.IO.Stream buffer, Priorities priority, Type type)
        {
            UInt16 tmp = 0;

            //Priority
            tmp |= (UInt16)((((UInt16)priority) & 0x7) << 13);

            //CanonicalFormatIdentificator
            tmp |= 0 << 12;

            //VLAN_Id
            tmp |= 0;

            DCP.EncodeU16(buffer, tmp);
            DCP.EncodeU16(buffer, (UInt16)type);

            return(4);
        }
Example #3
0
 public static int EncodeFrameId(System.IO.Stream buffer, FrameIds value)
 {
     return(DCP.EncodeU16(buffer, (ushort)value));
 }