|
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 #include "comreadwrite.h" |
|
17 #include "SCONREQC.H" |
|
18 #include "GLOBAL.H" |
|
19 |
|
20 #include <e32base.h> |
|
21 |
|
22 |
|
23 SCONreqCommand::SCONreqCommand() |
|
24 { |
|
25 } |
|
26 |
|
27 SCONreqCommand::SCONreqCommand(CComReadWrite* aComReadWrite) |
|
28 { |
|
29 iComReadWrite = aComReadWrite; |
|
30 } |
|
31 |
|
32 SCONreqCommand::~SCONreqCommand() |
|
33 { |
|
34 } |
|
35 |
|
36 /* |
|
37 * Method description: Builds the packet |
|
38 * |
|
39 */ |
|
40 |
|
41 void SCONreqCommand::Create() |
|
42 { |
|
43 TBuf8<255> neginf; // neginf |
|
44 |
|
45 neginf.Append(KTranpNegVer); |
|
46 neginf.Append(KTranpFR); |
|
47 neginf.Append(m_PDU); |
|
48 neginf.Append(KTranpCR); |
|
49 neginf.Append(KTranpLF); |
|
50 neginf.Append(KTranpID); |
|
51 neginf.Append(KTranpProductInformationString); |
|
52 neginf.Append(KTranpCR); |
|
53 neginf.Append(KTranpLF); |
|
54 |
|
55 m_oData.Append(0x00); |
|
56 m_oData.Append(KTranpMsgTypeCER); |
|
57 m_oData.Append(KTranpInfTypeVer); |
|
58 m_oData.Append(0x01); |
|
59 m_oData.Append(KTranpInfTypeNeg); |
|
60 |
|
61 m_oData.Append(neginf.Length() + 18); // Hardcoded, but always the same .. size of the parts below. |
|
62 |
|
63 m_oData.Append(KTranpInfVer); |
|
64 m_oData.Append(KTranpCFLGie); |
|
65 |
|
66 m_oData.Append(m_PMID); |
|
67 m_oData.Append(m_SMID); |
|
68 |
|
69 m_oData.Append(neginf); |
|
70 |
|
71 m_oData.Append(KTranpInfTypeExt); |
|
72 m_oData.Append(0x02); |
|
73 m_oData.Append(0x00); |
|
74 m_oData.Append(0x00); |
|
75 |
|
76 } |
|
77 |
|
78 /* |
|
79 * Method description: Sends the packet |
|
80 * |
|
81 */ |
|
82 |
|
83 void SCONreqCommand::DoIt() |
|
84 { |
|
85 iComReadWrite->Send(m_oData); |
|
86 } |
|
87 |
|
88 void SCONreqCommand::GetReply() |
|
89 { |
|
90 // We won't use this at all! |
|
91 } |
|
92 |
|
93 /* |
|
94 * Method description: Retrieves the packet - used for debugging purposes |
|
95 * |
|
96 * Returns: Pointer to the packet |
|
97 */ |
|
98 |
|
99 TDesC8& SCONreqCommand::GetData() |
|
100 { |
|
101 return m_oData; |
|
102 } |
|
103 |
|
104 /* |
|
105 * Method description: Sets the Primary Machine ID |
|
106 * |
|
107 * Parameter: a_PMID - the new Machine ID |
|
108 */ |
|
109 |
|
110 void SCONreqCommand::SetPMID(TPtr8 a_PMID) |
|
111 { |
|
112 m_PMID = a_PMID; |
|
113 } |
|
114 |
|
115 /* |
|
116 * Method description: Sets the Secondary Machine ID |
|
117 * |
|
118 * Parameter: a_SMID - the new Machine ID |
|
119 */ |
|
120 |
|
121 void SCONreqCommand::SetSMID(TPtr8 a_SMID) |
|
122 { |
|
123 m_SMID = a_SMID; |
|
124 } |
|
125 |
|
126 /* |
|
127 * Method description: Sets the maximum receivable PDU size |
|
128 * |
|
129 * Parameter: a_PDU - the new PDU size |
|
130 */ |
|
131 |
|
132 void SCONreqCommand::SetPDU(TUint8 a_PDU) |
|
133 { |
|
134 m_PDU = a_PDU; |
|
135 } |