/// <summary> /// /// </summary> /// <param name="msgId"></param> /// <param name="vin"></param> /// <param name="askId"></param> /// <returns></returns> public static JTNEPackage_Device Create(this JTNEMsgId_Device msgId, string vin, JTNEAskId askId) { JTNEPackage_Device jTNEPackage = new JTNEPackage_Device(); jTNEPackage.AskId = askId.ToByteValue(); jTNEPackage.MsgId = msgId.ToByteValue(); jTNEPackage.VIN = vin; return(jTNEPackage); }
private static void InitMap() { foreach (var item in Enum.GetNames(typeof(JTNEMsgId_Device))) { JTNEMsgId_Device msgId_Device = item.ToEnum <JTNEMsgId_Device>(); JTNEBodiesTypeAttribute jT808BodiesTypeAttribute = msgId_Device.GetAttribute <JTNEBodiesTypeAttribute>(); map.Add((byte)msgId_Device, jT808BodiesTypeAttribute?.JT808BodiesType); } }
/// <summary> /// /// </summary> /// <typeparam name="TJTNEBodies"></typeparam> /// <param name="msgId"></param> /// <param name="askId"></param> /// <param name="vin"></param> /// <param name="bodies"></param> /// <returns></returns> public static JTNEPackage_Device Create <TJTNEBodies>(this JTNEMsgId_Device msgId, string vin, JTNEAskId askId, TJTNEBodies bodies) where TJTNEBodies : JTNEBodies { JTNEPackage_Device jTNEPackage = new JTNEPackage_Device(); jTNEPackage.AskId = askId.ToByteValue(); jTNEPackage.MsgId = msgId.ToByteValue(); jTNEPackage.Bodies = bodies; jTNEPackage.VIN = vin; return(jTNEPackage); }