Update contrib.
1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\misc\ymodem.h
21 #ifndef __KERNEL_MODE__
25 #include <kernel/kernel.h>
29 const TUint8 SOH=0x01;
30 const TUint8 STX=0x02;
31 const TUint8 EOT=0x04;
32 const TUint8 ACK=0x06;
33 const TUint8 NAK=0x15;
34 const TUint8 CAN=0x18;
35 const TUint8 SUB=0x1A;
36 const TUint8 BIGC=0x43;
37 const TUint8 BIGG=0x47;
39 const TInt KErrZeroLengthPacket=-200;
40 const TInt KErrPacketTooShort=-201;
41 const TInt KErrBadPacketType=-202;
42 const TInt KErrCorruptSequenceNumber=-203;
43 const TInt KErrWrongSequenceNumber=-204;
44 const TInt KErrBadCrc=-205;
45 const TInt KErrBadTerminationPacket=-206;
47 class YModem : public BASE
50 TInt StartDownload(TBool aG, TInt& aLength, TDes& aName);
51 TInt ReadPackets(TUint8*& aDest, TInt aLength);
54 void UpdateCrc(const TUint8* aPtr, TInt aLength);
55 TInt CheckPacket(TUint8* aDest);
56 TInt ReadPacket(TDes8& aDest);
57 virtual TInt ReadBlock(TDes8& aDest)=0;
58 virtual void WriteC(TUint aChar)=0;
68 TBuf8<1040> iPacketBuf;