24
|
1 |
// Copyright (c) 2003-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 |
// sms stack commdb util functions
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include <f32file.h>
|
|
23 |
#include <e32test.h>
|
|
24 |
#include <d32comm.h>
|
|
25 |
#include <faxdefn.h>
|
|
26 |
#include <cdblen.h>
|
|
27 |
#include <cdbtemp.h>
|
|
28 |
#include "tsmscdb.h"
|
|
29 |
#include "autotest.h"
|
|
30 |
|
|
31 |
|
|
32 |
_LIT(KVodafoneSC,"+447785016005"); //Vodafone
|
|
33 |
|
|
34 |
|
|
35 |
GLREF_D RTest gTest;
|
|
36 |
GLDEF_D CCommsDatabase* TheDb;
|
|
37 |
|
|
38 |
GLDEF_C TUint32 TcpProtocolId;
|
|
39 |
GLDEF_C TUint32 UdpProtocolId;
|
|
40 |
GLDEF_C TUint32 IcmpProtocolId;
|
|
41 |
GLDEF_C TUint32 IpProtocolId;
|
|
42 |
GLDEF_C TUint32 IrmuxProtocolId;
|
|
43 |
GLDEF_C TUint32 TinyTPProtocolId;
|
|
44 |
GLDEF_C TUint32 SmsProtocolId;
|
|
45 |
GLDEF_C TUint32 WapProtocolId;
|
|
46 |
GLDEF_C TUint32 PlpProtocolId;
|
|
47 |
GLDEF_C TUint32 Link1ProtocolId;
|
|
48 |
GLDEF_C TUint32 PlpLoopProtocolId;
|
|
49 |
GLDEF_C TUint32 BtLinkManagerProtocolId;
|
|
50 |
GLDEF_C TUint32 L2capProtocolId;
|
|
51 |
GLDEF_C TUint32 RfCommProtocolId;
|
|
52 |
GLDEF_C TUint32 SdpProtocolId;
|
|
53 |
|
|
54 |
LOCAL_C void CreateLocationTableL( TMyDialLocation aLocDataFax, TMyDialLocation aLocServSMS);
|
|
55 |
LOCAL_C void CreateModemTablesL( TMyModemType aModemDataFax, TMyModemType aModemServSMS,
|
|
56 |
TUint aCommPortDataFax, TUint aCommPortServSMS );
|
|
57 |
LOCAL_C void CreateChargecardTableL();
|
|
58 |
LOCAL_C TUint32 CreateISPTableL();
|
|
59 |
LOCAL_C void PopulateTemplatesL();
|
|
60 |
|
|
61 |
#ifndef MODEM_PHONE_SERVICES_SMS
|
|
62 |
// TODO - #ifndef has to be removed later
|
|
63 |
LOCAL_C void CreateInterfaceSettingsTableL();
|
|
64 |
LOCAL_C void CreateProtocolBindingsTableL();
|
|
65 |
LOCAL_C void CreateProtocolFamiliesTableL();
|
|
66 |
#endif
|
|
67 |
|
|
68 |
|
|
69 |
GLDEF_C void CreateCommDBL( TMyModemType aModemDataFax, TMyModemType aModemServSMS,
|
|
70 |
TMyDialLocation aLocDataFax, TMyDialLocation aLocServSMS,
|
|
71 |
TUint aCommPortDataFax, TUint aCommPortServSMS )
|
|
72 |
/**
|
|
73 |
* @test Create a special CommDb Database for this test suite.
|
|
74 |
*/
|
|
75 |
{
|
|
76 |
gTest.Printf(_L("Creating the Chargecard. Modem and Location Tables\n"));
|
|
77 |
|
|
78 |
// at first delete the old comms db file
|
|
79 |
RFs fs;
|
|
80 |
_LIT(KSvDbFileName,"C:\\System\\Data\\Cdbv3.dat");
|
|
81 |
CHECKPOINT(fs.Connect()==KErrNone);
|
|
82 |
TUint dummy;
|
|
83 |
if(fs.Att(KSvDbFileName,dummy)==KErrNone)
|
|
84 |
CHECKPOINT(fs.Delete(KSvDbFileName)==KErrNone);
|
|
85 |
fs.Close();
|
|
86 |
|
|
87 |
TheDb=CCommsDatabase::NewL(EDatabaseTypeIAP);
|
|
88 |
CleanupStack::PushL(TheDb);
|
|
89 |
CHECKPOINT(TheDb->BeginTransaction()==KErrNone);
|
|
90 |
|
|
91 |
#ifndef MODEM_PHONE_SERVICES_SMS
|
|
92 |
// TODO - #ifndef has to be removed later
|
|
93 |
CreateInterfaceSettingsTableL();
|
|
94 |
CreateProtocolBindingsTableL();
|
|
95 |
CreateProtocolFamiliesTableL();
|
|
96 |
#endif
|
|
97 |
|
|
98 |
//
|
|
99 |
// Write the database tables
|
|
100 |
//
|
|
101 |
TUint32 ispId=CreateISPTableL();
|
|
102 |
CreateChargecardTableL();
|
|
103 |
CreateLocationTableL( aLocDataFax, aLocServSMS );
|
|
104 |
CreateModemTablesL( aModemDataFax, aModemServSMS, aCommPortDataFax, aCommPortServSMS );
|
|
105 |
PopulateTemplatesL();
|
|
106 |
|
|
107 |
CCommsDbTableView* table=TheDb->OpenTableLC(TPtrC(DIAL_OUT_IAP));
|
|
108 |
|
|
109 |
TUint32 id;
|
|
110 |
CHECKPOINT(table->InsertRecord(id)==KErrNone);
|
|
111 |
table->WriteTextL(TPtrC(COMMDB_NAME),_L("Test Configuration: GsmBsc Loopback"));
|
|
112 |
table->WriteUintL(TPtrC(IAP_ISP),ispId);
|
|
113 |
// table->WriteUintL(TPtrC(IAP_MODEM),modemId);
|
|
114 |
CHECKPOINT(table->PutRecordChanges()==KErrNone);
|
|
115 |
//
|
|
116 |
// Set the Default
|
|
117 |
//
|
|
118 |
TheDb->SetGlobalSettingL(TPtrC(DIAL_OUT_IAP),id);
|
|
119 |
TheDb->SetGlobalSettingL(TPtrC(REDIAL_ATTEMPTS),3);
|
|
120 |
TheDb->SetGlobalSettingL(TPtrC(SMS_BEARER),1); //vep
|
|
121 |
TheDb->SetGlobalSettingL(TPtrC(SMS_RECEIVE_MODE),2); //vep
|
|
122 |
|
|
123 |
|
|
124 |
CleanupStack::PopAndDestroy();
|
|
125 |
CHECKPOINT(TheDb->CommitTransaction()==KErrNone);
|
|
126 |
CleanupStack::PopAndDestroy();
|
|
127 |
}
|
|
128 |
|
|
129 |
#ifndef MODEM_PHONE_SERVICES_SMS
|
|
130 |
// TODO - #ifndef has to be removed later
|
|
131 |
GLDEF_C void CreateProtocolBindingsTableL()
|
|
132 |
{
|
|
133 |
// This section contains information previously stored in esk files
|
|
134 |
// Esock reads the database to determine which protocols are defined
|
|
135 |
// and which protocol modules to load
|
|
136 |
|
|
137 |
CCommsDbTableView* table=TheDb->OpenTableLC(TPtrC(PROTOCOL_BINDINGS));
|
|
138 |
|
|
139 |
table->InsertRecord(TcpProtocolId);
|
|
140 |
table->WriteTextL(TPtrC(PROTNAME), _L("tcp"));
|
|
141 |
table->WriteUintL(TPtrC(INDEX),4);
|
|
142 |
table->WriteUintL(TPtrC(NUM_BINDS),2);
|
|
143 |
table->WriteTextL(TPtrC(BIND_1),_L("ip"));
|
|
144 |
table->WriteTextL(TPtrC(BIND_2),_L("icmp"));
|
|
145 |
table->PutRecordChanges();
|
|
146 |
|
|
147 |
table->InsertRecord(UdpProtocolId);
|
|
148 |
table->WriteTextL(TPtrC(PROTNAME), _L("udp"));
|
|
149 |
table->WriteUintL(TPtrC(INDEX),3);
|
|
150 |
table->WriteUintL(TPtrC(NUM_BINDS),2);
|
|
151 |
table->WriteTextL(TPtrC(BIND_1),_L("ip"));
|
|
152 |
table->WriteTextL(TPtrC(BIND_2),_L("icmp"));
|
|
153 |
table->PutRecordChanges();
|
|
154 |
|
|
155 |
table->InsertRecord(IcmpProtocolId);
|
|
156 |
table->WriteTextL(TPtrC(PROTNAME), _L("icmp"));
|
|
157 |
table->WriteUintL(TPtrC(INDEX),2);
|
|
158 |
table->WriteUintL(TPtrC(NUM_BINDS),1);
|
|
159 |
table->WriteTextL(TPtrC(BIND_1),_L("ip"));
|
|
160 |
table->PutRecordChanges();
|
|
161 |
|
|
162 |
table->InsertRecord(IpProtocolId);
|
|
163 |
table->WriteTextL(TPtrC(PROTNAME), _L("ip"));
|
|
164 |
table->WriteUintL(TPtrC(INDEX),1);
|
|
165 |
table->WriteUintL(TPtrC(NUM_BINDS),0);
|
|
166 |
table->PutRecordChanges();
|
|
167 |
|
|
168 |
table->InsertRecord(IrmuxProtocolId);
|
|
169 |
table->WriteTextL(TPtrC(PROTNAME), _L("irmux"));
|
|
170 |
table->WriteUintL(TPtrC(INDEX),1);
|
|
171 |
table->WriteUintL(TPtrC(NUM_BINDS),0);
|
|
172 |
table->PutRecordChanges();
|
|
173 |
|
|
174 |
table->InsertRecord(TinyTPProtocolId);
|
|
175 |
table->WriteTextL(TPtrC(PROTNAME), _L("tinytp"));
|
|
176 |
table->WriteUintL(TPtrC(INDEX),2);
|
|
177 |
table->WriteUintL(TPtrC(NUM_BINDS),0);
|
|
178 |
table->PutRecordChanges();
|
|
179 |
|
|
180 |
//
|
|
181 |
// extra records for SmsStack added by AlfredH
|
|
182 |
//
|
|
183 |
|
|
184 |
// from smswap.sms.esk
|
|
185 |
table->InsertRecord(SmsProtocolId);
|
|
186 |
table->WriteTextL(TPtrC(PROTNAME), _L("sms"));
|
|
187 |
table->WriteUintL(TPtrC(INDEX),1);
|
|
188 |
table->WriteUintL(TPtrC(NUM_BINDS),0);
|
|
189 |
table->PutRecordChanges();
|
|
190 |
|
|
191 |
// from smswap.wap.esk
|
|
192 |
table->InsertRecord(WapProtocolId);
|
|
193 |
table->WriteTextL(TPtrC(PROTNAME), _L("wap"));
|
|
194 |
table->WriteUintL(TPtrC(INDEX),1);
|
|
195 |
table->WriteUintL(TPtrC(NUM_BINDS),1);
|
|
196 |
table->WriteTextL(TPtrC(BIND_1),_L("sms"));
|
|
197 |
table->PutRecordChanges();
|
|
198 |
|
|
199 |
CleanupStack::PopAndDestroy();
|
|
200 |
}
|
|
201 |
|
|
202 |
|
|
203 |
GLDEF_C void CreateProtocolFamiliesTableL()
|
|
204 |
{
|
|
205 |
TUint32 Id;
|
|
206 |
CCommsDbTableView* table=TheDb->OpenTableLC(TPtrC(PROTOCOL_FAMILIES));
|
|
207 |
|
|
208 |
table->InsertRecord(Id);
|
|
209 |
table->WriteTextL(TPtrC(FAMILY_NAME),_L("TCPIP"));
|
|
210 |
table->WriteTextL(TPtrC(PFR_FILENAME),_L("tcpip.prt"));
|
|
211 |
table->WriteTextL(TPtrC(PROT_SETTINGS),TPtrC(GLOBAL_TCPIP_SETTINGS));
|
|
212 |
table->WriteUintL(TPtrC(PROT_SETTINGS_REFERENCE),1);
|
|
213 |
table->WriteUintL(TPtrC(P1),TcpProtocolId);
|
|
214 |
table->WriteUintL(TPtrC(P2),UdpProtocolId);
|
|
215 |
table->WriteUintL(TPtrC(P3),IcmpProtocolId);
|
|
216 |
table->WriteUintL(TPtrC(P4),IpProtocolId);
|
|
217 |
table->PutRecordChanges();
|
|
218 |
|
|
219 |
table->InsertRecord(Id);
|
|
220 |
table->WriteTextL(TPtrC(FAMILY_NAME),_L("IRDA"));
|
|
221 |
table->WriteTextL(TPtrC(PFR_FILENAME),_L("irda.prt"));
|
|
222 |
table->WriteUintL(TPtrC(PROT_SETTINGS_REFERENCE),1);
|
|
223 |
table->WriteUintL(TPtrC(P1),IrmuxProtocolId);
|
|
224 |
table->WriteUintL(TPtrC(P2),TinyTPProtocolId);
|
|
225 |
table->PutRecordChanges();
|
|
226 |
|
|
227 |
//
|
|
228 |
// extra records for SmsStack added by AlfredH
|
|
229 |
//
|
|
230 |
|
|
231 |
// from smswap.sms.esk
|
|
232 |
table->InsertRecord(Id);
|
|
233 |
table->WriteTextL(TPtrC(FAMILY_NAME),_L("SMS"));
|
|
234 |
table->WriteTextL(TPtrC(PFR_FILENAME),_L("smsprot.prt"));
|
|
235 |
table->WriteUintL(TPtrC(PROT_SETTINGS_REFERENCE),1);
|
|
236 |
table->WriteUintL(TPtrC(P1),SmsProtocolId);
|
|
237 |
table->PutRecordChanges();
|
|
238 |
|
|
239 |
// from smswap.wap.esk
|
|
240 |
table->InsertRecord(Id);
|
|
241 |
table->WriteTextL(TPtrC(FAMILY_NAME),_L("WAP"));
|
|
242 |
table->WriteTextL(TPtrC(PFR_FILENAME),_L("wapprot.prt"));
|
|
243 |
table->WriteUintL(TPtrC(PROT_SETTINGS_REFERENCE),1);
|
|
244 |
table->WriteUintL(TPtrC(P1),WapProtocolId);
|
|
245 |
table->PutRecordChanges();
|
|
246 |
|
|
247 |
CleanupStack::PopAndDestroy();
|
|
248 |
}
|
|
249 |
|
|
250 |
LOCAL_C void CreateInterfaceSettingsTableL()
|
|
251 |
{
|
|
252 |
TUint32 id;
|
|
253 |
CCommsDbTableView* table=TheDb->OpenTableLC(TPtrC(INTERFACE_SETTINGS));
|
|
254 |
|
|
255 |
table->InsertRecord(id);
|
|
256 |
table->WriteTextL(TPtrC(NIF),TPtrC(ETHINT));
|
|
257 |
table->WriteUintL(TPtrC(NIF_REFERENCE),1);
|
|
258 |
table->WriteTextL(TPtrC(PACKET_DRIVER),_L("EtherPkt"));
|
|
259 |
table->WriteUintL(TPtrC(PACKET_DRIVER_REFERENCE),1);
|
|
260 |
table->WriteTextL(TPtrC(LOGICAL_DEVICE),_L("ethercard"));
|
|
261 |
table->WriteTextL(TPtrC(LOGICAL_DEVICE_NAME),_L("EtherCard"));
|
|
262 |
table->WriteUintL(TPtrC(LOGICAL_DEVICE_REFERENCE),1);
|
|
263 |
#if !defined(__WINS__)
|
|
264 |
table->WriteTextL(TPtrC(PHYSICAL_DEVICE),_L("Ether3com"));
|
|
265 |
table->WriteTextL(TPtrC(PHYSICAL_DEVICE_NAME),_L("EtherCard.3com"));
|
|
266 |
table->WriteUintL(TPtrC(PHYSICAL_DEVICE_REFERENCE),1);
|
|
267 |
#else
|
|
268 |
table->WriteTextL(TPtrC(PHYSICAL_DEVICE),_L("EtherWins"));
|
|
269 |
table->WriteTextL(TPtrC(PHYSICAL_DEVICE_NAME),_L("EtherCard.wins"));
|
|
270 |
table->WriteUintL(TPtrC(PHYSICAL_DEVICE_REFERENCE),1);
|
|
271 |
#endif
|
|
272 |
table->PutRecordChanges();
|
|
273 |
|
|
274 |
table->InsertRecord(id);
|
|
275 |
table->WriteTextL(TPtrC(NIF),_L("ppp"));
|
|
276 |
table->WriteUintL(TPtrC(NIF_REFERENCE),1);
|
|
277 |
table->WriteTextL(TPtrC(LOGICAL_DEVICE),_L("ECOMM"));
|
|
278 |
table->WriteTextL(TPtrC(LOGICAL_DEVICE_NAME),_L("Comm"));
|
|
279 |
table->WriteUintL(TPtrC(LOGICAL_DEVICE_REFERENCE),1);
|
|
280 |
table->WriteTextL(TPtrC(PHYSICAL_DEVICE),TPtrC(_L("ECDRV")));
|
|
281 |
table->WriteTextL(TPtrC(PHYSICAL_DEVICE_NAME),_L("Comm.Wins"));
|
|
282 |
table->WriteUintL(TPtrC(PHYSICAL_DEVICE_REFERENCE),1);
|
|
283 |
table->PutRecordChanges();
|
|
284 |
|
|
285 |
table->InsertRecord(id);
|
|
286 |
table->WriteTextL(TPtrC(NIF),_L("tnif"));
|
|
287 |
table->PutRecordChanges();
|
|
288 |
|
|
289 |
CleanupStack::PopAndDestroy();
|
|
290 |
}
|
|
291 |
#endif
|
|
292 |
|
|
293 |
LOCAL_C void CreateChargecardTableL()
|
|
294 |
/**
|
|
295 |
* @test ChargeCard Database Entry
|
|
296 |
*/
|
|
297 |
{
|
|
298 |
TUint32 id;
|
|
299 |
CCommsDbTableView* table1=TheDb->OpenTableLC(TPtrC(CHARGECARD));
|
|
300 |
|
|
301 |
CHECKPOINT(table1->InsertRecord(id)==KErrNone);
|
|
302 |
table1->WriteTextL(TPtrC(COMMDB_NAME),_L("Dummy BT Chargecard"));
|
|
303 |
table1->WriteTextL(TPtrC(CHARGECARD_ACCOUNT_NUMBER),_L("144,12345678"));
|
|
304 |
table1->WriteTextL(TPtrC(CHARGECARD_PIN),_L("0000"));
|
|
305 |
table1->WriteTextL(TPtrC(CHARGECARD_LOCAL_RULE),_L("HG"));
|
|
306 |
table1->WriteTextL(TPtrC(CHARGECARD_NAT_RULE),_L("HFG"));
|
|
307 |
table1->WriteTextL(TPtrC(CHARGECARD_INTL_RULE),_L("HEFG"));
|
|
308 |
CHECKPOINT(table1->PutRecordChanges()==KErrNone);
|
|
309 |
|
|
310 |
CHECKPOINT(table1->InsertRecord(id)==KErrNone);
|
|
311 |
table1->WriteTextL(TPtrC(COMMDB_NAME),_L("Dummy Mercury Chargecard"));
|
|
312 |
table1->WriteTextL(TPtrC(CHARGECARD_ACCOUNT_NUMBER),_L("0500800800,,8944223457573566"));
|
|
313 |
table1->WriteTextL(TPtrC(CHARGECARD_PIN),_L("****"));
|
|
314 |
table1->WriteTextL(TPtrC(CHARGECARD_LOCAL_RULE),_L("HG"));
|
|
315 |
table1->WriteTextL(TPtrC(CHARGECARD_NAT_RULE),_L("J,K,0FG"));
|
|
316 |
table1->WriteTextL(TPtrC(CHARGECARD_INTL_RULE),_L("HEFG"));
|
|
317 |
CHECKPOINT(table1->PutRecordChanges()==KErrNone);
|
|
318 |
|
|
319 |
CleanupStack::PopAndDestroy();
|
|
320 |
}
|
|
321 |
|
|
322 |
LOCAL_C void CreateLocationTableL( TMyDialLocation aLocDataFax, TMyDialLocation aLocServSMS )
|
|
323 |
/**
|
|
324 |
* @test Location Database Entries
|
|
325 |
*/
|
|
326 |
{
|
|
327 |
#ifdef MODEM_PHONE_SERVICES_SMS
|
|
328 |
|
|
329 |
CCommsDbTableView* table4;
|
|
330 |
TUint32 id1, id2,id3,id4;
|
|
331 |
|
|
332 |
// Office Location
|
|
333 |
table4 = TheDb->OpenTableLC(TPtrC(LOCATION));
|
|
334 |
CHECKPOINT(table4->InsertRecord(id1)==KErrNone);
|
|
335 |
table4->WriteTextL(TPtrC(COMMDB_NAME),_L("Office"));
|
|
336 |
table4->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("00"));
|
|
337 |
table4->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
338 |
table4->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
339 |
table4->WriteTextL(TPtrC(LOCATION_AREA_CODE),_L("171"));
|
|
340 |
table4->WriteTextL(TPtrC(LOCATION_DIAL_OUT_CODE),_L("9,"));
|
|
341 |
table4->WriteTextL(TPtrC(LOCATION_DISABLE_CALL_WAITING_CODE),KNullDesC);
|
|
342 |
table4->WriteBoolL(TPtrC(LOCATION_MOBILE),EFalse);
|
|
343 |
table4->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),EFalse);
|
|
344 |
table4->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),EFalse);
|
|
345 |
table4->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
346 |
CHECKPOINT(table4->PutRecordChanges()==KErrNone);
|
|
347 |
CleanupStack::PopAndDestroy();
|
|
348 |
table4 = NULL;
|
|
349 |
// Office (without dial out code) Location
|
|
350 |
table4 = TheDb->OpenTableLC(TPtrC(LOCATION));
|
|
351 |
CHECKPOINT(table4->InsertRecord(id2)==KErrNone);
|
|
352 |
table4->WriteTextL(TPtrC(COMMDB_NAME),_L("Office Direct Dial"));
|
|
353 |
table4->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("00"));
|
|
354 |
table4->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
355 |
table4->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
356 |
table4->WriteTextL(TPtrC(LOCATION_AREA_CODE),_L("171"));
|
|
357 |
table4->WriteTextL(TPtrC(LOCATION_DIAL_OUT_CODE),KNullDesC);
|
|
358 |
table4->WriteTextL(TPtrC(LOCATION_DISABLE_CALL_WAITING_CODE),KNullDesC);
|
|
359 |
table4->WriteBoolL(TPtrC(LOCATION_MOBILE),EFalse);
|
|
360 |
table4->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),EFalse);
|
|
361 |
table4->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),EFalse);
|
|
362 |
table4->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
363 |
CHECKPOINT(table4->PutRecordChanges()==KErrNone);
|
|
364 |
CleanupStack::PopAndDestroy();
|
|
365 |
table4 = NULL;
|
|
366 |
// Mobile Network
|
|
367 |
table4 = TheDb->OpenTableLC(TPtrC(LOCATION));
|
|
368 |
CHECKPOINT(table4->InsertRecord(id3)==KErrNone);
|
|
369 |
table4->WriteTextL(TPtrC(COMMDB_NAME),_L("Mobile"));
|
|
370 |
table4->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("+"));
|
|
371 |
table4->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
372 |
table4->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
373 |
table4->WriteTextL(TPtrC(LOCATION_AREA_CODE),KNullDesC);
|
|
374 |
table4->WriteTextL(TPtrC(LOCATION_DIAL_OUT_CODE),KNullDesC);
|
|
375 |
table4->WriteTextL(TPtrC(LOCATION_DISABLE_CALL_WAITING_CODE),KNullDesC);
|
|
376 |
table4->WriteBoolL(TPtrC(LOCATION_MOBILE),ETrue);
|
|
377 |
table4->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),EFalse);
|
|
378 |
table4->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),EFalse);
|
|
379 |
table4->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
380 |
CHECKPOINT(table4->PutRecordChanges()==KErrNone);
|
|
381 |
CleanupStack::PopAndDestroy();
|
|
382 |
table4 = NULL;
|
|
383 |
// Home
|
|
384 |
table4 = TheDb->OpenTableLC(TPtrC(LOCATION));
|
|
385 |
CHECKPOINT(table4->InsertRecord(id4)==KErrNone);
|
|
386 |
table4->WriteTextL(TPtrC(COMMDB_NAME),_L("Home"));
|
|
387 |
table4->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("00"));
|
|
388 |
table4->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
389 |
table4->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
390 |
table4->WriteTextL(TPtrC(LOCATION_AREA_CODE),_L("181"));
|
|
391 |
table4->WriteTextL(TPtrC(LOCATION_DIAL_OUT_CODE),KNullDesC);
|
|
392 |
table4->WriteTextL(TPtrC(LOCATION_DISABLE_CALL_WAITING_CODE),KNullDesC);
|
|
393 |
table4->WriteBoolL(TPtrC(LOCATION_MOBILE),EFalse);
|
|
394 |
table4->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),ETrue);
|
|
395 |
table4->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),ETrue);
|
|
396 |
table4->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
397 |
CHECKPOINT(table4->PutRecordChanges()==KErrNone);
|
|
398 |
CleanupStack::PopAndDestroy();
|
|
399 |
table4 = NULL;
|
|
400 |
|
|
401 |
if ( aLocDataFax != EDialLocationChooseManual )
|
|
402 |
{
|
|
403 |
if ( aLocDataFax == EOffice )
|
|
404 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_DATA_FAX),id1);
|
|
405 |
else if ( aLocDataFax == EOfficeDirect )
|
|
406 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_DATA_FAX),id2);
|
|
407 |
else if ( aLocDataFax == EMobile )
|
|
408 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_DATA_FAX),id3);
|
|
409 |
else if ( aLocDataFax == EHome )
|
|
410 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_DATA_FAX),id4);
|
|
411 |
else
|
|
412 |
User::Invariant();
|
|
413 |
}
|
|
414 |
else
|
|
415 |
{
|
|
416 |
gTest.Printf(_L("\nPlease select the location from which you are dialling for data modem:\n"));
|
|
417 |
gTest.Printf(_L("a) Office\n"));
|
|
418 |
gTest.Printf(_L("b) Office Direct Dial\n"));
|
|
419 |
gTest.Printf(_L("c) Mobile\n"));
|
|
420 |
gTest.Printf(_L("d) Home\n"));
|
|
421 |
TUint32 ch=gTest.Getch();
|
|
422 |
|
|
423 |
if (ch=='a' || ch=='A')
|
|
424 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_DATA_FAX),id1);
|
|
425 |
else if (ch=='b' || ch=='B')
|
|
426 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_DATA_FAX),id2);
|
|
427 |
else if (ch=='c' || ch=='C')
|
|
428 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_DATA_FAX),id3);
|
|
429 |
else if (ch=='d' || ch=='D')
|
|
430 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_DATA_FAX),id4);
|
|
431 |
else
|
|
432 |
User::Invariant();
|
|
433 |
}
|
|
434 |
if ( aLocServSMS != EDialLocationChooseManual )
|
|
435 |
{
|
|
436 |
if ( aLocServSMS == EOffice )
|
|
437 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS),id1);
|
|
438 |
else if ( aLocServSMS == EOfficeDirect )
|
|
439 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS),id2);
|
|
440 |
else if ( aLocServSMS == EMobile )
|
|
441 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS),id3);
|
|
442 |
else if ( aLocServSMS == EHome )
|
|
443 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS),id4);
|
|
444 |
else
|
|
445 |
User::Invariant();
|
|
446 |
}
|
|
447 |
else
|
|
448 |
{
|
|
449 |
gTest.Printf(_L("\nPlease select the location from which you are dialling for modem for sms service:\n"));
|
|
450 |
gTest.Printf(_L("a) Office\n"));
|
|
451 |
gTest.Printf(_L("b) Office Direct Dial\n"));
|
|
452 |
gTest.Printf(_L("c) Mobile\n"));
|
|
453 |
gTest.Printf(_L("d) Home\n"));
|
|
454 |
TUint32 ch=gTest.Getch();
|
|
455 |
|
|
456 |
if (ch=='a' || ch=='A')
|
|
457 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS),id1);
|
|
458 |
else if (ch=='b' || ch=='B')
|
|
459 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS),id2);
|
|
460 |
else if (ch=='c' || ch=='C')
|
|
461 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS),id3);
|
|
462 |
else if (ch=='d' || ch=='D')
|
|
463 |
TheDb->SetGlobalSettingL(TPtrC(LOCATION_PHONE_SERVICES_SMS),id4);
|
|
464 |
else
|
|
465 |
User::Invariant();
|
|
466 |
}
|
|
467 |
#else // no MODEM_PHONE_SERVICES_SMS defined (old commdb)
|
|
468 |
aLocDataFax = aLocServSMS;
|
|
469 |
|
|
470 |
TUint32 ch = 'c';
|
|
471 |
if ( aLocServSMS != EDialLocationChooseManual )
|
|
472 |
{
|
|
473 |
if ( aLocServSMS == EOffice )
|
|
474 |
ch = 'a';
|
|
475 |
else if ( aLocServSMS == EOfficeDirect )
|
|
476 |
ch = 'b';
|
|
477 |
else if ( aLocServSMS == EMobile )
|
|
478 |
ch = 'c';
|
|
479 |
else if ( aLocServSMS == EHome )
|
|
480 |
ch = 'd';
|
|
481 |
else
|
|
482 |
User::Invariant();
|
|
483 |
}
|
|
484 |
else
|
|
485 |
{
|
|
486 |
gTest.Printf(_L("\nPlease select the location from which you are dialling:\n"));
|
|
487 |
gTest.Printf(_L("a) Office\n"));
|
|
488 |
gTest.Printf(_L("b) Office Direct Dial\n"));
|
|
489 |
gTest.Printf(_L("c) Mobile\n"));
|
|
490 |
gTest.Printf(_L("d) Home\n"));
|
|
491 |
ch=gTest.Getch();
|
|
492 |
}
|
|
493 |
|
|
494 |
CCommsDbTableView* table4=TheDb->OpenTableLC(TPtrC(LOCATION));
|
|
495 |
TUint32 id;
|
|
496 |
CHECKPOINT(table4->InsertRecord(id)==KErrNone);
|
|
497 |
|
|
498 |
if (ch=='a' || ch=='A')
|
|
499 |
{
|
|
500 |
// Office Location
|
|
501 |
table4->WriteTextL(TPtrC(COMMDB_NAME),_L("Office"));
|
|
502 |
table4->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("00"));
|
|
503 |
table4->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
504 |
table4->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
505 |
table4->WriteTextL(TPtrC(LOCATION_AREA_CODE),_L("171"));
|
|
506 |
table4->WriteTextL(TPtrC(LOCATION_DIAL_OUT_CODE),_L("9,"));
|
|
507 |
table4->WriteTextL(TPtrC(LOCATION_DISABLE_CALL_WAITING_CODE),KNullDesC);
|
|
508 |
table4->WriteBoolL(TPtrC(LOCATION_MOBILE),EFalse);
|
|
509 |
table4->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),EFalse);
|
|
510 |
table4->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),EFalse);
|
|
511 |
table4->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
512 |
}
|
|
513 |
else if (ch=='b' || ch=='B')
|
|
514 |
{
|
|
515 |
// Office (without dial out code) Location
|
|
516 |
table4->WriteTextL(TPtrC(COMMDB_NAME),_L("Office Direct Dial"));
|
|
517 |
table4->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("00"));
|
|
518 |
table4->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
519 |
table4->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
520 |
table4->WriteTextL(TPtrC(LOCATION_AREA_CODE),_L("171"));
|
|
521 |
table4->WriteTextL(TPtrC(LOCATION_DIAL_OUT_CODE),KNullDesC);
|
|
522 |
table4->WriteTextL(TPtrC(LOCATION_DISABLE_CALL_WAITING_CODE),KNullDesC);
|
|
523 |
table4->WriteBoolL(TPtrC(LOCATION_MOBILE),EFalse);
|
|
524 |
table4->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),EFalse);
|
|
525 |
table4->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),EFalse);
|
|
526 |
table4->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
527 |
}
|
|
528 |
else if (ch=='c' || ch=='C')
|
|
529 |
{
|
|
530 |
// Mobile Network
|
|
531 |
table4->WriteTextL(TPtrC(COMMDB_NAME),_L("Mobile"));
|
|
532 |
table4->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("+"));
|
|
533 |
table4->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
534 |
table4->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
535 |
table4->WriteTextL(TPtrC(LOCATION_AREA_CODE),KNullDesC);
|
|
536 |
table4->WriteTextL(TPtrC(LOCATION_DIAL_OUT_CODE),KNullDesC);
|
|
537 |
table4->WriteTextL(TPtrC(LOCATION_DISABLE_CALL_WAITING_CODE),KNullDesC);
|
|
538 |
table4->WriteBoolL(TPtrC(LOCATION_MOBILE),ETrue);
|
|
539 |
table4->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),EFalse);
|
|
540 |
table4->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),EFalse);
|
|
541 |
table4->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
542 |
}
|
|
543 |
else if (ch=='d' || ch=='D')
|
|
544 |
{
|
|
545 |
// Home
|
|
546 |
table4->WriteTextL(TPtrC(COMMDB_NAME),_L("Home"));
|
|
547 |
table4->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("00"));
|
|
548 |
table4->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
549 |
table4->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
550 |
table4->WriteTextL(TPtrC(LOCATION_AREA_CODE),_L("181"));
|
|
551 |
table4->WriteTextL(TPtrC(LOCATION_DIAL_OUT_CODE),KNullDesC);
|
|
552 |
table4->WriteTextL(TPtrC(LOCATION_DISABLE_CALL_WAITING_CODE),KNullDesC);
|
|
553 |
table4->WriteBoolL(TPtrC(LOCATION_MOBILE),EFalse);
|
|
554 |
table4->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),ETrue);
|
|
555 |
table4->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),ETrue);
|
|
556 |
table4->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
557 |
}
|
|
558 |
else
|
|
559 |
User::Invariant();
|
|
560 |
|
|
561 |
CHECKPOINT(table4->PutRecordChanges()==KErrNone);
|
|
562 |
CleanupStack::PopAndDestroy();
|
|
563 |
#endif
|
|
564 |
|
|
565 |
}
|
|
566 |
|
|
567 |
|
|
568 |
LOCAL_C void CreateModemTablesL( TMyModemType aModemDataFax, TMyModemType aModemServSMS,
|
|
569 |
TUint aCommPortDataFax, TUint aCommPortServSMS )
|
|
570 |
/**
|
|
571 |
* @test Modem Database Entries
|
|
572 |
*/
|
|
573 |
{
|
|
574 |
#ifdef MODEM_PHONE_SERVICES_SMS
|
|
575 |
|
|
576 |
CCommsDbTableView* table2;
|
|
577 |
TUint32 id1, id2,id3,id4,id5,id6,id7,id8,id9;
|
|
578 |
TBuf<9> commPort;
|
|
579 |
TBuf<11> ircommPort;
|
|
580 |
|
|
581 |
commPort.Format(_L("COMM::%c"),'0');
|
|
582 |
ircommPort.Format(_L("IRCOMM::%c"),'0');
|
|
583 |
|
|
584 |
// NULL Modem with 115200 bps
|
|
585 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
586 |
CHECKPOINT(table2->InsertRecord(id1)==KErrNone);
|
|
587 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("Null Modem 115200bps"));
|
|
588 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
589 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME), _L("NTRASTSY"));
|
|
590 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("ECUART"));
|
|
591 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
592 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
593 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
594 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps115200);
|
|
595 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)(KConfigObeyCTS|KConfigObeyDSR|KConfigFailDSR));
|
|
596 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
597 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)0);
|
|
598 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)0);
|
|
599 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
600 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
601 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
602 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),KNullDesC8);
|
|
603 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
604 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
605 |
table2->WriteTextL(TPtrC(MODEM_ISP_INIT_STRING),KNullDesC8);
|
|
606 |
table2->WriteTextL(TPtrC(MODEM_DIAL_PAUSE_LENGTH),KNullDesC8);
|
|
607 |
table2->WriteTextL(TPtrC(MODEM_CARRIER_TIMEOUT),KNullDesC8);
|
|
608 |
table2->WriteTextL(TPtrC(MODEM_AUTO_ANSWER_RING_COUNT),KNullDesC8);
|
|
609 |
table2->WriteTextL(TPtrC(MODEM_SPEAKER_VOL_CONTROL_LOW),KNullDesC8);
|
|
610 |
table2->WriteTextL(TPtrC(MODEM_SPEAKER_VOL_CONTROL_MEDIUM),KNullDesC8);
|
|
611 |
table2->WriteTextL(TPtrC(MODEM_SPEAKER_VOL_CONTROL_HIGH),KNullDesC8);
|
|
612 |
table2->WriteTextL(TPtrC(MODEM_SPEAKER_ALWAYS_OFF),KNullDesC8);
|
|
613 |
table2->WriteTextL(TPtrC(MODEM_SPEAKER_ON_UNTIL_CARRIER),KNullDesC8);
|
|
614 |
table2->WriteTextL(TPtrC(MODEM_SPEAKER_ALWAYS_ON),KNullDesC8);
|
|
615 |
table2->WriteTextL(TPtrC(MODEM_SPEAKER_ON_AFTER_DIAL_UNTIL_CARRIER),KNullDesC8);
|
|
616 |
table2->WriteTextL(TPtrC(MODEM_DIAL_TONE_WAIT_MODIFIER),KNullDesC8);
|
|
617 |
table2->WriteTextL(TPtrC(MODEM_CALL_PROGRESS_1),KNullDesC8);
|
|
618 |
table2->WriteTextL(TPtrC(MODEM_CALL_PROGRESS_2),KNullDesC8);
|
|
619 |
table2->WriteTextL(TPtrC(MODEM_CALL_PROGRESS_3),KNullDesC8);
|
|
620 |
table2->WriteTextL(TPtrC(MODEM_CALL_PROGRESS_4),KNullDesC8);
|
|
621 |
table2->WriteTextL(TPtrC(MODEM_ECHO_OFF),KNullDesC8);
|
|
622 |
table2->WriteTextL(TPtrC(MODEM_VERBOSE_TEXT),KNullDesC8);
|
|
623 |
table2->WriteTextL(TPtrC(MODEM_QUIET_OFF),KNullDesC8);
|
|
624 |
table2->WriteTextL(TPtrC(MODEM_QUIET_ON),KNullDesC8);
|
|
625 |
table2->WriteTextL(TPtrC(MODEM_DIAL_COMMAND_STATE_MODIFIER),KNullDesC8);
|
|
626 |
table2->WriteTextL(TPtrC(MODEM_ON_LINE),KNullDesC8);
|
|
627 |
table2->WriteTextL(TPtrC(MODEM_RESET_CONFIGURATION),KNullDesC8);
|
|
628 |
table2->WriteTextL(TPtrC(MODEM_RETURN_TO_FACTORY_DEFS),KNullDesC8);
|
|
629 |
table2->WriteTextL(TPtrC(MODEM_DCD_ON_DURING_LINK),KNullDesC8);
|
|
630 |
table2->WriteTextL(TPtrC(MODEM_DTR_HANG_UP),KNullDesC8);
|
|
631 |
table2->WriteTextL(TPtrC(MODEM_DSR_ALWAYS_ON),KNullDesC8);
|
|
632 |
table2->WriteTextL(TPtrC(MODEM_RTS_CTS_HANDSHAKE),KNullDesC8);
|
|
633 |
table2->WriteTextL(TPtrC(MODEM_XON_XOFF_HANDSHAKE),KNullDesC8);
|
|
634 |
table2->WriteTextL(TPtrC(MODEM_ESCAPE_CHARACTER),KNullDesC8);
|
|
635 |
table2->WriteTextL(TPtrC(MODEM_ESCAPE_GUARD_PERIOD),KNullDesC8);
|
|
636 |
table2->WriteTextL(TPtrC(MODEM_FAX_CLASS_INTERROGATE),KNullDesC8);
|
|
637 |
table2->WriteTextL(TPtrC(MODEM_FAX_CLASS),KNullDesC8);
|
|
638 |
table2->WriteTextL(TPtrC(MODEM_NO_DIAL_TONE),KNullDesC8);
|
|
639 |
table2->WriteTextL(TPtrC(MODEM_BUSY),KNullDesC8);
|
|
640 |
table2->WriteTextL(TPtrC(MODEM_NO_ANSWER),KNullDesC8);
|
|
641 |
table2->WriteTextL(TPtrC(MODEM_CARRIER),KNullDesC8);
|
|
642 |
table2->WriteTextL(TPtrC(MODEM_CONNECT),KNullDesC8);
|
|
643 |
table2->WriteTextL(TPtrC(MODEM_COMPRESSION_CLASS_5),KNullDesC8);
|
|
644 |
table2->WriteTextL(TPtrC(MODEM_COMPRESSION_V42BIS),KNullDesC8);
|
|
645 |
table2->WriteTextL(TPtrC(MODEM_COMPRESSION_NONE),KNullDesC8);
|
|
646 |
table2->WriteTextL(TPtrC(MODEM_PROTOCOL_LAPD),KNullDesC8);
|
|
647 |
table2->WriteTextL(TPtrC(MODEM_PROTOCOL_ALT),KNullDesC8);
|
|
648 |
table2->WriteTextL(TPtrC(MODEM_PROTOCOL_ALTCELLULAR),KNullDesC8);
|
|
649 |
table2->WriteTextL(TPtrC(MODEM_PROTOCOL_NONE),KNullDesC8);
|
|
650 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
651 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),0);
|
|
652 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),0);
|
|
653 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
654 |
CleanupStack::PopAndDestroy();
|
|
655 |
table2 = NULL;
|
|
656 |
// USR Sportster Modem
|
|
657 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
658 |
CHECKPOINT(table2->InsertRecord(id2)==KErrNone);
|
|
659 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("US Robotics Sportster"));
|
|
660 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
661 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("ECUART"));
|
|
662 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("HAYES"));
|
|
663 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps57600);
|
|
664 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
665 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
666 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
667 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)(KConfigObeyCTS|KConfigObeyDSR|KConfigFailDSR|KConfigObeyDCD|KConfigFailDCD)); //KConfigObeyCTS;
|
|
668 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
669 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)0);
|
|
670 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)0);
|
|
671 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("AT&F1"));
|
|
672 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
673 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),_L8("AT&d2"));
|
|
674 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
675 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingAfterDialUntilAnswer);
|
|
676 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
677 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
678 |
CleanupStack::PopAndDestroy();
|
|
679 |
table2 = NULL;
|
|
680 |
// Dacom Surfer
|
|
681 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
682 |
CHECKPOINT(table2->InsertRecord(id3)==KErrNone);
|
|
683 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("Dacom Surfer"));
|
|
684 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
685 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("ECUART"));
|
|
686 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("HAYES"));
|
|
687 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps57600);
|
|
688 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
689 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
690 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
691 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)(KConfigObeyCTS|KConfigObeyDSR|KConfigFailDSR|KConfigObeyDCD|KConfigFailDCD)); //KConfigObeyCTS;
|
|
692 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
693 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)0);
|
|
694 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)0);
|
|
695 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("AT&F"));
|
|
696 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
697 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),_L8("AT&d2"));
|
|
698 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
699 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingAfterDialUntilAnswer);
|
|
700 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
701 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
702 |
CleanupStack::PopAndDestroy();
|
|
703 |
table2 = NULL;
|
|
704 |
// IR Mobile Phone
|
|
705 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
706 |
CHECKPOINT(table2->InsertRecord(id4)==KErrNone);
|
|
707 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("GSM Mobile Phone via Infrared"));
|
|
708 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),ircommPort);
|
|
709 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("IRCOMM"));
|
|
710 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("GSMBSC"));
|
|
711 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps115200);
|
|
712 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
713 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
714 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
715 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)KConfigObeyCTS|KConfigObeyDCD|KConfigFailDCD);
|
|
716 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
717 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
718 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
719 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
720 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
721 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
722 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
723 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
724 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
725 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
726 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
727 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
728 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
729 |
CleanupStack::PopAndDestroy();
|
|
730 |
table2 = NULL;
|
|
731 |
// Cabled 9110, etc
|
|
732 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
733 |
CHECKPOINT(table2->InsertRecord(id5)==KErrNone);
|
|
734 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("GSM Mobile Phone via Serial"));
|
|
735 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
736 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("ECUART"));
|
|
737 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("GSMBSC"));
|
|
738 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps19200);
|
|
739 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
740 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
741 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
742 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)KConfigObeyCTS|KConfigObeyDCD|KConfigFailDCD);
|
|
743 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
744 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
745 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
746 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
747 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
748 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
749 |
table2->WriteTextL(TPtrC(MODEM_ISP_INIT_STRING),KNullDesC8);
|
|
750 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
751 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
752 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
753 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
754 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
755 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
756 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
757 |
CleanupStack::PopAndDestroy();
|
|
758 |
table2 = NULL;
|
|
759 |
// R520m via IR
|
|
760 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
761 |
CHECKPOINT(table2->InsertRecord(id6)==KErrNone);
|
|
762 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("GPRS Ericsson R520m via IR"));
|
|
763 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
764 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("IRCOMM"));
|
|
765 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("ATGPRS"));
|
|
766 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps115200);
|
|
767 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
768 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
769 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
770 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)KConfigObeyCTS);
|
|
771 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
772 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
773 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
774 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
775 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
776 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
777 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
778 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
779 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
780 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
781 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
782 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
783 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
784 |
CleanupStack::PopAndDestroy();
|
|
785 |
table2 = NULL;
|
|
786 |
// R520m via serial
|
|
787 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
788 |
CHECKPOINT(table2->InsertRecord(id7)==KErrNone);
|
|
789 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("GPRS Ericsson R520m via Serial"));
|
|
790 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
791 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("ECUART"));
|
|
792 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("ATGPRS"));
|
|
793 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps115200);
|
|
794 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
795 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
796 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
797 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)KConfigObeyCTS);
|
|
798 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
799 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
800 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
801 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
802 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
803 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
804 |
table2->WriteTextL(TPtrC(MODEM_ISP_INIT_STRING),KNullDesC8);
|
|
805 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
806 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
807 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
808 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
809 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
810 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
811 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
812 |
CleanupStack::PopAndDestroy();
|
|
813 |
table2 = NULL;
|
|
814 |
// GPRS Timeport
|
|
815 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
816 |
CHECKPOINT(table2->InsertRecord(id8)==KErrNone);
|
|
817 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("GPRS Motorola Mobile Phone via Serial"));
|
|
818 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
819 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("ECUART"));
|
|
820 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("ATGPRS"));
|
|
821 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps57600); // Old one is 38400
|
|
822 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
823 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1); // Old one is 2
|
|
824 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
825 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)KConfigObeyCTS);
|
|
826 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
827 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
828 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
829 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
830 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
831 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
832 |
table2->WriteTextL(TPtrC(MODEM_ISP_INIT_STRING),KNullDesC8);
|
|
833 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
834 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
835 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
836 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
837 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
838 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
839 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
840 |
CleanupStack::PopAndDestroy();
|
|
841 |
table2 = NULL;
|
|
842 |
|
|
843 |
//Loads the T_REG.TSY and uses the DUMMY csy
|
|
844 |
table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
845 |
CHECKPOINT(table2->InsertRecord(id9)==KErrNone);
|
|
846 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("Test Mobile Phone"));
|
|
847 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),_L("DUMMY::0"));
|
|
848 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("DUMMY"));
|
|
849 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("T_REG"));
|
|
850 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps115200);
|
|
851 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
852 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
853 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
854 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)0);
|
|
855 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
856 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
857 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
858 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
859 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),_L8("AT345678901234567890123456789012345678901234567890"));
|
|
860 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
861 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
862 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
863 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
864 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
865 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
866 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
867 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
868 |
CleanupStack::PopAndDestroy();
|
|
869 |
table2 = NULL;
|
|
870 |
|
|
871 |
|
|
872 |
TUint32 defaultModemDataId = 0ul;
|
|
873 |
TUint32 defaultModemSMSId = 0ul;
|
|
874 |
TUint acommPort;
|
|
875 |
|
|
876 |
if( aModemDataFax != EModemTypeChooseMamual )
|
|
877 |
{
|
|
878 |
|
|
879 |
// Choose the Data Fax modem
|
|
880 |
if( aModemDataFax == ENullModem)
|
|
881 |
defaultModemDataId = id1;
|
|
882 |
else if( aModemDataFax == EUSRSportster)
|
|
883 |
defaultModemDataId = id2;
|
|
884 |
else if( aModemDataFax == EDacomSurfer)
|
|
885 |
defaultModemDataId = id3;
|
|
886 |
else if( aModemDataFax == EGSMviaIR)
|
|
887 |
defaultModemDataId = id4;
|
|
888 |
else if( aModemDataFax == EGSMviaCOM)
|
|
889 |
defaultModemDataId = id5;
|
|
890 |
else if( aModemDataFax == EEricssonGPRSMobilePhoneviaIR)
|
|
891 |
defaultModemDataId = id6;
|
|
892 |
else if( aModemDataFax == EricssonGPRSMobilePhoneviaSerialcable)
|
|
893 |
defaultModemDataId = id7;
|
|
894 |
else if( aModemDataFax == EMotorolaGPRSMobilePhoneviaSerialcable)
|
|
895 |
defaultModemDataId = id8;
|
|
896 |
else if( aModemDataFax == EDummy)
|
|
897 |
defaultModemDataId = id9;
|
|
898 |
else
|
|
899 |
User::Invariant();
|
|
900 |
TheDb->SetGlobalSettingL(TPtrC(MODEM_DATA_FAX),defaultModemDataId);
|
|
901 |
|
|
902 |
if( aModemDataFax != EGSMviaIR)
|
|
903 |
commPort.Format(_L("COMM::%c"),aCommPortDataFax);
|
|
904 |
else
|
|
905 |
commPort.Format(_L("IRCOMM::%c"),aCommPortDataFax);
|
|
906 |
table2 = TheDb->OpenViewMatchingUintLC(TPtrC(MODEM),TPtrC(COMMDB_ID),defaultModemDataId);
|
|
907 |
CHECKPOINT(table2->GotoFirstRecord()==KErrNone);
|
|
908 |
CHECKPOINT(table2->UpdateRecord()==KErrNone);
|
|
909 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
910 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
911 |
CleanupStack::PopAndDestroy();
|
|
912 |
table2 = NULL;
|
|
913 |
}
|
|
914 |
else
|
|
915 |
{
|
|
916 |
gTest.Printf(_L("\nPlease select the modem to be used for data:\n"));
|
|
917 |
gTest.Printf(_L("a) Null Modem\n"));
|
|
918 |
gTest.Printf(_L("b) USR Sportster\n"));
|
|
919 |
gTest.Printf(_L("c) Dacom Surfer\n"));
|
|
920 |
gTest.Printf(_L("d) GSM Mobile Phone via IR\n"));
|
|
921 |
gTest.Printf(_L("e) GSM Mobile Phone via Serial cable\n"));
|
|
922 |
gTest.Printf(_L("f) Ericsson GPRS Mobile Phone via IR\n"));
|
|
923 |
gTest.Printf(_L("g) Ericsson GPRS Mobile Phone via Serial cable\n"));
|
|
924 |
gTest.Printf(_L("h) Motorola GPRS Mobile Phone via Serial cable\n"));
|
|
925 |
gTest.Printf(_L("i) Dummy Tsy and Modem\n"));
|
|
926 |
|
|
927 |
TUint32 ch=gTest.Getch();
|
|
928 |
|
|
929 |
if(ch == 'a' || ch == 'A')
|
|
930 |
defaultModemDataId = id1;
|
|
931 |
else if(ch == 'b' || ch == 'B')
|
|
932 |
defaultModemDataId = id2;
|
|
933 |
else if(ch == 'c' || ch == 'C')
|
|
934 |
defaultModemDataId = id3;
|
|
935 |
else if(ch == 'd' || ch == 'D')
|
|
936 |
defaultModemDataId = id4; //EGSMviaIR
|
|
937 |
else if(ch == 'e' || ch == 'E')
|
|
938 |
defaultModemDataId = id5;
|
|
939 |
else if(ch == 'f' || ch == 'F')
|
|
940 |
defaultModemDataId = id6;
|
|
941 |
else if(ch == 'g' || ch == 'G')
|
|
942 |
defaultModemDataId = id7;
|
|
943 |
else if(ch == 'h' || ch == 'H')
|
|
944 |
defaultModemDataId = id8;
|
|
945 |
else if(ch == 'i' || ch == 'I')
|
|
946 |
defaultModemDataId = id9;
|
|
947 |
else
|
|
948 |
User::Invariant();
|
|
949 |
|
|
950 |
TheDb->SetGlobalSettingL(TPtrC(MODEM_DATA_FAX),defaultModemDataId);
|
|
951 |
gTest.Printf(_L("\nPlease Choose Test Board Comm Port for data modem: "));
|
|
952 |
acommPort = gTest.Getch();
|
|
953 |
if( defaultModemDataId != id4 ) //EGSMviaIR
|
|
954 |
commPort.Format(_L("COMM::%c"),acommPort);
|
|
955 |
else
|
|
956 |
commPort.Format(_L("IRCOMM::%c"),acommPort);
|
|
957 |
table2 = TheDb->OpenViewMatchingUintLC(TPtrC(MODEM),TPtrC(COMMDB_ID),defaultModemDataId);
|
|
958 |
CHECKPOINT(table2->GotoFirstRecord()==KErrNone);
|
|
959 |
CHECKPOINT(table2->UpdateRecord()==KErrNone);
|
|
960 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
961 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
962 |
CleanupStack::PopAndDestroy();
|
|
963 |
table2 = NULL;
|
|
964 |
}
|
|
965 |
|
|
966 |
if( aModemServSMS != EModemTypeChooseMamual )
|
|
967 |
{
|
|
968 |
|
|
969 |
// Choose the ServiceSMS modem
|
|
970 |
if( aModemServSMS == ENullModem)
|
|
971 |
defaultModemSMSId = id1;
|
|
972 |
else if( aModemServSMS == EUSRSportster)
|
|
973 |
defaultModemSMSId = id2;
|
|
974 |
else if( aModemServSMS == EDacomSurfer)
|
|
975 |
defaultModemSMSId = id3;
|
|
976 |
else if( aModemServSMS == EGSMviaIR)
|
|
977 |
defaultModemSMSId = id4;
|
|
978 |
else if( aModemServSMS == EGSMviaCOM)
|
|
979 |
defaultModemSMSId = id5;
|
|
980 |
else if( aModemServSMS == EEricssonGPRSMobilePhoneviaIR)
|
|
981 |
defaultModemSMSId = id6;
|
|
982 |
else if( aModemServSMS == EricssonGPRSMobilePhoneviaSerialcable)
|
|
983 |
defaultModemSMSId = id7;
|
|
984 |
else if( aModemServSMS == EMotorolaGPRSMobilePhoneviaSerialcable)
|
|
985 |
defaultModemSMSId = id8;
|
|
986 |
else if( aModemServSMS == EDummy)
|
|
987 |
defaultModemSMSId = id9;
|
|
988 |
else
|
|
989 |
User::Invariant();
|
|
990 |
|
|
991 |
TheDb->SetGlobalSettingL(TPtrC(MODEM_PHONE_SERVICES_SMS),defaultModemSMSId);
|
|
992 |
if( aModemServSMS != EGSMviaIR)
|
|
993 |
commPort.Format(_L("COMM::%c"),aCommPortServSMS);
|
|
994 |
else
|
|
995 |
commPort.Format(_L("IRCOMM::%c"),aCommPortServSMS);
|
|
996 |
table2 = TheDb->OpenViewMatchingUintLC(TPtrC(MODEM),TPtrC(COMMDB_ID),defaultModemSMSId);
|
|
997 |
CHECKPOINT(table2->GotoFirstRecord()==KErrNone);
|
|
998 |
CHECKPOINT(table2->UpdateRecord()==KErrNone);
|
|
999 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
1000 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
1001 |
CleanupStack::PopAndDestroy();
|
|
1002 |
table2 = NULL;
|
|
1003 |
gTest.Printf(_L("\n"));
|
|
1004 |
}
|
|
1005 |
else
|
|
1006 |
{
|
|
1007 |
gTest.Printf(_L("\n\n"));
|
|
1008 |
gTest.Printf(_L("\nPlease select the modem you will be using for sms service:\n"));
|
|
1009 |
gTest.Printf(_L("a) Null Modem\n"));
|
|
1010 |
gTest.Printf(_L("b) USR Sportster\n"));
|
|
1011 |
gTest.Printf(_L("c) Dacom Surfer\n"));
|
|
1012 |
gTest.Printf(_L("d) GSM Mobile Phone via IR\n"));
|
|
1013 |
gTest.Printf(_L("e) GSM Mobile Phone via Serial cable\n"));
|
|
1014 |
gTest.Printf(_L("f) Ericsson GPRS Mobile Phone via IR\n"));
|
|
1015 |
gTest.Printf(_L("g) Ericsson GPRS Mobile Phone via Serial cable\n"));
|
|
1016 |
gTest.Printf(_L("h) Motorola GPRS Mobile Phone via Serial cable\n"));
|
|
1017 |
gTest.Printf(_L("i) Dummy Tsy and Modem\n"));
|
|
1018 |
|
|
1019 |
TUint32 ch=gTest.Getch();
|
|
1020 |
|
|
1021 |
if(ch == 'a' || ch == 'A')
|
|
1022 |
defaultModemSMSId = id1;
|
|
1023 |
else if(ch == 'b' || ch == 'B')
|
|
1024 |
defaultModemSMSId = id2;
|
|
1025 |
else if(ch == 'c' || ch == 'C')
|
|
1026 |
defaultModemSMSId = id3;
|
|
1027 |
else if(ch == 'd' || ch == 'D')
|
|
1028 |
defaultModemSMSId = id4; //EGSMviaIR
|
|
1029 |
else if(ch == 'e' || ch == 'E')
|
|
1030 |
defaultModemSMSId = id5;
|
|
1031 |
else if(ch == 'f' || ch == 'F')
|
|
1032 |
defaultModemSMSId = id6;
|
|
1033 |
else if(ch == 'g' || ch == 'G')
|
|
1034 |
defaultModemSMSId = id7;
|
|
1035 |
else if(ch == 'h' || ch == 'H')
|
|
1036 |
defaultModemSMSId = id8;
|
|
1037 |
else if(ch == 'i' || ch == 'I')
|
|
1038 |
defaultModemSMSId = id9;
|
|
1039 |
else
|
|
1040 |
User::Invariant();
|
|
1041 |
|
|
1042 |
TheDb->SetGlobalSettingL(TPtrC(MODEM_PHONE_SERVICES_SMS),defaultModemSMSId);
|
|
1043 |
gTest.Printf(_L("\nPlease Choose your Test Board Comm Port for modem for sms services : "));
|
|
1044 |
acommPort = gTest.Getch();
|
|
1045 |
if(defaultModemSMSId != id4) //EGSMviaIR
|
|
1046 |
commPort.Format(_L("COMM::%c"),acommPort);
|
|
1047 |
else
|
|
1048 |
commPort.Format(_L("IRCOMM::%c"),acommPort);
|
|
1049 |
table2 = TheDb->OpenViewMatchingUintLC(TPtrC(MODEM),TPtrC(COMMDB_ID),defaultModemSMSId);
|
|
1050 |
CHECKPOINT(table2->GotoFirstRecord()==KErrNone);
|
|
1051 |
CHECKPOINT(table2->UpdateRecord()==KErrNone);
|
|
1052 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
1053 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
1054 |
CleanupStack::PopAndDestroy();
|
|
1055 |
table2 = NULL;
|
|
1056 |
|
|
1057 |
gTest.Printf(_L("\n"));
|
|
1058 |
}
|
|
1059 |
#else //MODEM_PHONE_SERVICES_SMS not defined (uses old commdb)
|
|
1060 |
aModemDataFax = aModemServSMS;
|
|
1061 |
aCommPortDataFax = aCommPortServSMS;
|
|
1062 |
|
|
1063 |
TUint32 ch = 'c';
|
|
1064 |
TUint acommPort = '0';
|
|
1065 |
if ( aModemServSMS != EModemTypeChooseMamual )
|
|
1066 |
{
|
|
1067 |
if ( aModemServSMS == EGSMviaIR )
|
|
1068 |
ch = 'a';
|
|
1069 |
else if ( aModemServSMS == EGSMviaCOM )
|
|
1070 |
ch = 'b';
|
|
1071 |
else if ( aModemServSMS == EDummy )
|
|
1072 |
ch = 'c';
|
|
1073 |
else
|
|
1074 |
User::Invariant();
|
|
1075 |
acommPort = aCommPortServSMS;
|
|
1076 |
}
|
|
1077 |
else
|
|
1078 |
{
|
|
1079 |
gTest.Printf(_L("\nPlease select the modem you are using:\n"));
|
|
1080 |
gTest.Printf(_L("a) GSM Mobile Phone via IR\n"));
|
|
1081 |
gTest.Printf(_L("b) GSM Mobile Phone via Serial cable\n"));
|
|
1082 |
gTest.Printf(_L("c) Test Mobile Phone - Dummy TSY\n"));
|
|
1083 |
ch=gTest.Getch();
|
|
1084 |
gTest.Printf(_L("\nPlease Choose your Test Board Comm Port : "));
|
|
1085 |
acommPort = gTest.Getch();
|
|
1086 |
}
|
|
1087 |
|
|
1088 |
CCommsDbTableView* table2=TheDb->OpenTableLC(TPtrC(MODEM));
|
|
1089 |
TUint32 id;
|
|
1090 |
CHECKPOINT(table2->InsertRecord(id)==KErrNone);
|
|
1091 |
|
|
1092 |
if (ch=='a' || ch=='A')
|
|
1093 |
{
|
|
1094 |
// IR Mobile Phone
|
|
1095 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("GSM Mobile Phone via Infrared"));
|
|
1096 |
TBuf<9> commPort;
|
|
1097 |
commPort.Format(_L("IRCOMM::%c"),acommPort);
|
|
1098 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
1099 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("IRCOMM"));
|
|
1100 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("GSMBSC"));
|
|
1101 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps115200);
|
|
1102 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
1103 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
1104 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
1105 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)KConfigObeyCTS|KConfigObeyDCD|KConfigFailDCD);
|
|
1106 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
1107 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
1108 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
1109 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
1110 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
1111 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
1112 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
1113 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
1114 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
1115 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
1116 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
1117 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
1118 |
}
|
|
1119 |
else if (ch=='b' || ch=='B')
|
|
1120 |
{
|
|
1121 |
// Cabled 9110, etc
|
|
1122 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("GSM Mobile Phone via Serial"));
|
|
1123 |
TBuf<9> commPort;
|
|
1124 |
commPort.Format(_L("COMM::%c"),acommPort);
|
|
1125 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),commPort);
|
|
1126 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("ECUART"));
|
|
1127 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("GSMBSC"));
|
|
1128 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps19200);
|
|
1129 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
1130 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
1131 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
1132 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)KConfigObeyCTS|KConfigObeyDCD|KConfigFailDCD);
|
|
1133 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
1134 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
1135 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
1136 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
1137 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),KNullDesC8);
|
|
1138 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
1139 |
table2->WriteTextL(TPtrC(MODEM_ISP_INIT_STRING),KNullDesC8);
|
|
1140 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
1141 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
1142 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
1143 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
1144 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
1145 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
1146 |
}
|
|
1147 |
else if (ch=='c' || ch=='C')
|
|
1148 |
{
|
|
1149 |
// Cabled 9110, etc
|
|
1150 |
table2->WriteTextL(TPtrC(COMMDB_NAME),_L("Test Mobile Phone"));
|
|
1151 |
TBuf<9> commPort;
|
|
1152 |
commPort.Format(_L("COMM::%c"),acommPort);
|
|
1153 |
table2->WriteTextL(TPtrC(MODEM_PORT_NAME),_L("DUMMY::0"));
|
|
1154 |
table2->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("DUMMY"));
|
|
1155 |
table2->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("T_REG"));
|
|
1156 |
table2->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps115200);
|
|
1157 |
table2->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
1158 |
table2->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
1159 |
table2->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
1160 |
table2->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)0);
|
|
1161 |
table2->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
1162 |
table2->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)17);
|
|
1163 |
table2->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)19);
|
|
1164 |
table2->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("ATZ"));
|
|
1165 |
table2->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),_L8("AT345678901234567890123456789012345678901234567890"));
|
|
1166 |
table2->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),KNullDesC8);
|
|
1167 |
table2->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
1168 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingNever);
|
|
1169 |
table2->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
1170 |
table2->WriteTextL(TPtrC(MODEM_MESSAGE_CENTRE_NUMBER),KVodafoneSC);
|
|
1171 |
table2->WriteUintL(TPtrC(MODEM_MESSAGE_VALIDITY_PERIOD),1440ul);
|
|
1172 |
table2->WriteBoolL(TPtrC(MODEM_MESSAGE_DELIVERY_REPORT),EFalse);
|
|
1173 |
}
|
|
1174 |
else
|
|
1175 |
User::Invariant();
|
|
1176 |
CHECKPOINT(table2->PutRecordChanges()==KErrNone);
|
|
1177 |
CleanupStack::PopAndDestroy();
|
|
1178 |
#endif
|
|
1179 |
|
|
1180 |
}
|
|
1181 |
|
|
1182 |
|
|
1183 |
LOCAL_C void PopulateTemplatesL()
|
|
1184 |
{
|
|
1185 |
CCommsDbTemplateRecord* temp1=CCommsDbTemplateRecord::NewL(TheDb,TPtrC(MODEM));
|
|
1186 |
CleanupStack::PushL(temp1);
|
|
1187 |
temp1->Modify();
|
|
1188 |
|
|
1189 |
temp1->WriteTextL(TPtrC(COMMDB_NAME),_L("Default Modem"));
|
|
1190 |
temp1->WriteTextL(TPtrC(MODEM_PORT_NAME),_L("COMM::0"));
|
|
1191 |
temp1->WriteTextL(TPtrC(MODEM_CSY_NAME),_L("ECUART"));
|
|
1192 |
temp1->WriteTextL(TPtrC(MODEM_TSY_NAME),_L("GSMBSC"));
|
|
1193 |
temp1->WriteUintL(TPtrC(MODEM_DATA_BITS),(TUint32)EData8);
|
|
1194 |
temp1->WriteUintL(TPtrC(MODEM_STOP_BITS),(TUint32)EStop1);
|
|
1195 |
temp1->WriteUintL(TPtrC(MODEM_PARITY),(TUint32)EParityNone);
|
|
1196 |
temp1->WriteUintL(TPtrC(MODEM_RATE),(TUint32)EBps115200);
|
|
1197 |
temp1->WriteUintL(TPtrC(MODEM_HANDSHAKING),(TUint32)0);
|
|
1198 |
temp1->WriteUintL(TPtrC(MODEM_SPECIAL_RATE),(TUint32)0);
|
|
1199 |
temp1->WriteUintL(TPtrC(MODEM_XON_CHAR),(TUint32)0);
|
|
1200 |
temp1->WriteUintL(TPtrC(MODEM_XOFF_CHAR),(TUint32)0);
|
|
1201 |
//
|
|
1202 |
temp1->WriteTextL(TPtrC(MODEM_MODEM_INIT_STRING),_L8("AT"));
|
|
1203 |
temp1->WriteTextL(TPtrC(MODEM_DATA_INIT_STRING),_L8("AT"));
|
|
1204 |
temp1->WriteTextL(TPtrC(MODEM_FAX_INIT_STRING),_L8("AT"));
|
|
1205 |
temp1->WriteTextL(TPtrC(MODEM_SPEAKER_VOL_CONTROL_LOW),_L8("L0"));
|
|
1206 |
temp1->WriteTextL(TPtrC(MODEM_SPEAKER_VOL_CONTROL_MEDIUM),_L8("L1"));
|
|
1207 |
temp1->WriteTextL(TPtrC(MODEM_SPEAKER_VOL_CONTROL_HIGH),_L8("L2"));
|
|
1208 |
temp1->WriteTextL(TPtrC(MODEM_SPEAKER_ALWAYS_OFF),_L8("M0"));
|
|
1209 |
temp1->WriteTextL(TPtrC(MODEM_SPEAKER_ON_UNTIL_CARRIER),_L8("M1"));
|
|
1210 |
temp1->WriteTextL(TPtrC(MODEM_SPEAKER_ALWAYS_ON),_L8("M2"));
|
|
1211 |
temp1->WriteTextL(TPtrC(MODEM_SPEAKER_ON_AFTER_DIAL_UNTIL_CARRIER),_L8("M3"));
|
|
1212 |
temp1->WriteTextL(TPtrC(MODEM_DIAL_TONE_WAIT_MODIFIER),_L8("W"));
|
|
1213 |
temp1->WriteTextL(TPtrC(MODEM_DIAL_PAUSE_LENGTH),_L8("S8="));
|
|
1214 |
temp1->WriteTextL(TPtrC(MODEM_CALL_PROGRESS_1),_L8("X1"));
|
|
1215 |
temp1->WriteTextL(TPtrC(MODEM_CALL_PROGRESS_2),_L8("X2"));
|
|
1216 |
temp1->WriteTextL(TPtrC(MODEM_CALL_PROGRESS_3),_L8("X3"));
|
|
1217 |
temp1->WriteTextL(TPtrC(MODEM_CALL_PROGRESS_4),_L8("X4"));
|
|
1218 |
temp1->WriteTextL(TPtrC(MODEM_ECHO_OFF),_L8("E0"));
|
|
1219 |
temp1->WriteTextL(TPtrC(MODEM_VERBOSE_TEXT),_L8("V1"));
|
|
1220 |
temp1->WriteTextL(TPtrC(MODEM_QUIET_ON),_L8("Q1"));
|
|
1221 |
temp1->WriteTextL(TPtrC(MODEM_QUIET_OFF),_L8("Q0"));
|
|
1222 |
temp1->WriteTextL(TPtrC(MODEM_DIAL_COMMAND_STATE_MODIFIER),_L8(";"));
|
|
1223 |
temp1->WriteTextL(TPtrC(MODEM_ON_LINE),_L8("O"));
|
|
1224 |
temp1->WriteTextL(TPtrC(MODEM_RESET_CONFIGURATION),_L8("Z"));
|
|
1225 |
temp1->WriteTextL(TPtrC(MODEM_RETURN_TO_FACTORY_DEFS),_L8("&F"));
|
|
1226 |
temp1->WriteTextL(TPtrC(MODEM_DCD_ON_DURING_LINK),_L8("&C1"));
|
|
1227 |
temp1->WriteTextL(TPtrC(MODEM_DTR_HANG_UP),_L8("&D2"));
|
|
1228 |
temp1->WriteTextL(TPtrC(MODEM_DSR_ALWAYS_ON),_L8("&S0"));
|
|
1229 |
temp1->WriteTextL(TPtrC(MODEM_RTS_CTS_HANDSHAKE),_L8("&K3"));
|
|
1230 |
temp1->WriteTextL(TPtrC(MODEM_XON_XOFF_HANDSHAKE),_L8("&K4"));
|
|
1231 |
temp1->WriteTextL(TPtrC(MODEM_ESCAPE_CHARACTER),_L8("+"));
|
|
1232 |
temp1->WriteTextL(TPtrC(MODEM_ESCAPE_GUARD_PERIOD),_L8("S12"));
|
|
1233 |
//
|
|
1234 |
temp1->WriteTextL(TPtrC(MODEM_NO_DIAL_TONE),_L8("NO DIAL TONE"));
|
|
1235 |
temp1->WriteTextL(TPtrC(MODEM_BUSY),_L8("BUSY"));
|
|
1236 |
temp1->WriteTextL(TPtrC(MODEM_NO_ANSWER),_L8("NO ANSWER"));
|
|
1237 |
temp1->WriteTextL(TPtrC(MODEM_CARRIER),_L8("CARRIER"));
|
|
1238 |
temp1->WriteTextL(TPtrC(MODEM_CONNECT),_L8("CONNECT"));
|
|
1239 |
temp1->WriteTextL(TPtrC(MODEM_COMPRESSION_CLASS_5),_L8("COMPRESSION:CLASS 5"));
|
|
1240 |
temp1->WriteTextL(TPtrC(MODEM_COMPRESSION_V42BIS),_L8("COMPRESSION:V.42 bis"));
|
|
1241 |
temp1->WriteTextL(TPtrC(MODEM_COMPRESSION_NONE),_L8("COMPRESSION:NONE"));
|
|
1242 |
temp1->WriteTextL(TPtrC(MODEM_PROTOCOL_LAPD),_L8("PROTOCOL:LAPD"));
|
|
1243 |
temp1->WriteTextL(TPtrC(MODEM_PROTOCOL_ALT),_L8("PROTOCOL:ALT"));
|
|
1244 |
temp1->WriteTextL(TPtrC(MODEM_PROTOCOL_ALTCELLULAR),_L8("PROTOCOL:ALT-CELLULAR"));
|
|
1245 |
temp1->WriteTextL(TPtrC(MODEM_PROTOCOL_NONE),_L8("PROTOCOL:NONE"));
|
|
1246 |
//
|
|
1247 |
temp1->WriteUintL(TPtrC(MODEM_FAX_CLASS_PREF),(TUint32)EClassAuto);
|
|
1248 |
temp1->WriteUintL(TPtrC(MODEM_SPEAKER_PREF),(TUint32)EModemSpeakerSettingAfterDialUntilAnswer);
|
|
1249 |
temp1->WriteUintL(TPtrC(MODEM_SPEAKER_VOL_PREF),(TUint32)EModemSpeakerVolumeQuiet);
|
|
1250 |
|
|
1251 |
CHECKPOINT(temp1->StoreModifications()==KErrNone);
|
|
1252 |
CleanupStack::PopAndDestroy();
|
|
1253 |
|
|
1254 |
CCommsDbTemplateRecord* temp2=CCommsDbTemplateRecord::NewL(TheDb,TPtrC(LOCATION));
|
|
1255 |
CleanupStack::PushL(temp2);
|
|
1256 |
temp2->Modify();
|
|
1257 |
|
|
1258 |
temp2->WriteTextL(TPtrC(COMMDB_NAME),_L("Default Location"));
|
|
1259 |
temp2->WriteTextL(TPtrC(LOCATION_INTL_PREFIX_CODE),_L("+"));
|
|
1260 |
temp2->WriteTextL(TPtrC(LOCATION_NAT_PREFIX_CODE),_L("0"));
|
|
1261 |
temp2->WriteTextL(TPtrC(LOCATION_NAT_CODE),_L("44"));
|
|
1262 |
temp2->WriteTextL(TPtrC(LOCATION_AREA_CODE),KNullDesC);
|
|
1263 |
temp2->WriteBoolL(TPtrC(LOCATION_MOBILE),ETrue);
|
|
1264 |
temp2->WriteBoolL(TPtrC(LOCATION_USE_PULSE_DIAL),EFalse);
|
|
1265 |
temp2->WriteBoolL(TPtrC(LOCATION_WAIT_FOR_DIAL_TONE),EFalse);
|
|
1266 |
temp2->WriteUintL(TPtrC(LOCATION_PAUSE_AFTER_DIAL_OUT),(TUint32)0);
|
|
1267 |
|
|
1268 |
CHECKPOINT(temp2->StoreModifications()==KErrNone);
|
|
1269 |
CleanupStack::PopAndDestroy();
|
|
1270 |
|
|
1271 |
CCommsDbTemplateRecord* temp3=CCommsDbTemplateRecord::NewL(TheDb,TPtrC(DIAL_OUT_ISP));
|
|
1272 |
CleanupStack::PushL(temp3);
|
|
1273 |
temp3->Modify();
|
|
1274 |
|
|
1275 |
temp3->WriteTextL(TPtrC(COMMDB_NAME),_L("Defaul Dial Out ISP"));
|
|
1276 |
temp3->WriteBoolL(TPtrC(ISP_DIAL_RESOLUTION),ETrue);
|
|
1277 |
temp3->WriteBoolL(TPtrC(ISP_PROMPT_FOR_LOGIN),ETrue);
|
|
1278 |
temp3->WriteBoolL(TPtrC(ISP_USE_LOGIN_SCRIPT),EFalse);
|
|
1279 |
temp3->WriteBoolL(TPtrC(ISP_DISPLAY_PCT),EFalse);
|
|
1280 |
temp3->WriteTextL(TPtrC(ISP_IF_NAME),_L("ppp"));
|
|
1281 |
temp3->WriteBoolL(TPtrC(ISP_IF_PROMPT_FOR_AUTH),ETrue);
|
|
1282 |
temp3->WriteBoolL(TPtrC(ISP_IF_CALLBACK_ENABLED),EFalse);
|
|
1283 |
temp3->WriteBoolL(TPtrC(ISP_IP_ADDR_FROM_SERVER),ETrue);
|
|
1284 |
temp3->WriteBoolL(TPtrC(ISP_IP_DNS_ADDR_FROM_SERVER),ETrue);
|
|
1285 |
temp3->WriteBoolL(TPtrC(ISP_ENABLE_IP_HEADER_COMP),EFalse);
|
|
1286 |
temp3->WriteBoolL(TPtrC(ISP_ENABLE_LCP_EXTENSIONS),EFalse);
|
|
1287 |
temp3->WriteBoolL(TPtrC(ISP_DISABLE_PLAIN_TEXT_AUTH),EFalse);
|
|
1288 |
temp3->WriteBoolL(TPtrC(ISP_ENABLE_SW_COMP),EFalse);
|
|
1289 |
|
|
1290 |
CHECKPOINT(temp3->StoreModifications()==KErrNone);
|
|
1291 |
CleanupStack::PopAndDestroy();
|
|
1292 |
|
|
1293 |
CCommsDbTemplateRecord* temp4=CCommsDbTemplateRecord::NewL(TheDb,TPtrC(DIAL_IN_ISP));
|
|
1294 |
CleanupStack::PushL(temp4);
|
|
1295 |
temp4->Modify();
|
|
1296 |
|
|
1297 |
temp4->WriteTextL(TPtrC(COMMDB_NAME),_L("Defaul Dial In ISP"));
|
|
1298 |
temp4->WriteBoolL(TPtrC(ISP_USE_LOGIN_SCRIPT),EFalse);
|
|
1299 |
temp4->WriteTextL(TPtrC(ISP_IF_NAME),_L("ppp"));
|
|
1300 |
temp4->WriteBoolL(TPtrC(ISP_IP_ADDR_FROM_SERVER),ETrue);
|
|
1301 |
temp4->WriteBoolL(TPtrC(ISP_IP_DNS_ADDR_FROM_SERVER),ETrue);
|
|
1302 |
temp4->WriteBoolL(TPtrC(ISP_ENABLE_IP_HEADER_COMP),EFalse);
|
|
1303 |
temp4->WriteBoolL(TPtrC(ISP_ENABLE_LCP_EXTENSIONS),EFalse);
|
|
1304 |
temp4->WriteBoolL(TPtrC(ISP_DISABLE_PLAIN_TEXT_AUTH),EFalse);
|
|
1305 |
temp4->WriteBoolL(TPtrC(ISP_ENABLE_SW_COMP),EFalse);
|
|
1306 |
|
|
1307 |
CHECKPOINT(temp4->StoreModifications()==KErrNone);
|
|
1308 |
CleanupStack::PopAndDestroy();
|
|
1309 |
|
|
1310 |
CCommsDbTemplateRecord* temp5=CCommsDbTemplateRecord::NewL(TheDb,TPtrC(WAP_ACCESS_POINT));
|
|
1311 |
CleanupStack::PushL(temp5);
|
|
1312 |
temp5->Modify();
|
|
1313 |
|
|
1314 |
temp5->WriteTextL(TPtrC(COMMDB_NAME),_L("Defaul Dial In ISP"));
|
|
1315 |
temp5->WriteTextL(TPtrC(WAP_CURRENT_BEARER),TPtrC(WAP_IP_BEARER));
|
|
1316 |
temp5->WriteTextL(TPtrC(WAP_START_PAGE),_L(""));
|
|
1317 |
|
|
1318 |
CHECKPOINT(temp5->StoreModifications()==KErrNone);
|
|
1319 |
CleanupStack::PopAndDestroy();
|
|
1320 |
|
|
1321 |
CCommsDbTemplateRecord* temp6=CCommsDbTemplateRecord::NewL(TheDb,TPtrC(WAP_IP_BEARER));
|
|
1322 |
CleanupStack::PushL(temp6);
|
|
1323 |
temp6->Modify();
|
|
1324 |
|
|
1325 |
temp6->WriteUintL(TPtrC(WAP_ACCESS_POINT_ID),0ul);
|
|
1326 |
temp6->WriteTextL(TPtrC(WAP_GATEWAY_ADDRESS),_L(""));
|
|
1327 |
temp6->WriteUintL(TPtrC(WAP_IAP),0);
|
|
1328 |
// temp6->WriteUintL(TPtrC(WAP_ISP),0);
|
|
1329 |
// temp6->WriteUintL(TPtrC(WAP_LOCATION),0);
|
|
1330 |
// temp6->WriteUintL(TPtrC(WAP_CHARGECARD),0);
|
|
1331 |
// temp6->WriteUintL(TPtrC(WAP_ISP_TYPE),0);
|
|
1332 |
temp6->WriteUintL(TPtrC(WAP_WSP_OPTION),0);
|
|
1333 |
temp6->WriteBoolL(TPtrC(WAP_SECURITY),EFalse);
|
|
1334 |
|
|
1335 |
CHECKPOINT(temp6->StoreModifications()==KErrNone);
|
|
1336 |
CleanupStack::PopAndDestroy();
|
|
1337 |
|
|
1338 |
CCommsDbTemplateRecord* temp7=CCommsDbTemplateRecord::NewL(TheDb,TPtrC(WAP_SMS_BEARER));
|
|
1339 |
CleanupStack::PushL(temp7);
|
|
1340 |
temp7->Modify();
|
|
1341 |
|
|
1342 |
temp7->WriteUintL(TPtrC(WAP_ACCESS_POINT_ID),0ul);
|
|
1343 |
temp7->WriteTextL(TPtrC(WAP_GATEWAY_ADDRESS),_L(""));
|
|
1344 |
temp7->WriteTextL(TPtrC(WAP_SERVICE_CENTRE_ADDRESS),_L(""));
|
|
1345 |
temp7->WriteUintL(TPtrC(WAP_WSP_OPTION),0);
|
|
1346 |
temp7->WriteBoolL(TPtrC(WAP_SECURITY),EFalse);
|
|
1347 |
|
|
1348 |
CHECKPOINT(temp7->StoreModifications()==KErrNone);
|
|
1349 |
CleanupStack::PopAndDestroy();
|
|
1350 |
}
|
|
1351 |
|
|
1352 |
|
|
1353 |
LOCAL_C TUint32 CreateISPTableL()
|
|
1354 |
/**
|
|
1355 |
* Populate the ISP table.
|
|
1356 |
* The presence of this table in the database is important, but the values are not.
|
|
1357 |
*/
|
|
1358 |
{
|
|
1359 |
TUint32 dialOutId;
|
|
1360 |
CCommsDbTableView* table=TheDb->OpenTableLC(TPtrC(DIAL_OUT_ISP));
|
|
1361 |
CHECKPOINT(table->InsertRecord(dialOutId)==KErrNone);
|
|
1362 |
table->WriteTextL(TPtrC(COMMDB_NAME),_L("NT RAS"));
|
|
1363 |
table->WriteUintL(TPtrC(ISP_TYPE),(TUint32)EIspTypeInternetOnly);
|
|
1364 |
table->WriteBoolL(TPtrC(ISP_DIAL_RESOLUTION),ETrue);
|
|
1365 |
table->WriteTextL(TPtrC(ISP_DEFAULT_TEL_NUM),KNullDesC);
|
|
1366 |
table->WriteBoolL(TPtrC(ISP_PROMPT_FOR_LOGIN),EFalse);
|
|
1367 |
table->WriteBoolL(TPtrC(ISP_USE_LOGIN_SCRIPT),ETrue);
|
|
1368 |
table->WriteLongTextL(TPtrC(ISP_LOGIN_SCRIPT),_L("CHARMAP [CODE PAGE 1252]\nLOOP 10\n{\nSEND \"CLIENT\"+<0x0d>\nWAIT 3\n{\n\"SERVER\" OK\n}\n}\nEXIT KErrNoAnswer$\n\nOK:\nEXIT\n"));
|
|
1369 |
table->WriteBoolL(TPtrC(ISP_DISPLAY_PCT),EFalse);
|
|
1370 |
table->WriteTextL(TPtrC(ISP_IF_NAME),_L("ppp"));
|
|
1371 |
table->WriteTextL(TPtrC(ISP_IF_NETWORKS),_L("ip"));
|
|
1372 |
table->WriteBoolL(TPtrC(ISP_IF_PROMPT_FOR_AUTH),ETrue);
|
|
1373 |
table->WriteTextL(TPtrC(ISP_IF_AUTH_NAME),_L("RasUser"));
|
|
1374 |
table->WriteTextL(TPtrC(ISP_IF_AUTH_PASS),_L("O`rr"));
|
|
1375 |
table->WriteBoolL(TPtrC(ISP_IF_CALLBACK_ENABLED),EFalse);
|
|
1376 |
table->WriteBoolL(TPtrC(ISP_IP_ADDR_FROM_SERVER),ETrue);
|
|
1377 |
table->WriteBoolL(TPtrC(ISP_IP_DNS_ADDR_FROM_SERVER),ETrue);
|
|
1378 |
table->WriteBoolL(TPtrC(ISP_ENABLE_IP_HEADER_COMP),EFalse);
|
|
1379 |
table->WriteBoolL(TPtrC(ISP_ENABLE_LCP_EXTENSIONS),EFalse);
|
|
1380 |
table->WriteBoolL(TPtrC(ISP_DISABLE_PLAIN_TEXT_AUTH),EFalse);
|
|
1381 |
table->WriteBoolL(TPtrC(ISP_ENABLE_SW_COMP),EFalse);
|
|
1382 |
|
|
1383 |
CHECKPOINT(table->PutRecordChanges()==KErrNone);
|
|
1384 |
CleanupStack::PopAndDestroy();
|
|
1385 |
return dialOutId;
|
|
1386 |
}
|