Example #1
0
 public static DUID GetDUID(UInt16 code, Byte[] data)
 {
     if (_constructorDict.ContainsKey(code) == true)
     {
         return(_constructorDict[code].Invoke(data));
     }
     else
     {
         return(UnknownDUID.FromByteArray(data, 0));
     }
 }
Example #2
0
 static DUIDFactory()
 {
     _constructorDict = new Dictionary <UInt16, Func <byte[], DUID> >
     {
         { (Byte)DUIDTypes.LinkLayer, (data) => LinkLayerAddressDUID.FromByteArray(data, 0) },
         { (Byte)DUIDTypes.LinkLayerAndTime, (data) => LinkLayerAddressAndTimeDUID.FromByteArray(data, 0) },
         { (Byte)DUIDTypes.Unknown, (data) => UnknownDUID.FromByteArray(data, 0) },
         { (Byte)DUIDTypes.Uuid, (data) => UUIDDUID.FromByteArray(data, 0) },
         { (Byte)DUIDTypes.VendorBased, (data) => VendorBasedDUID.FromByteArray(data, 0) },
     };
 }