public static Packets.LicensePlatePacket GetDefaultPacket() { var plateExpected = new Packets.LicensePlatePacket(); plateExpected.LicensePlate = new LicensePlate("cd", "12345678", LicensePlateCategory.Car); plateExpected.CaptureLocation = new Location(2); IList<byte[]> imgData = new List<byte[]>(); imgData.Add( Resource.Winter ); imgData.Add( Resource.Winter ); imgData.Add( Resource.Winter ); plateExpected.EvidenceImageData = imgData; return plateExpected; }
private Packets.LicensePlatePacket Parse(byte[] buffer, int offset, int length) { int cursor = offset; string plate = ParsePlateString(buffer, ref cursor); uint color = ParseColor(buffer, ref cursor); DateTime time = ParseTime(buffer, ref cursor); uint location = ParseLocation(buffer, ref cursor); uint imgCount = BitConverter.ToUInt32(buffer, cursor); cursor += 4; uint[] imgLen = ParseImageArrayLength(buffer, ref cursor, imgCount); IList<byte[]> images = ParseImgArray(buffer, ref cursor, imgCount, imgLen); var packet = new Packets.LicensePlatePacket(); packet.CaptureLocation = new Location(location); packet.CaptureTime = time; packet.EvidenceImageData = images; packet.LicensePlate = new LicensePlate("", plate, LicensePlateCategory.Car); return packet; }