|
1 // Copyright (c) 1997-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 "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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef GLOBAL_H |
|
17 #define GLOBAL_H |
|
18 |
|
19 #define __CONSOLE__ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32cons.h> |
|
23 |
|
24 _LIT8(KTranpProductInformationString, "Symbian TranP"); |
|
25 |
|
26 // constants used by SCEP |
|
27 |
|
28 const TUint8 KTranpMsgTypeCER = 0x10; // MsgType = Connection establishment request |
|
29 const TUint8 KTranpMsgTypeCEC = 0x11; // MsgType = Connection establishment confirmation |
|
30 const TUint8 KTranpMsgTypeData = 0x20; // Data (Command) |
|
31 const TUint8 KTranpMsgTypeDisc = 0x30; // Disconnection |
|
32 |
|
33 const TUint8 KTranpInfTypeVer = 0x00; // Version of MsgType |
|
34 const TUint8 KTranpInfTypeNeg = 0x01; // Negotiation Information |
|
35 const TUint8 KTranpInfTypeUser = 0x03; // UserData |
|
36 const TUint8 KTranpInfTypeExt = 0x10; // Extend in the future |
|
37 const TUint8 KTranpInfTypeRsn = 0x20; // Reason |
|
38 |
|
39 const TUint8 KTranpInfVer = 0x10; // Version of InfType |
|
40 |
|
41 // Only bit 6 and 7 count here! Use OR! |
|
42 const TUint8 KTranpPduTypeReq = 0x00; // Req PDU - %00 000000 |
|
43 const TUint8 KTranpPduTypeRplAck = 0x40; // Rpl PDU Ack - %01 000000 |
|
44 const TUint8 KTranpPduTypeRplNack = 0x80; // Rpl PDU Nack - %10 000000 |
|
45 const TUint8 KTranpPduTypeAbt = 0xc0; // Abt PDU - %11 000000 |
|
46 |
|
47 const TUint8 KTranpCFLGi = 0x00; // Machine can issue but not execute commands |
|
48 const TUint8 KTranpCFLGie = 0x04; // Machine can issue and execute commands |
|
49 |
|
50 const TUint8 KTranpDFLGnseg = 0xc1; // PDU not segmented (single PDU) |
|
51 const TUint8 KTranpDFLGfPDU = 0x41; // First segmented PDU |
|
52 const TUint8 KTranpDFLGiPDU = 0x01; // Intermediate segmented PDUs |
|
53 const TUint8 KTranpDFLGlPDU = 0x81; // Last segmented PDU |
|
54 const TUint8 KTranpDFLGcint = 0xc2; // Communication interruption |
|
55 const TUint8 KTranpDFLGrcon = 0xc3; // Reject to request connection |
|
56 |
|
57 const TUint8 KTranpNegVer = 0x11; // NegVer, version of NegInf |
|
58 |
|
59 _LIT8(KTranpFR, "fr:"); |
|
60 _LIT8(KTranpID, "id:"); |
|
61 _LIT8(KTranpNM, "nm:"); |
|
62 _LIT8(KTranpPW, "pw:"); |
|
63 const TUint8 KTranpCR = 0x0d; |
|
64 const TUint8 KTranpLF = 0x0a; |
|
65 |
|
66 const TUint16 KTranpDisPDUrsnUR = 0x0000; // Unspecified Reason |
|
67 const TUint16 KTranpDisPDUrsnUD = 0x0001; // User Disconnect |
|
68 const TUint16 KTranpDisPDUrsnPD = 0x0002; // Provider Disconnect |
|
69 |
|
70 // bFTP |
|
71 |
|
72 // AttNames |
|
73 _LIT8(KTranpFIL0, "FIL0"); // File name |
|
74 _LIT8(KTranpLFL0, "LFL0"); // Long file name |
|
75 _LIT8(KTranpTIM0, "TIM0"); // Time of creation (YYYYMMDDHHMMSS) |
|
76 _LIT8(KTranpTYP0, "TYP0"); // Information on file or thumbnail |
|
77 _LIT8(KTranpTMB0, "TMB0"); // The scale-down image |
|
78 _LIT8(KTranpBDY0, "BDY0"); // ? |
|
79 _LIT8(KTranpCMD0, "CMD0"); // Command name |
|
80 _LIT8(KTranpWHT0, "WHT0"); // Category name |
|
81 _LIT8(KTranpERR0, "ERR0"); // ERRCODE |
|
82 _LIT8(KTranpRPL0, "RPL0"); // Stored filename |
|
83 |
|
84 // AttValue of AttName = "WHT0" |
|
85 _LIT8(KTranpRIMG, "RIMG"); // Wants to know the data on a still image |
|
86 _LIT8(KTranpRINF, "RINF"); // Wants to know details of the responder system |
|
87 _LIT8(KTranpRCMD, "RCMD"); // Wants to know details on the processable commands |
|
88 |
|
89 const TInt KTranpUPFHeader = 384; // Size of the UPF header |
|
90 |
|
91 // Time and Date information offsets |
|
92 const TInt KTranpDateOffset = 20; |
|
93 const TInt KTranpTimeZoneOffset = 0; |
|
94 const TInt KTranpYearOffset = 1; |
|
95 const TInt KTranpMonthOffset = 3; |
|
96 const TInt KTranpDayOffset = 4; |
|
97 const TInt KTranpHourOffset = 5; |
|
98 const TInt KTranpMinuteOffset = 6; |
|
99 const TInt KTranpSecondOffset = 7; |
|
100 |
|
101 // Picture Size offsets |
|
102 const TInt KTranpPictureInfOffset = 286; |
|
103 const TInt KTranpPictureXSizeOffset = 0; |
|
104 const TInt KTranpPictureYSizeOffset = 2; |
|
105 |
|
106 const TInt KTranpUPFEntryArea1 = 240; // Thumbnail |
|
107 const TInt KTranpUPFEntryArea2 = 276; // Image |
|
108 const TInt KTranpUPFEntryArea3 = 312; // Reserved 1 |
|
109 const TInt KTranpUPFEntryArea4 = 248; // Reserved 2 |
|
110 const TUint KNullImageAddress = 0xFFFFFFFF; |
|
111 |
|
112 NONSHARABLE_CLASS(IrTranpUtil) |
|
113 { |
|
114 public: |
|
115 static void HexOut(const TDesC8& aBuffer); |
|
116 |
|
117 static void DAppend(TDes8* aBuffer, TUint16 aValue); |
|
118 static void LAppend(TDes8* aBuffer, TUint32 aValue); |
|
119 |
|
120 static TUint16 DExtract(const TDesC8& aBuffer, TInt aOffset); |
|
121 static TUint32 LExtract(const TDesC8& aBuffer, TInt aOffset); |
|
122 }; |
|
123 |
|
124 |
|
125 |
|
126 #endif // GLOBAL_H |