Updating the config scripts and adding support for updating the CCE CenRep file AT_Test_LTSY
authorTom Pritchard <tomp@symbian.org>
Tue, 02 Mar 2010 21:40:14 +0000
branchAT_Test_LTSY
changeset 10 4d82aaca4452
parent 6 9b3b5a50db11
child 34 7c3d96ebb735
Updating the config scripts and adding support for updating the CCE CenRep file
telephonyserverplugins/attestltsy/config/configatmodem.bat
telephonyserverplugins/attestltsy/config/modifycenrep.pl
telephonyserverplugins/attestltsy/config/modifycommdb.pl
--- a/telephonyserverplugins/attestltsy/config/configatmodem.bat	Wed Feb 24 13:44:01 2010 +0000
+++ b/telephonyserverplugins/attestltsy/config/configatmodem.bat	Tue Mar 02 21:40:14 2010 +0000
@@ -4,7 +4,7 @@
 REM This component and the accompanying materials are made available
 REM under the terms of Eclipse Public License v1.0
 REM which accompanies this distribution, and is available
-REM at the URL http:REMwww.eclipse.org/legal/epl-v10.html.
+REM at the URL http://www.eclipse.org/legal/epl-v10.html.
 REM
 REM Initial Contributors:
 REM Symbian Foundation - initial contribution.
@@ -27,12 +27,15 @@
 copy /Y \epoc32\release\winscw\udeb\phonetsywithdispatcher.tsy \epoc32\release\winscw\udeb\phonetsy.tsy
 
 echo Setup the feature manager to include GSM and WCDMA features:
-@perl -S -I/epoc32/tools/featmgr /sf/os/cellularsrv/telephonyserverplugins/attestltsy/config/modifyfeaturedb.pl
+@perl -S -I/epoc32/tools/featmgr ./modifyfeaturedb.pl
 
-echo Setuping CommDB:
+echo Setup the Converged Call Engine plugin to use CS rather than VCC:
+@perl -S ./modifycenrep.pl
+
+echo Setup CommDB:
 REM copy /Y \sf\os\cellularsrv\telephonyserverplugins\attestltsy\config\AT-LTSY(default).cfg \epoc32\winscw\c\AT-LTSY(default).cfg
 cd \sf\os\cellularsrv\telephonyserverplugins\attestltsy\config
-@perl -S /sf/os/cellularsrv/telephonyserverplugins/attestltsy/config/modifycommdb.pl
-\epoc32\release\winscw\udeb\ced.exe -Dtextshell -- c:\AT-LTSY(wavcom).cfg
+@perl -S ./modifycommdb.pl
+\epoc32\release\winscw\udeb\ced.exe -Dtextshell -- c:\AT-LTSY.cfg
 
 REM M:\sf\os\devicesrv\sysstatemgmt\group>sbs -b bld.inf -c winscw_udeb RESOURCE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/telephonyserverplugins/attestltsy/config/modifycenrep.pl	Tue Mar 02 21:40:14 2010 +0000
@@ -0,0 +1,48 @@
+#!perl -w
+# Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Symbian Foundation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+# This script modifies the CCE plugin cenrep file to use the CS plugin rather than the VCC one.
+# 
+#
+
+use strict;
+
+# Open the cenrep files
+my $cenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.txt";
+my $newcenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.tmp";
+my $cenrepbak = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.bak";
+my $file2string;
+
+# Open the file in UNICODE-16 and read the whole contents into a string
+open(my $CENREPREAD, "<:raw:encoding(UTF-16LE):crlf:utf8", $cenrep) or die "Couldn't open current cenrep file";
+{
+$/ =undef;
+$file2string = <$CENREPREAD>;
+}
+close($CENREPREAD);
+
+# Modify the crucial line to the new UID for CS calls rather than VCC
+$file2string =~ s/0x9001 string \"536924074\"/0x9001 string \"271067365\"/g;
+
+# Write out the contents into a new UNICODE-16 encoded file
+open(my $CENREPOUT, ">:raw:encoding(UTF-16LE):crlf:utf8", $newcenrep) or die "Couldn't open new cenrep file for output";
+print $CENREPOUT $file2string;
+close($CENREPOUT);
+
+
+# Now backup the old and copy the new files
+rename($cenrep, $cenrepbak) or die "Couldn't backup feature data file '$cenrep'\n" unless (-e $cenrepbak); # OK for this to fail as it probably just means there's already a backup
+rename($newcenrep, $cenrep) or die "Couldn't copy feature data file '$newcenrep'\n";
+
+print "\tCCE CenRep Setup\n";
\ No newline at end of file
--- a/telephonyserverplugins/attestltsy/config/modifycommdb.pl	Wed Feb 24 13:44:01 2010 +0000
+++ b/telephonyserverplugins/attestltsy/config/modifycommdb.pl	Tue Mar 02 21:40:14 2010 +0000
@@ -12,8 +12,7 @@
 # Contributors:
 #
 # Description:
-# This simple script shows how to modify the content of a feature manager
-# data file.
+# This modifies CommDB for the AT LTSY modem, asking the user for the comm port and baud rate to use.
 # 
 #
 
@@ -29,12 +28,11 @@
 print "What is the baud rate of the modem?\n(Wavecomm default is 9600, Telit default is 152000)\n\tBaud=";
 chomp ($baud = <>);
 
-print "\nComm::$com Baud=$baud\n";
+#print "\nComm::$com Baud=$baud\n";
 
 # Open the config files
 my $defaultcomdb = "<./AT-LTSY(default).cfg";
-my $commdb = ">>../../../../../../epoc32/winscw/c/AT-LTSY.cfg";
-#my $commdb = ">./AT-LTSY.cfg";
+my $commdb = ">/epoc32/winscw/c/AT-LTSY.cfg";
 
 open(COMMDBOUT, $commdb);
 open(COMMDBREAD, $defaultcomdb);
@@ -50,13 +48,13 @@
 # first wait till we've found the $modembearertable line.
 if ($line =~ m/^\[ModemBearer\]/) 
 	{
-	print "Found the modem bearer table\n";
+	#print "Found the modem bearer table\n";
 	$modembearertable = 1;
 	}
 # Or if we've got the end of the table unset the boolean
 elsif ($modembearertable && $line =~ m/^\[/) 
 	{
-	print "Found the end fo the modem bearer table\n";
+	#print "Found the end fo the modem bearer table\n";
 	$modembearertable = 0;	
 	}
 
@@ -66,14 +64,14 @@
 	# Now wait till we've got to an entry for our modem
 	if ($line =~ m/^\sName=CommModem/) 
 		{
-		print "Found the modem entry\n";
+		#print "Found the modem entry\n";
 		$modementry = 1;
 		}
 
 	# Or if we've reached the end of the modem entry unset the boolean
 	if ($modementry && $line =~ m/^END_ADD/) 
 		{
-		print "Found the end of the modem entry\n";
+		#print "Found the end of the modem entry\n";
 		$modementry = 0;
 		}
 	}
@@ -84,14 +82,14 @@
 	# If it's the comm port number set that up
 	if ($line =~ m/^\sPortName=COMM::/) 
 		{
-		print "Changing COMM port\n";
+		print "\tSetting the COMM port\n";
 		$line = "\tPortName=COMM::$com\n"
 		}
 	
 	# If it's the rate then set that up
 	if ($line =~ m/^\sRate=/) 
 		{
-		print "Changing Baud rate\n";
+		print "\tSetting the Baud rate\n";
 		$line = "\tRate=$baud\n"
 		}
 	}
@@ -105,15 +103,3 @@
 close(COMMDBREAD);
 
 
-
-# Open the .cfg file and read each line
-
-#rename($datfile, $datfileback) or die "Couldn't backup feature data file '$datfile'\n";
-#rename($datfile2, $datfile) or die "Couldn't copy feature data file '$datfile2'\n";
-
-#printf ("\tFeature Database setup\n");
-#
-# Example code to remove a feature flag.
-#
-#$fmc->RemoveFeatureFlagByUID($ffuid) or die "Couldn't remove feature flag\n";
-