author | Tom Pritchard <tomp@symbian.org> |
Fri, 16 Jul 2010 17:42:23 +0100 | |
branch | AT_Test_LTSY |
changeset 51 | 6012a0dcf61c |
parent 6 | 9b3b5a50db11 |
permissions | -rw-r--r-- |
4
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
1 |
#!perl -w |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
2 |
# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
3 |
# All rights reserved. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
4 |
# This component and the accompanying materials are made available |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
5 |
# under the terms of "Eclipse Public License v1.0" |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
6 |
# which accompanies this distribution, and is available |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
8 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
9 |
# Initial Contributors: |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
10 |
# Nokia Corporation - initial contribution. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
11 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
12 |
# Contributors: |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
13 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
14 |
# Description: |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
15 |
# This simple script shows how to modify the content of a feature manager |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
16 |
# data file. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
17 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
18 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
19 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
20 |
use strict; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
21 |
use FMCreate; |
51
6012a0dcf61c
Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents:
6
diff
changeset
|
22 |
use File::Copy; |
4
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
23 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
24 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
25 |
# Hardwire the datafile - this is only an example. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
26 |
# |
5
c646ab78f948
Fix up the path to the features.dat database for emulator
Tom Pritchard <tomp@symbian.org>
parents:
4
diff
changeset
|
27 |
my $datfile = "/epoc32/release/winscw/udeb/z/private/10205054/features.dat"; |
c646ab78f948
Fix up the path to the features.dat database for emulator
Tom Pritchard <tomp@symbian.org>
parents:
4
diff
changeset
|
28 |
my $datfile2 = "/epoc32/release/winscw/udeb/z/private/10205054/features2.dat"; |
c646ab78f948
Fix up the path to the features.dat database for emulator
Tom Pritchard <tomp@symbian.org>
parents:
4
diff
changeset
|
29 |
my $datfileback = "/epoc32/release/winscw/udeb/z/private/10205054/features.bak"; |
51
6012a0dcf61c
Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents:
6
diff
changeset
|
30 |
my $datfilerom = "/epoc32/data/z/private/10205054/features.dat"; |
4
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
31 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
32 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
33 |
# Create an object that represents a feature data file. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
34 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
35 |
my $fmc = FMCreate->new(); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
36 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
37 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
38 |
# Load the content of the data file into our FMCreate object. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
39 |
# Note that this will die if the content does not seem to be a feature set |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
40 |
# file. This can happen if the first four bytes aren't 'feat' or if reading |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
41 |
# the file fails at any point. This will also happen if the file is the wrong |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
42 |
# size. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
43 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
44 |
$fmc->LoadUp($datfile) or die "Failed to load up data from '$datfile'\n"; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
45 |
|
6
9b3b5a50db11
Updating the config script to setup commdb dynamically
Tom Pritchard <tomp@symbian.org>
parents:
5
diff
changeset
|
46 |
# Setup an array of all the features we need to switch on. |
4
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
47 |
my $ffuid; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
48 |
my $ff; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
49 |
my @tomtab; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
50 |
|
6
9b3b5a50db11
Updating the config script to setup commdb dynamically
Tom Pritchard <tomp@symbian.org>
parents:
5
diff
changeset
|
51 |
$tomtab[0] = 81; # KFeatureIdProtocolGsm |
9b3b5a50db11
Updating the config script to setup commdb dynamically
Tom Pritchard <tomp@symbian.org>
parents:
5
diff
changeset
|
52 |
$tomtab[1] = 82; # KFeatureIdProtocolWcdma |
51
6012a0dcf61c
Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents:
6
diff
changeset
|
53 |
$tomtab[2] = 1696; # KFeatureIdOnScreenDialer |
6012a0dcf61c
Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents:
6
diff
changeset
|
54 |
$tomtab[3] = 1715; # KFeatureIdTouchCallHandling |
4
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
55 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
56 |
foreach $ffuid (@tomtab) |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
57 |
{ |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
58 |
$ff = $fmc->GetFeatureFlagByUID($ffuid); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
59 |
if(ref($ff) ne "FeatureFlag") |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
60 |
{ |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
61 |
printf ("Feature flag uid 0x%0x was not already in $datfile, creating it.\n", $ffuid); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
62 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
63 |
# Now add a new feature. The three arguments are UID, status flags (not defined |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
64 |
# here) and user data word. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
65 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
66 |
$ff = FeatureFlag->new($ffuid, undef, 0x00000000); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
67 |
die "Couldn't create new feature flag object.\n" unless(ref($ff)); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
68 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
69 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
70 |
# Add it to our existing feature data. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
71 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
72 |
$fmc->AddFeatureFlag($ff) or die "Couldn't add new feature flag..\n"; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
73 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
74 |
printf ("Feature flag uid 0x%0x created ok.\n", $ffuid); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
75 |
} |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
76 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
77 |
$ff->Supported(1); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
78 |
$ff->Upgradable(0); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
79 |
$ff->Modifiable(0); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
80 |
$ff->BlackListed(0); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
81 |
$ff->Uninitialized(0); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
82 |
$ff->Persisted(0); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
83 |
} |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
84 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
85 |
# Now write out the file to a new location |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
86 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
87 |
$fmc->WriteToFile($datfile2) or die "Couldn't write feature data file '$datfile2'\n"; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
88 |
|
51
6012a0dcf61c
Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents:
6
diff
changeset
|
89 |
copy($datfile2, $datfilerom) or die "Couldn't copy the data file for ROM usage: '$datfilerom'\n"; |
4
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
90 |
rename($datfile, $datfileback) or die "Couldn't backup feature data file '$datfile'\n"; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
91 |
rename($datfile2, $datfile) or die "Couldn't copy feature data file '$datfile2'\n"; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
92 |
|
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
93 |
printf ("\tFeature Database setup\n"); |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
94 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
95 |
# Example code to remove a feature flag. |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
96 |
# |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
97 |
#$fmc->RemoveFeatureFlagByUID($ffuid) or die "Couldn't remove feature flag\n"; |
3cf043a18b40
Adding config script - now you should be able to run ConfigAtModem from this folder
Tom Pritchard <tomp@symbian.org>
parents:
diff
changeset
|
98 |