using System; using GPSBusiness.Helper; namespace GPSBusiness.BBGPSStandard { /// /// 终端注册 /// public class Data_0100 { /// /// 省域ID /// public UInt16 ProvinceID; /// /// 市县域ID /// public UInt16 CityID; /// /// 制造商ID /// public byte[] Factory; /// /// 终端型号 /// public byte[] MdtType; /// /// 终端ID /// public byte[] MdtID; /// /// 车牌颜色 /// public byte NumberColor; /// /// 车牌 /// public string Number; public void FromBytes(Data_0100 model, byte[] buffer) { model.ProvinceID = ByteConvert.ToUInt16(buffer, 0); model.CityID = ByteConvert.ToUInt16(buffer, 2); model.Factory = ByteConvert.ToBytes(buffer, 4, 5); model.MdtType = ByteConvert.ToBytes(buffer, 9, 8); model.MdtID = ByteConvert.ToBytes(buffer, 17, 7); model.NumberColor = buffer[24]; model.Number = ByteConvert.ToString(buffer, 25, buffer.Length - 25); } } }