Beispiel #1
0
        public static KWP2000Message SendRequestEraseFlashResultMessage(KWP2000Interface commInterface)
        {
            byte[] tempData = new byte[1];
            tempData[0] = (byte)KWP2000VAGLocalIdentifierRoutine.EraseFlash;

            return(commInterface.SendMessage((byte)KWP2000ServiceID.RequestRoutineResultsByLocalIdentifier, tempData));
        }
Beispiel #2
0
        public static KWP2000Message SendRequestUploadMessage(KWP2000Interface commInterface, uint address, uint size, byte format)
        {
            byte[] data = new byte[7];
            data[0] = (byte)((address >> 16) & 0xFF);
            data[1] = (byte)((address >> 8) & 0xFF);
            data[2] = (byte)(address & 0xFF);
            data[3] = format;
            data[4] = (byte)((size >> 16) & 0xFF);
            data[5] = (byte)((size >> 8) & 0xFF);
            data[6] = (byte)(size & 0xFF);

            return(commInterface.SendMessage((byte)KWP2000ServiceID.RequestUpload, data));
        }
Beispiel #3
0
        public static KWP2000Message SendValidateFlashChecksumMessage(KWP2000Interface commInterface, uint startAddress, uint endAddress, ushort checksum)
        {
            Debug.Assert(startAddress % 2 == 0);
            Debug.Assert(endAddress % 2 == 1);

            byte[] tempData = new byte[9];
            tempData[0] = (byte)KWP2000VAGLocalIdentifierRoutine.ValidateFlashChecksum;
            tempData[1] = (byte)((startAddress >> 16) & 0xFF);
            tempData[2] = (byte)((startAddress >> 8) & 0xFF);
            tempData[3] = (byte)((startAddress) & 0xFF);
            tempData[4] = (byte)((endAddress >> 16) & 0xFF);
            tempData[5] = (byte)((endAddress >> 8) & 0xFF);
            tempData[6] = (byte)((endAddress) & 0xFF);
            tempData[7] = (byte)((checksum >> 8) & 0xFF);
            tempData[8] = (byte)((checksum) & 0xFF);

            return(commInterface.SendMessage((byte)KWP2000ServiceID.StartRoutineByLocalIdentifier, tempData));
        }
Beispiel #4
0
        public static KWP2000Message SendRequestEraseFlashMessage(KWP2000Interface commInterface, uint startAddress, uint endAddress, string flashToolCode)
        {
            Debug.Assert(flashToolCode != null);
            Debug.Assert(flashToolCode.Length <= 6);
            char[] FTC = flashToolCode.ToCharArray();

            byte[] tempData = new byte[13];
            tempData[0]  = (byte)KWP2000VAGLocalIdentifierRoutine.EraseFlash;
            tempData[1]  = (byte)((startAddress >> 16) & 0xFF);
            tempData[2]  = (byte)((startAddress >> 8) & 0xFF);
            tempData[3]  = (byte)((startAddress) & 0xFF);
            tempData[4]  = (byte)((endAddress >> 16) & 0xFF);
            tempData[5]  = (byte)((endAddress >> 8) & 0xFF);
            tempData[6]  = (byte)((endAddress) & 0xFF);
            tempData[7]  = (byte)FTC[0];
            tempData[8]  = (byte)FTC[1];
            tempData[9]  = (byte)FTC[2];
            tempData[10] = (byte)FTC[3];
            tempData[11] = (byte)FTC[4];
            tempData[12] = (byte)FTC[5];

            return(commInterface.SendMessage((byte)KWP2000ServiceID.StartRoutineByLocalIdentifier, tempData));
        }