/// <summary> /// Create a multiple-address-read response packet /// </summary> public static SsmPacket CreateMultipleReadResponse(IList <byte> values) { SsmPacket packet = new SsmPacket(); packet.SetHeader(SsmDirection.FromEcu, SsmCommand.ReadAddressesResponse); for (int i = 0; i < values.Count; i++) { packet.AppendByte(values[i]); } packet.SetLengthByte(); packet.AppendChecksum(); return(packet); }
/// <summary> /// Create a block-read request packet /// </summary> public static SsmPacket CreateBlockReadRequest(int address, int length) { if (length == int.MinValue) { throw new ArgumentOutOfRangeException("length"); } SsmPacket packet = new SsmPacket(); packet.SetHeader(SsmDirection.ToEcu, SsmCommand.ReadBlockRequest); packet.AppendAddress(address); packet.AppendByte((byte)(length - 1)); packet.SetLengthByte(); packet.AppendChecksum(); return(packet); }