author | zautrix <zautrix> | 2004-10-08 22:22:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-08 22:22:02 (UTC) |
commit | 44169895703beb3e8b1551a313d2d341bf742905 (patch) (unidiff) | |
tree | 4e337f9b55d544a939185dbcdbad558b1ed2504d | |
parent | 10a0e05cc4962d9412a7a5faf3d69a3caf6d1c34 (diff) | |
download | kdepimpi-44169895703beb3e8b1551a313d2d341bf742905.zip kdepimpi-44169895703beb3e8b1551a313d2d341bf742905.tar.gz kdepimpi-44169895703beb3e8b1551a313d2d341bf742905.tar.bz2 |
gammu changes
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | Makefile.Embedded | 2 | ||||
-rw-r--r-- | bin/kdepim/korganizer/howtoSYNC.txt | 2 | ||||
-rw-r--r-- | gammu/emb/gammu/gammu.c | 2 | ||||
-rw-r--r-- | phoneaccess.control (renamed from kammu.control) | 0 |
5 files changed, 9 insertions, 8 deletions
@@ -1,329 +1,330 @@ | |||
1 | export KDEPIMDIR = $(shell pwd) | 1 | export KDEPIMDIR = $(shell pwd) |
2 | 2 | ||
3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) | 3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) |
4 | 4 | ||
5 | ifeq ($(PLATFORM) , zaurus) | 5 | ifeq ($(PLATFORM) , zaurus) |
6 | BUILD_NO_LDAP_PLUGIN=1 | 6 | BUILD_NO_LDAP_PLUGIN=1 |
7 | endif | 7 | endif |
8 | 8 | ||
9 | ifneq ($(PLATFORM) , zaurus) | 9 | ifneq ($(PLATFORM) , zaurus) |
10 | BUILD_NO_SHARP_PLUGIN=1 | 10 | BUILD_NO_SHARP_PLUGIN=1 |
11 | endif | 11 | endif |
12 | 12 | ||
13 | SUBDIRS_MICROKDE = \ | 13 | SUBDIRS_MICROKDE = \ |
14 | libical/src/libical \ | 14 | libical/src/libical \ |
15 | libical/src/libicalss \ | 15 | libical/src/libicalss \ |
16 | qtcompat \ | 16 | qtcompat \ |
17 | microkde \ | 17 | microkde \ |
18 | libkcal \ | 18 | libkcal \ |
19 | libkdepim \ | 19 | libkdepim \ |
20 | kabc \ | 20 | kabc \ |
21 | kabc/formats/binary \ | 21 | kabc/formats/binary \ |
22 | kabc/plugins/file \ | 22 | kabc/plugins/file \ |
23 | kabc/plugins/dir \ | 23 | kabc/plugins/dir \ |
24 | korganizer \ | 24 | korganizer \ |
25 | kalarmd \ | 25 | kalarmd \ |
26 | kaddressbook | 26 | kaddressbook |
27 | 27 | ||
28 | SUBDIRS_QTOPIA_PLUGIN = \ | 28 | SUBDIRS_QTOPIA_PLUGIN = \ |
29 | kabc/plugins/qtopia | 29 | kabc/plugins/qtopia |
30 | 30 | ||
31 | SUBDIRS_OPIE_PLUGIN = \ | 31 | SUBDIRS_OPIE_PLUGIN = \ |
32 | kabc/plugins/opie | 32 | kabc/plugins/opie |
33 | 33 | ||
34 | SUBDIRS_SHARP_PLUGIN = \ | 34 | SUBDIRS_SHARP_PLUGIN = \ |
35 | kabc/plugins/sharpdtm | 35 | kabc/plugins/sharpdtm |
36 | 36 | ||
37 | SUBDIRS_LDAP_PLUGIN = \ | 37 | SUBDIRS_LDAP_PLUGIN = \ |
38 | kabc/plugins/ldap | 38 | kabc/plugins/ldap |
39 | 39 | ||
40 | SUBDIRS_MICROMAIL = \ | 40 | SUBDIRS_MICROMAIL = \ |
41 | kmicromail/libetpan \ | 41 | kmicromail/libetpan \ |
42 | kmicromail/libmailwrapper \ | 42 | kmicromail/libmailwrapper \ |
43 | kmicromail | 43 | kmicromail |
44 | 44 | ||
45 | SUBDIRS_GAMMU = \ | 45 | SUBDIRS_GAMMU = \ |
46 | gammu/emb/common \ | 46 | gammu/emb/common \ |
47 | gammu/emb/gammu | 47 | gammu/emb/gammu |
48 | 48 | ||
49 | SUBDIRS_PWMANAGER = \ | 49 | SUBDIRS_PWMANAGER = \ |
50 | pwmanager/pwmanager | 50 | pwmanager/pwmanager |
51 | 51 | ||
52 | SUBDIRS = \ | 52 | SUBDIRS = \ |
53 | $(SUBDIRS_MICROKDE) \ | 53 | $(SUBDIRS_MICROKDE) \ |
54 | $(SUBDIRS_QTOPIA_PLUGIN) \ | 54 | $(SUBDIRS_QTOPIA_PLUGIN) \ |
55 | $(SUBDIRS_OPIE_PLUGIN) \ | 55 | $(SUBDIRS_OPIE_PLUGIN) \ |
56 | $(SUBDIRS_SHARP_PLUGIN) \ | 56 | $(SUBDIRS_SHARP_PLUGIN) \ |
57 | $(SUBDIRS_LDAP_PLUGIN) \ | 57 | $(SUBDIRS_LDAP_PLUGIN) \ |
58 | $(SUBDIRS_MICROMAIL) \ | 58 | $(SUBDIRS_MICROMAIL) \ |
59 | $(SUBDIRS_GAMMU) \ | 59 | $(SUBDIRS_GAMMU) \ |
60 | $(SUBDIRS_PWMANAGER) | 60 | $(SUBDIRS_PWMANAGER) |
61 | 61 | ||
62 | |||
62 | all: build_microkde \ | 63 | all: build_microkde \ |
63 | build_qtopia_plugin \ | 64 | build_qtopia_plugin \ |
64 | build_opie_plugin \ | 65 | build_opie_plugin \ |
65 | build_sharp_plugin \ | 66 | build_sharp_plugin \ |
66 | build_ldap_plugin \ | 67 | build_ldap_plugin \ |
67 | build_micromail \ | 68 | build_micromail \ |
68 | build_gammu \ | 69 | build_gammu \ |
69 | build_pwmanager | 70 | build_pwmanager |
70 | 71 | ||
71 | 72 | ||
72 | build_microkde: variable_test tmake | 73 | build_microkde: variable_test tmake |
73 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ | 74 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ |
74 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 75 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
75 | done | 76 | done |
76 | 77 | ||
77 | build_qtopia_plugin: build_microkde | 78 | build_qtopia_plugin: build_microkde |
78 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ | 79 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ |
79 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 80 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
80 | done | 81 | done |
81 | 82 | ||
82 | build_opie_plugin: build_microkde | 83 | build_opie_plugin: build_microkde |
83 | ifdef BUILD_NO_OPIE_PLUGIN | 84 | ifdef BUILD_NO_OPIE_PLUGIN |
84 | @echo == opie plugin not build. | 85 | @echo == opie plugin not build. |
85 | else | 86 | else |
86 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ | 87 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ |
87 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 88 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
88 | done | 89 | done |
89 | endif | 90 | endif |
90 | 91 | ||
91 | build_sharp_plugin: build_microkde | 92 | build_sharp_plugin: build_microkde |
92 | ifdef BUILD_NO_SHARP_PLUGIN | 93 | ifdef BUILD_NO_SHARP_PLUGIN |
93 | @echo == ldap plugin not build. | 94 | @echo == ldap plugin not build. |
94 | else | 95 | else |
95 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ | 96 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ |
96 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 97 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
97 | done | 98 | done |
98 | endif | 99 | endif |
99 | 100 | ||
100 | build_ldap_plugin: build_microkde | 101 | build_ldap_plugin: build_microkde |
101 | ifdef BUILD_NO_LDAP_PLUGIN | 102 | ifdef BUILD_NO_LDAP_PLUGIN |
102 | @echo == ldap plugin not build. | 103 | @echo == ldap plugin not build. |
103 | else | 104 | else |
104 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ | 105 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ |
105 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 106 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
106 | done | 107 | done |
107 | endif | 108 | endif |
108 | 109 | ||
109 | 110 | ||
110 | build_micromail: build_microkde | 111 | build_micromail: build_microkde |
111 | ifdef BUILD_NO_MICROMAIL | 112 | ifdef BUILD_NO_MICROMAIL |
112 | @echo == kmicromail not build. | 113 | @echo == kmicromail not build. |
113 | else | 114 | else |
114 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ | 115 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ |
115 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 116 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
116 | done | 117 | done |
117 | endif | 118 | endif |
118 | 119 | ||
119 | build_gammu: variable_test tmake | 120 | build_gammu: variable_test tmake |
120 | ifdef BUILD_NO_GAMMU | 121 | ifdef BUILD_NO_GAMMU |
121 | @echo == gammu not build. | 122 | @echo == gammu not build. |
122 | else | 123 | else |
123 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ | 124 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ |
124 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 125 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
125 | done | 126 | done |
126 | endif | 127 | endif |
127 | 128 | ||
128 | build_pwmanager: build_microkde | 129 | build_pwmanager: build_microkde |
129 | ifdef BUILD_NO_PWMANAGER | 130 | ifdef BUILD_NO_PWMANAGER |
130 | @echo == pwmanager not build. | 131 | @echo == pwmanager not build. |
131 | else | 132 | else |
132 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ | 133 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ |
133 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 134 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
134 | done | 135 | done |
135 | endif | 136 | endif |
136 | 137 | ||
137 | 138 | ||
138 | variable_info: | 139 | variable_info: |
139 | @echo -------------------------------------- | 140 | @echo -------------------------------------- |
140 | @echo KDEPIM buildsystem, variableinfo... | 141 | @echo KDEPIM buildsystem, variableinfo... |
141 | @echo KDEPIMDIR=$(KDEPIMDIR) | 142 | @echo KDEPIMDIR=$(KDEPIMDIR) |
142 | @echo QTDIR=$(QTDIR) | 143 | @echo QTDIR=$(QTDIR) |
143 | @echo QPEDIR=$(QPEDIR) | 144 | @echo QPEDIR=$(QPEDIR) |
144 | @echo OPIEDIR=$(OPIEDIR) | 145 | @echo OPIEDIR=$(OPIEDIR) |
145 | @echo PLATFORM=$(PLATFORM) | 146 | @echo PLATFORM=$(PLATFORM) |
146 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) | 147 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) |
147 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) | 148 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) |
148 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) | 149 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) |
149 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) | 150 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) |
150 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) | 151 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) |
151 | ifndef BUILD_NO_SHARP_PLUGIN | 152 | ifndef BUILD_NO_SHARP_PLUGIN |
152 | @echo SHARPDTMSDK=$(SHARPDTMSDK) | 153 | @echo SHARPDTMSDK=$(SHARPDTMSDK) |
153 | endif | 154 | endif |
154 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) | 155 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) |
155 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) | 156 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) |
156 | @echo -------------------------------------- | 157 | @echo -------------------------------------- |
157 | 158 | ||
158 | variable_test: variable_info | 159 | variable_test: variable_info |
159 | @echo KDEPIM buildsystem, variablecheck... | 160 | @echo KDEPIM buildsystem, variablecheck... |
160 | ifndef KDEPIMDIR | 161 | ifndef KDEPIMDIR |
161 | @echo KDEPIMDIR is not defined. | 162 | @echo KDEPIMDIR is not defined. |
162 | $(error KDEPIMDIR is not defined) | 163 | $(error KDEPIMDIR is not defined) |
163 | endif | 164 | endif |
164 | ifndef PLATFORM | 165 | ifndef PLATFORM |
165 | @echo PLATFORM is not defined. | 166 | @echo PLATFORM is not defined. |
166 | $(error PLATFORM is not defined) | 167 | $(error PLATFORM is not defined) |
167 | endif | 168 | endif |
168 | ifdef BUILD_NO_LDAP_PLUGIN | 169 | ifdef BUILD_NO_LDAP_PLUGIN |
169 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) | 170 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) |
170 | endif | 171 | endif |
171 | ifdef BUILD_NO_OPIE_PLUGIN | 172 | ifdef BUILD_NO_OPIE_PLUGIN |
172 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) | 173 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) |
173 | endif | 174 | endif |
174 | ifdef BUILD_NO_MICROMAIL | 175 | ifdef BUILD_NO_MICROMAIL |
175 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) | 176 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) |
176 | endif | 177 | endif |
177 | ifdef BUILD_NO_SHARP_PLUGIN | 178 | ifdef BUILD_NO_SHARP_PLUGIN |
178 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) | 179 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) |
179 | else | 180 | else |
180 | ifndef SHARPDTMSDK | 181 | ifndef SHARPDTMSDK |
181 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) | 182 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) |
182 | $(error SHARPDTMSDK is not defined) | 183 | $(error SHARPDTMSDK is not defined) |
183 | endif | 184 | endif |
184 | endif | 185 | endif |
185 | ifdef BUILD_NO_GAMMU | 186 | ifdef BUILD_NO_GAMMU |
186 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) | 187 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) |
187 | endif | 188 | endif |
188 | ifdef BUILD_NO_PWMANAGER | 189 | ifdef BUILD_NO_PWMANAGER |
189 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) | 190 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) |
190 | endif | 191 | endif |
191 | @echo -------------------------------------- | 192 | @echo -------------------------------------- |
192 | 193 | ||
193 | 194 | ||
194 | objects: | 195 | objects: |
195 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done | 196 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done |
196 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done | 197 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done |
197 | mkdir -p libical/lib/$(PLATFORM) | 198 | mkdir -p libical/lib/$(PLATFORM) |
198 | 199 | ||
199 | clean: | 200 | clean: |
200 | rm -rf libical/lib/$(PLATFORM)/*; | 201 | rm -rf libical/lib/$(PLATFORM)/*; |
201 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ | 202 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ |
202 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ | 203 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ |
203 | done | 204 | done |
205 | |||
204 | install: | 206 | install: |
205 | 207 | ||
206 | cd bin/kdepim; make install | 208 | cd bin/kdepim; make install |
207 | cp -r Pim $(QPEDIR)/apps | 209 | cp -r Pim $(QPEDIR)/apps |
208 | cp db2file/db2file $(QPEDIR)/bin/db2file | 210 | cp db2file/db2file $(QPEDIR)/bin/db2file |
209 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop | 211 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop |
210 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop | 212 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop |
211 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop | 213 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop |
212 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop | 214 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop |
213 | 215 | ||
214 | dist: | 216 | dist: |
215 | @echo Dont forget to do "make install" before "make dist" | 217 | @echo Dont forget to do "make install" before "make dist" |
216 | rm -f *arm.ipk | 218 | rm -f *arm.ipk |
217 | rm -f *~ | 219 | rm -f *~ |
218 | cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim | 220 | cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim |
219 | ./mkipks kmicrokdelibs.control | 221 | ./mkipks kmicrokdelibs.control |
220 | ./mkipks korganizer.control | 222 | ./mkipks korganizer.control |
221 | ./mkipks kaddressbook.control | 223 | ./mkipks kaddressbook.control |
222 | ifndef BUILD_NO_MICROMAIL | 224 | ifndef BUILD_NO_MICROMAIL |
223 | ./mkipks kopiemail.control | 225 | ./mkipks kopiemail.control |
224 | endif | 226 | endif |
225 | ./mkipks korganizer-alarm.control | 227 | ./mkipks korganizer-alarm.control |
226 | ifndef BUILD_NO_GAMMU | 228 | ifndef BUILD_NO_GAMMU |
227 | ./mkipks kammu.control | 229 | ./mkipks phoneaccess.control |
228 | endif | 230 | endif |
229 | ifndef BUILD_NO_PWMANAGER | 231 | ifndef BUILD_NO_PWMANAGER |
230 | ./mkipks pwmanager.control | 232 | ./mkipks pwmanager.control |
231 | endif | 233 | endif |
232 | ./mkipks pim_TAB_icon.control | 234 | ./mkipks pim_TAB_icon.control |
233 | 235 | ||
234 | tmake: objects \ | 236 | tmake: objects \ |
235 | qtcompat/Makefile$(PLATFORM) \ | 237 | qtcompat/Makefile$(PLATFORM) \ |
236 | microkde/Makefile$(PLATFORM) \ | 238 | microkde/Makefile$(PLATFORM) \ |
237 | libkcal/Makefile$(PLATFORM) \ | 239 | libkcal/Makefile$(PLATFORM) \ |
238 | libkdepim/Makefile$(PLATFORM) \ | 240 | libkdepim/Makefile$(PLATFORM) \ |
239 | korganizer/Makefile$(PLATFORM) \ | 241 | korganizer/Makefile$(PLATFORM) \ |
240 | kalarmd/Makefile$(PLATFORM) \ | 242 | kalarmd/Makefile$(PLATFORM) \ |
241 | libical/src/libical/Makefile$(PLATFORM) \ | 243 | libical/src/libical/Makefile$(PLATFORM) \ |
242 | libical/src/libicalss/Makefile$(PLATFORM) \ | 244 | libical/src/libicalss/Makefile$(PLATFORM) \ |
243 | kabc/Makefile$(PLATFORM) \ | 245 | kabc/Makefile$(PLATFORM) \ |
244 | kabc/formats/binary/Makefile$(PLATFORM) \ | 246 | kabc/formats/binary/Makefile$(PLATFORM) \ |
245 | kabc/plugins/file/Makefile$(PLATFORM) \ | 247 | kabc/plugins/file/Makefile$(PLATFORM) \ |
246 | kabc/plugins/dir/Makefile$(PLATFORM) \ | 248 | kabc/plugins/dir/Makefile$(PLATFORM) \ |
247 | kabc/plugins/ldap/Makefile$(PLATFORM) \ | 249 | kabc/plugins/ldap/Makefile$(PLATFORM) \ |
248 | kabc/plugins/opie/Makefile$(PLATFORM) \ | 250 | kabc/plugins/opie/Makefile$(PLATFORM) \ |
249 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ | 251 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ |
250 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ | 252 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ |
251 | kaddressbook/Makefile$(PLATFORM) \ | 253 | kaddressbook/Makefile$(PLATFORM) \ |
252 | kmicromail/Makefile$(PLATFORM) \ | 254 | kmicromail/Makefile$(PLATFORM) \ |
253 | kmicromail/libetpan/Makefile$(PLATFORM) \ | 255 | kmicromail/libetpan/Makefile$(PLATFORM) \ |
254 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ | 256 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ |
255 | gammu/emb/common/Makefile$(PLATFORM) \ | 257 | gammu/emb/common/Makefile$(PLATFORM) \ |
256 | gammu/emb/gammu/Makefile$(PLATFORM) \ | 258 | gammu/emb/gammu/Makefile$(PLATFORM) \ |
257 | pwmanager/pwmanager/Makefile$(PLATFORM) \ | 259 | pwmanager/pwmanager/Makefile$(PLATFORM) \ |
258 | 260 | ||
259 | |||
260 | |||
261 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro | 261 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro |
262 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) | 262 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) |
263 | 263 | ||
264 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro | 264 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro |
265 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) | 265 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) |
266 | 266 | ||
267 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro | 267 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro |
268 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) | 268 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) |
269 | 269 | ||
270 | 270 | ||
271 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro | 271 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro |
272 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) | 272 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) |
273 | 273 | ||
274 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro | 274 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro |
275 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) | 275 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) |
276 | 276 | ||
277 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro | 277 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro |
278 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) | 278 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) |
279 | 279 | ||
280 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro | 280 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro |
281 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) | 281 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) |
282 | 282 | ||
283 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro | 283 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro |
284 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) | 284 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) |
285 | 285 | ||
286 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro | 286 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro |
287 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) | 287 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) |
288 | 288 | ||
289 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro | 289 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro |
290 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) | 290 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) |
291 | 291 | ||
292 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro | 292 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro |
293 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) | 293 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) |
294 | 294 | ||
295 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro | 295 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro |
296 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) | 296 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) |
297 | 297 | ||
298 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro | 298 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro |
299 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) | 299 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) |
300 | 300 | ||
301 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro | 301 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro |
302 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) | 302 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) |
303 | 303 | ||
304 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro | 304 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro |
305 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) | 305 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) |
306 | 306 | ||
307 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro | 307 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro |
308 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) | 308 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) |
309 | 309 | ||
310 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro | 310 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro |
311 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) | 311 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) |
312 | 312 | ||
313 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro | 313 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro |
314 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) | 314 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) |
315 | 315 | ||
316 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro | 316 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro |
317 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) | 317 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) |
318 | 318 | ||
319 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro | 319 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro |
320 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) | 320 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) |
321 | 321 | ||
322 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro | 322 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro |
323 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) | 323 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) |
324 | 324 | ||
325 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro | 325 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro |
326 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) | 326 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) |
327 | 327 | ||
328 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro | 328 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro |
329 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) | 329 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) |
330 | |||
diff --git a/Makefile.Embedded b/Makefile.Embedded index 2e1651c..0b8997e 100644 --- a/Makefile.Embedded +++ b/Makefile.Embedded | |||
@@ -1,330 +1,330 @@ | |||
1 | export KDEPIMDIR = $(shell pwd) | 1 | export KDEPIMDIR = $(shell pwd) |
2 | 2 | ||
3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) | 3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) |
4 | 4 | ||
5 | ifeq ($(PLATFORM) , zaurus) | 5 | ifeq ($(PLATFORM) , zaurus) |
6 | BUILD_NO_LDAP_PLUGIN=1 | 6 | BUILD_NO_LDAP_PLUGIN=1 |
7 | endif | 7 | endif |
8 | 8 | ||
9 | ifneq ($(PLATFORM) , zaurus) | 9 | ifneq ($(PLATFORM) , zaurus) |
10 | BUILD_NO_SHARP_PLUGIN=1 | 10 | BUILD_NO_SHARP_PLUGIN=1 |
11 | endif | 11 | endif |
12 | 12 | ||
13 | SUBDIRS_MICROKDE = \ | 13 | SUBDIRS_MICROKDE = \ |
14 | libical/src/libical \ | 14 | libical/src/libical \ |
15 | libical/src/libicalss \ | 15 | libical/src/libicalss \ |
16 | qtcompat \ | 16 | qtcompat \ |
17 | microkde \ | 17 | microkde \ |
18 | libkcal \ | 18 | libkcal \ |
19 | libkdepim \ | 19 | libkdepim \ |
20 | kabc \ | 20 | kabc \ |
21 | kabc/formats/binary \ | 21 | kabc/formats/binary \ |
22 | kabc/plugins/file \ | 22 | kabc/plugins/file \ |
23 | kabc/plugins/dir \ | 23 | kabc/plugins/dir \ |
24 | korganizer \ | 24 | korganizer \ |
25 | kalarmd \ | 25 | kalarmd \ |
26 | kaddressbook | 26 | kaddressbook |
27 | 27 | ||
28 | SUBDIRS_QTOPIA_PLUGIN = \ | 28 | SUBDIRS_QTOPIA_PLUGIN = \ |
29 | kabc/plugins/qtopia | 29 | kabc/plugins/qtopia |
30 | 30 | ||
31 | SUBDIRS_OPIE_PLUGIN = \ | 31 | SUBDIRS_OPIE_PLUGIN = \ |
32 | kabc/plugins/opie | 32 | kabc/plugins/opie |
33 | 33 | ||
34 | SUBDIRS_SHARP_PLUGIN = \ | 34 | SUBDIRS_SHARP_PLUGIN = \ |
35 | kabc/plugins/sharpdtm | 35 | kabc/plugins/sharpdtm |
36 | 36 | ||
37 | SUBDIRS_LDAP_PLUGIN = \ | 37 | SUBDIRS_LDAP_PLUGIN = \ |
38 | kabc/plugins/ldap | 38 | kabc/plugins/ldap |
39 | 39 | ||
40 | SUBDIRS_MICROMAIL = \ | 40 | SUBDIRS_MICROMAIL = \ |
41 | kmicromail/libetpan \ | 41 | kmicromail/libetpan \ |
42 | kmicromail/libmailwrapper \ | 42 | kmicromail/libmailwrapper \ |
43 | kmicromail | 43 | kmicromail |
44 | 44 | ||
45 | SUBDIRS_GAMMU = \ | 45 | SUBDIRS_GAMMU = \ |
46 | gammu/emb/common \ | 46 | gammu/emb/common \ |
47 | gammu/emb/gammu | 47 | gammu/emb/gammu |
48 | 48 | ||
49 | SUBDIRS_PWMANAGER = \ | 49 | SUBDIRS_PWMANAGER = \ |
50 | pwmanager/pwmanager | 50 | pwmanager/pwmanager |
51 | 51 | ||
52 | SUBDIRS = \ | 52 | SUBDIRS = \ |
53 | $(SUBDIRS_MICROKDE) \ | 53 | $(SUBDIRS_MICROKDE) \ |
54 | $(SUBDIRS_QTOPIA_PLUGIN) \ | 54 | $(SUBDIRS_QTOPIA_PLUGIN) \ |
55 | $(SUBDIRS_OPIE_PLUGIN) \ | 55 | $(SUBDIRS_OPIE_PLUGIN) \ |
56 | $(SUBDIRS_SHARP_PLUGIN) \ | 56 | $(SUBDIRS_SHARP_PLUGIN) \ |
57 | $(SUBDIRS_LDAP_PLUGIN) \ | 57 | $(SUBDIRS_LDAP_PLUGIN) \ |
58 | $(SUBDIRS_MICROMAIL) \ | 58 | $(SUBDIRS_MICROMAIL) \ |
59 | $(SUBDIRS_GAMMU) \ | 59 | $(SUBDIRS_GAMMU) \ |
60 | $(SUBDIRS_PWMANAGER) | 60 | $(SUBDIRS_PWMANAGER) |
61 | 61 | ||
62 | 62 | ||
63 | all: build_microkde \ | 63 | all: build_microkde \ |
64 | build_qtopia_plugin \ | 64 | build_qtopia_plugin \ |
65 | build_opie_plugin \ | 65 | build_opie_plugin \ |
66 | build_sharp_plugin \ | 66 | build_sharp_plugin \ |
67 | build_ldap_plugin \ | 67 | build_ldap_plugin \ |
68 | build_micromail \ | 68 | build_micromail \ |
69 | build_gammu \ | 69 | build_gammu \ |
70 | build_pwmanager | 70 | build_pwmanager |
71 | 71 | ||
72 | 72 | ||
73 | build_microkde: variable_test tmake | 73 | build_microkde: variable_test tmake |
74 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ | 74 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ |
75 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 75 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
76 | done | 76 | done |
77 | 77 | ||
78 | build_qtopia_plugin: build_microkde | 78 | build_qtopia_plugin: build_microkde |
79 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ | 79 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ |
80 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 80 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
81 | done | 81 | done |
82 | 82 | ||
83 | build_opie_plugin: build_microkde | 83 | build_opie_plugin: build_microkde |
84 | ifdef BUILD_NO_OPIE_PLUGIN | 84 | ifdef BUILD_NO_OPIE_PLUGIN |
85 | @echo == opie plugin not build. | 85 | @echo == opie plugin not build. |
86 | else | 86 | else |
87 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ | 87 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ |
88 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 88 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
89 | done | 89 | done |
90 | endif | 90 | endif |
91 | 91 | ||
92 | build_sharp_plugin: build_microkde | 92 | build_sharp_plugin: build_microkde |
93 | ifdef BUILD_NO_SHARP_PLUGIN | 93 | ifdef BUILD_NO_SHARP_PLUGIN |
94 | @echo == ldap plugin not build. | 94 | @echo == ldap plugin not build. |
95 | else | 95 | else |
96 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ | 96 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ |
97 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 97 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
98 | done | 98 | done |
99 | endif | 99 | endif |
100 | 100 | ||
101 | build_ldap_plugin: build_microkde | 101 | build_ldap_plugin: build_microkde |
102 | ifdef BUILD_NO_LDAP_PLUGIN | 102 | ifdef BUILD_NO_LDAP_PLUGIN |
103 | @echo == ldap plugin not build. | 103 | @echo == ldap plugin not build. |
104 | else | 104 | else |
105 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ | 105 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ |
106 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 106 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
107 | done | 107 | done |
108 | endif | 108 | endif |
109 | 109 | ||
110 | 110 | ||
111 | build_micromail: build_microkde | 111 | build_micromail: build_microkde |
112 | ifdef BUILD_NO_MICROMAIL | 112 | ifdef BUILD_NO_MICROMAIL |
113 | @echo == kmicromail not build. | 113 | @echo == kmicromail not build. |
114 | else | 114 | else |
115 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ | 115 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ |
116 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 116 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
117 | done | 117 | done |
118 | endif | 118 | endif |
119 | 119 | ||
120 | build_gammu: variable_test tmake | 120 | build_gammu: variable_test tmake |
121 | ifdef BUILD_NO_GAMMU | 121 | ifdef BUILD_NO_GAMMU |
122 | @echo == gammu not build. | 122 | @echo == gammu not build. |
123 | else | 123 | else |
124 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ | 124 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ |
125 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 125 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
126 | done | 126 | done |
127 | endif | 127 | endif |
128 | 128 | ||
129 | build_pwmanager: build_microkde | 129 | build_pwmanager: build_microkde |
130 | ifdef BUILD_NO_PWMANAGER | 130 | ifdef BUILD_NO_PWMANAGER |
131 | @echo == pwmanager not build. | 131 | @echo == pwmanager not build. |
132 | else | 132 | else |
133 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ | 133 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ |
134 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 134 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
135 | done | 135 | done |
136 | endif | 136 | endif |
137 | 137 | ||
138 | 138 | ||
139 | variable_info: | 139 | variable_info: |
140 | @echo -------------------------------------- | 140 | @echo -------------------------------------- |
141 | @echo KDEPIM buildsystem, variableinfo... | 141 | @echo KDEPIM buildsystem, variableinfo... |
142 | @echo KDEPIMDIR=$(KDEPIMDIR) | 142 | @echo KDEPIMDIR=$(KDEPIMDIR) |
143 | @echo QTDIR=$(QTDIR) | 143 | @echo QTDIR=$(QTDIR) |
144 | @echo QPEDIR=$(QPEDIR) | 144 | @echo QPEDIR=$(QPEDIR) |
145 | @echo OPIEDIR=$(OPIEDIR) | 145 | @echo OPIEDIR=$(OPIEDIR) |
146 | @echo PLATFORM=$(PLATFORM) | 146 | @echo PLATFORM=$(PLATFORM) |
147 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) | 147 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) |
148 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) | 148 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) |
149 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) | 149 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) |
150 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) | 150 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) |
151 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) | 151 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) |
152 | ifndef BUILD_NO_SHARP_PLUGIN | 152 | ifndef BUILD_NO_SHARP_PLUGIN |
153 | @echo SHARPDTMSDK=$(SHARPDTMSDK) | 153 | @echo SHARPDTMSDK=$(SHARPDTMSDK) |
154 | endif | 154 | endif |
155 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) | 155 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) |
156 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) | 156 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) |
157 | @echo -------------------------------------- | 157 | @echo -------------------------------------- |
158 | 158 | ||
159 | variable_test: variable_info | 159 | variable_test: variable_info |
160 | @echo KDEPIM buildsystem, variablecheck... | 160 | @echo KDEPIM buildsystem, variablecheck... |
161 | ifndef KDEPIMDIR | 161 | ifndef KDEPIMDIR |
162 | @echo KDEPIMDIR is not defined. | 162 | @echo KDEPIMDIR is not defined. |
163 | $(error KDEPIMDIR is not defined) | 163 | $(error KDEPIMDIR is not defined) |
164 | endif | 164 | endif |
165 | ifndef PLATFORM | 165 | ifndef PLATFORM |
166 | @echo PLATFORM is not defined. | 166 | @echo PLATFORM is not defined. |
167 | $(error PLATFORM is not defined) | 167 | $(error PLATFORM is not defined) |
168 | endif | 168 | endif |
169 | ifdef BUILD_NO_LDAP_PLUGIN | 169 | ifdef BUILD_NO_LDAP_PLUGIN |
170 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) | 170 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) |
171 | endif | 171 | endif |
172 | ifdef BUILD_NO_OPIE_PLUGIN | 172 | ifdef BUILD_NO_OPIE_PLUGIN |
173 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) | 173 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) |
174 | endif | 174 | endif |
175 | ifdef BUILD_NO_MICROMAIL | 175 | ifdef BUILD_NO_MICROMAIL |
176 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) | 176 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) |
177 | endif | 177 | endif |
178 | ifdef BUILD_NO_SHARP_PLUGIN | 178 | ifdef BUILD_NO_SHARP_PLUGIN |
179 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) | 179 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) |
180 | else | 180 | else |
181 | ifndef SHARPDTMSDK | 181 | ifndef SHARPDTMSDK |
182 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) | 182 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) |
183 | $(error SHARPDTMSDK is not defined) | 183 | $(error SHARPDTMSDK is not defined) |
184 | endif | 184 | endif |
185 | endif | 185 | endif |
186 | ifdef BUILD_NO_GAMMU | 186 | ifdef BUILD_NO_GAMMU |
187 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) | 187 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) |
188 | endif | 188 | endif |
189 | ifdef BUILD_NO_PWMANAGER | 189 | ifdef BUILD_NO_PWMANAGER |
190 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) | 190 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) |
191 | endif | 191 | endif |
192 | @echo -------------------------------------- | 192 | @echo -------------------------------------- |
193 | 193 | ||
194 | 194 | ||
195 | objects: | 195 | objects: |
196 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done | 196 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done |
197 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done | 197 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done |
198 | mkdir -p libical/lib/$(PLATFORM) | 198 | mkdir -p libical/lib/$(PLATFORM) |
199 | 199 | ||
200 | clean: | 200 | clean: |
201 | rm -rf libical/lib/$(PLATFORM)/*; | 201 | rm -rf libical/lib/$(PLATFORM)/*; |
202 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ | 202 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ |
203 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ | 203 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ |
204 | done | 204 | done |
205 | 205 | ||
206 | install: | 206 | install: |
207 | 207 | ||
208 | cd bin/kdepim; make install | 208 | cd bin/kdepim; make install |
209 | cp -r Pim $(QPEDIR)/apps | 209 | cp -r Pim $(QPEDIR)/apps |
210 | cp db2file/db2file $(QPEDIR)/bin/db2file | 210 | cp db2file/db2file $(QPEDIR)/bin/db2file |
211 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop | 211 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop |
212 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop | 212 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop |
213 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop | 213 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop |
214 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop | 214 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop |
215 | 215 | ||
216 | dist: | 216 | dist: |
217 | @echo Dont forget to do "make install" before "make dist" | 217 | @echo Dont forget to do "make install" before "make dist" |
218 | rm -f *arm.ipk | 218 | rm -f *arm.ipk |
219 | rm -f *~ | 219 | rm -f *~ |
220 | cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim | 220 | cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim |
221 | ./mkipks kmicrokdelibs.control | 221 | ./mkipks kmicrokdelibs.control |
222 | ./mkipks korganizer.control | 222 | ./mkipks korganizer.control |
223 | ./mkipks kaddressbook.control | 223 | ./mkipks kaddressbook.control |
224 | ifndef BUILD_NO_MICROMAIL | 224 | ifndef BUILD_NO_MICROMAIL |
225 | ./mkipks kopiemail.control | 225 | ./mkipks kopiemail.control |
226 | endif | 226 | endif |
227 | ./mkipks korganizer-alarm.control | 227 | ./mkipks korganizer-alarm.control |
228 | ifndef BUILD_NO_GAMMU | 228 | ifndef BUILD_NO_GAMMU |
229 | ./mkipks kammu.control | 229 | ./mkipks phoneaccess.control |
230 | endif | 230 | endif |
231 | ifndef BUILD_NO_PWMANAGER | 231 | ifndef BUILD_NO_PWMANAGER |
232 | ./mkipks pwmanager.control | 232 | ./mkipks pwmanager.control |
233 | endif | 233 | endif |
234 | ./mkipks pim_TAB_icon.control | 234 | ./mkipks pim_TAB_icon.control |
235 | 235 | ||
236 | tmake: objects \ | 236 | tmake: objects \ |
237 | qtcompat/Makefile$(PLATFORM) \ | 237 | qtcompat/Makefile$(PLATFORM) \ |
238 | microkde/Makefile$(PLATFORM) \ | 238 | microkde/Makefile$(PLATFORM) \ |
239 | libkcal/Makefile$(PLATFORM) \ | 239 | libkcal/Makefile$(PLATFORM) \ |
240 | libkdepim/Makefile$(PLATFORM) \ | 240 | libkdepim/Makefile$(PLATFORM) \ |
241 | korganizer/Makefile$(PLATFORM) \ | 241 | korganizer/Makefile$(PLATFORM) \ |
242 | kalarmd/Makefile$(PLATFORM) \ | 242 | kalarmd/Makefile$(PLATFORM) \ |
243 | libical/src/libical/Makefile$(PLATFORM) \ | 243 | libical/src/libical/Makefile$(PLATFORM) \ |
244 | libical/src/libicalss/Makefile$(PLATFORM) \ | 244 | libical/src/libicalss/Makefile$(PLATFORM) \ |
245 | kabc/Makefile$(PLATFORM) \ | 245 | kabc/Makefile$(PLATFORM) \ |
246 | kabc/formats/binary/Makefile$(PLATFORM) \ | 246 | kabc/formats/binary/Makefile$(PLATFORM) \ |
247 | kabc/plugins/file/Makefile$(PLATFORM) \ | 247 | kabc/plugins/file/Makefile$(PLATFORM) \ |
248 | kabc/plugins/dir/Makefile$(PLATFORM) \ | 248 | kabc/plugins/dir/Makefile$(PLATFORM) \ |
249 | kabc/plugins/ldap/Makefile$(PLATFORM) \ | 249 | kabc/plugins/ldap/Makefile$(PLATFORM) \ |
250 | kabc/plugins/opie/Makefile$(PLATFORM) \ | 250 | kabc/plugins/opie/Makefile$(PLATFORM) \ |
251 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ | 251 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ |
252 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ | 252 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ |
253 | kaddressbook/Makefile$(PLATFORM) \ | 253 | kaddressbook/Makefile$(PLATFORM) \ |
254 | kmicromail/Makefile$(PLATFORM) \ | 254 | kmicromail/Makefile$(PLATFORM) \ |
255 | kmicromail/libetpan/Makefile$(PLATFORM) \ | 255 | kmicromail/libetpan/Makefile$(PLATFORM) \ |
256 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ | 256 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ |
257 | gammu/emb/common/Makefile$(PLATFORM) \ | 257 | gammu/emb/common/Makefile$(PLATFORM) \ |
258 | gammu/emb/gammu/Makefile$(PLATFORM) \ | 258 | gammu/emb/gammu/Makefile$(PLATFORM) \ |
259 | pwmanager/pwmanager/Makefile$(PLATFORM) \ | 259 | pwmanager/pwmanager/Makefile$(PLATFORM) \ |
260 | 260 | ||
261 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro | 261 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro |
262 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) | 262 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) |
263 | 263 | ||
264 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro | 264 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro |
265 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) | 265 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) |
266 | 266 | ||
267 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro | 267 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro |
268 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) | 268 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) |
269 | 269 | ||
270 | 270 | ||
271 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro | 271 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro |
272 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) | 272 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) |
273 | 273 | ||
274 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro | 274 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro |
275 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) | 275 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) |
276 | 276 | ||
277 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro | 277 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro |
278 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) | 278 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) |
279 | 279 | ||
280 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro | 280 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro |
281 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) | 281 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) |
282 | 282 | ||
283 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro | 283 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro |
284 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) | 284 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) |
285 | 285 | ||
286 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro | 286 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro |
287 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) | 287 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) |
288 | 288 | ||
289 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro | 289 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro |
290 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) | 290 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) |
291 | 291 | ||
292 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro | 292 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro |
293 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) | 293 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) |
294 | 294 | ||
295 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro | 295 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro |
296 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) | 296 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) |
297 | 297 | ||
298 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro | 298 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro |
299 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) | 299 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) |
300 | 300 | ||
301 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro | 301 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro |
302 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) | 302 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) |
303 | 303 | ||
304 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro | 304 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro |
305 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) | 305 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) |
306 | 306 | ||
307 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro | 307 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro |
308 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) | 308 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) |
309 | 309 | ||
310 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro | 310 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro |
311 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) | 311 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) |
312 | 312 | ||
313 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro | 313 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro |
314 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) | 314 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) |
315 | 315 | ||
316 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro | 316 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro |
317 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) | 317 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) |
318 | 318 | ||
319 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro | 319 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro |
320 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) | 320 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) |
321 | 321 | ||
322 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro | 322 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro |
323 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) | 323 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) |
324 | 324 | ||
325 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro | 325 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro |
326 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) | 326 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) |
327 | 327 | ||
328 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro | 328 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro |
329 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) | 329 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) |
330 | 330 | ||
diff --git a/bin/kdepim/korganizer/howtoSYNC.txt b/bin/kdepim/korganizer/howtoSYNC.txt index c4e80f5..3cab446 100644 --- a/bin/kdepim/korganizer/howtoSYNC.txt +++ b/bin/kdepim/korganizer/howtoSYNC.txt | |||
@@ -1,483 +1,483 @@ | |||
1 | WARNING: | 1 | WARNING: |
2 | YOU MAY GET UNEXSPECTED (I.E. WRONG) SYNCHRONIZATION RESULTS, | 2 | YOU MAY GET UNEXSPECTED (I.E. WRONG) SYNCHRONIZATION RESULTS, |
3 | IF YOU CHANGE AN EVENT ON THE FIRST DEVICE AND SYNC IMMEDIATELY FROM | 3 | IF YOU CHANGE AN EVENT ON THE FIRST DEVICE AND SYNC IMMEDIATELY FROM |
4 | THE OTHER DEVICE WITH THIS DEVICE, IF THE CLOCKS OF THE TWO DEVICES | 4 | THE OTHER DEVICE WITH THIS DEVICE, IF THE CLOCKS OF THE TWO DEVICES |
5 | HAVE TOO MUCH DIFFERENCE. | 5 | HAVE TOO MUCH DIFFERENCE. |
6 | 6 | ||
7 | In other words: Please make shure, that the clocks of the devices | 7 | In other words: Please make shure, that the clocks of the devices |
8 | you want to sync have only a difference of some seconds! | 8 | you want to sync have only a difference of some seconds! |
9 | 9 | ||
10 | 10 | ||
11 | CONTENT: | 11 | CONTENT: |
12 | 12 | ||
13 | 0) How syncing works | 13 | 0) How syncing works |
14 | 1) Qick overview of settings | 14 | 1) Qick overview of settings |
15 | 2) Sync settings in sync dialog | 15 | 2) Sync settings in sync dialog |
16 | 3) Syncing background | 16 | 3) Syncing background |
17 | 4) Sync preferences | 17 | 4) Sync preferences |
18 | 5) Details about sync profile kinds | 18 | 5) Details about sync profile kinds |
19 | 19 | ||
20 | ************************************************************************* | 20 | ************************************************************************* |
21 | 0) How syncing works | 21 | 0) How syncing works |
22 | ************************************************************************* | 22 | ************************************************************************* |
23 | 23 | ||
24 | Note: | 24 | Note: |
25 | The recommended and easiest way to syncronize two devices where | 25 | The recommended and easiest way to syncronize two devices where |
26 | KO/Pi or KA/Pi is installed, is the profile kind "Pi-Sync". | 26 | KO/Pi or KA/Pi is installed, is the profile kind "Pi-Sync". |
27 | Details about that in 5) b). | 27 | Details about that in 5) b). |
28 | 28 | ||
29 | In KDE-Pim/Pi you can synchronize ( sync ) your calendar/addressbook | 29 | In KDE-Pim/Pi you can synchronize ( sync ) your calendar/addressbook |
30 | with another calendar/addressbook , by syncing your | 30 | with another calendar/addressbook , by syncing your |
31 | (local) calendar/addressbook with a (remote) file. | 31 | (local) calendar/addressbook with a (remote) file. |
32 | This remote file may on your local filesystem | 32 | This remote file may on your local filesystem |
33 | or on another (remote) device. | 33 | or on another (remote) device. |
34 | 34 | ||
35 | If you want to sync with another remote device, | 35 | If you want to sync with another remote device, |
36 | you have two create a sync profile. | 36 | you have two create a sync profile. |
37 | You have two choices for choosing the profil kind: | 37 | You have two choices for choosing the profil kind: |
38 | I) You have to choose profile kind "Remote file" and to specify a | 38 | I) You have to choose profile kind "Remote file" and to specify a |
39 | command line download/upload command ( like scp, ftp, ...) to | 39 | command line download/upload command ( like scp, ftp, ...) to |
40 | a) download the remote file to your local machine to a temp file | 40 | a) download the remote file to your local machine to a temp file |
41 | b) sync with this temp file | 41 | b) sync with this temp file |
42 | c) upload the synced file to the remote device | 42 | c) upload the synced file to the remote device |
43 | II) If you want to sync with a device, where KO/Pi( or KA/Pi ) is | 43 | II) If you want to sync with a device, where KO/Pi( or KA/Pi ) is |
44 | installed, you can easily get the remote file via network | 44 | installed, you can easily get the remote file via network |
45 | with the build in file transfer feature: | 45 | with the build in file transfer feature: |
46 | Choose profile kind "Pi-Sync" and | 46 | Choose profile kind "Pi-Sync" and |
47 | a) Start KO/Pi or KA/Pi on remote device and | 47 | a) Start KO/Pi or KA/Pi on remote device and |
48 | enable "Pi-Sync" on remote device with password and port. | 48 | enable "Pi-Sync" on remote device with password and port. |
49 | b) Specify password, port and IP address in your profile. | 49 | b) Specify password, port and IP address in your profile. |
50 | 50 | ||
51 | 51 | ||
52 | You can sync with your mobile phone as well. | 52 | You can sync with your mobile phone as well. |
53 | Everything is explained in more details below. | 53 | Everything is explained in more details below. |
54 | 54 | ||
55 | NOTE: | 55 | NOTE: |
56 | If you do not use profile kind "Pi-Sync", | 56 | If you do not use profile kind "Pi-Sync", |
57 | it is recommended to close | 57 | it is recommended to close |
58 | a running KO/Pi ( or KA/Pi) on the remote device. | 58 | a running KO/Pi ( or KA/Pi) on the remote device. |
59 | (Note: KO/Pi( or KA/Pi) running on Zaurus with | 59 | (Note: KO/Pi( or KA/Pi) running on Zaurus with |
60 | FastLoad enabled will never be closed!) | 60 | FastLoad enabled will never be closed!) |
61 | After syncing with a running KO/Pi on the remote device, | 61 | After syncing with a running KO/Pi on the remote device, |
62 | a "save" on the remote device will tell you that it needs to merge (sync). | 62 | a "save" on the remote device will tell you that it needs to merge (sync). |
63 | After merging (just a syncing with the changed file) | 63 | After merging (just a syncing with the changed file) |
64 | you will get the new data showing in remote KO/Pi. | 64 | you will get the new data showing in remote KO/Pi. |
65 | 65 | ||
66 | ************************************************************************* | 66 | ************************************************************************* |
67 | 1) Qick overview of settings | 67 | 1) Qick overview of settings |
68 | ************************************************************************* | 68 | ************************************************************************* |
69 | 69 | ||
70 | a) Open sync settings dialog (Menu Synchronize - Configure...) | 70 | a) Open sync settings dialog (Menu Synchronize - Configure...) |
71 | b) Give your device a unique name. | 71 | b) Give your device a unique name. |
72 | (unique in the set of all devices you want to sync with). | 72 | (unique in the set of all devices you want to sync with). |
73 | If you have already configured another devive and created | 73 | If you have already configured another devive and created |
74 | there a sync profile to sync with this device, give your device | 74 | there a sync profile to sync with this device, give your device |
75 | the same name as this sync profile! The same name is important, | 75 | the same name as this sync profile! The same name is important, |
76 | because it makes it possible to sync first A->B | 76 | because it makes it possible to sync first A->B |
77 | (A local device, that performs the sync, B remote device) | 77 | (A local device, that performs the sync, B remote device) |
78 | and then B->A. Such that the B->A sync knows about the | 78 | and then B->A. Such that the B->A sync knows about the |
79 | already performed A->B sync. | 79 | already performed A->B sync. |
80 | That means: It is unimportant if you sync A->B or B->A, | 80 | That means: It is unimportant if you sync A->B or B->A, |
81 | the devices A and B will be synced properly. | 81 | the devices A and B will be synced properly. |
82 | c) Create a new sync profile and give it a unique name. | 82 | c) Create a new sync profile and give it a unique name. |
83 | (unique in the set of all sync profiles on this device). | 83 | (unique in the set of all sync profiles on this device). |
84 | If you want to sync with a device, where KO/Pi is already installed | 84 | If you want to sync with a device, where KO/Pi is already installed |
85 | and which has a given unique device name, use this device name as | 85 | and which has a given unique device name, use this device name as |
86 | your profile name ( refer to b) ). | 86 | your profile name ( refer to b) ). |
87 | d) Coose the profile kind of your syncing method: | 87 | d) Coose the profile kind of your syncing method: |
88 | (i) Local file or | 88 | (i) Local file or |
89 | (ii) Pi-Sync or | 89 | (ii) Pi-Sync or |
90 | (iii) Remote file or | 90 | (iii) Remote file or |
91 | (iiii) Mobile Phone. | 91 | (iiii) Mobile Phone. |
92 | Detailed explanation in 5) | 92 | Detailed explanation in 5) |
93 | e) Choose the other profile options. | 93 | e) Choose the other profile options. |
94 | Detailed explanation in 2) | 94 | Detailed explanation in 2) |
95 | f) Close sync dialog with OK. | 95 | f) Close sync dialog with OK. |
96 | g) Sync. | 96 | g) Sync. |
97 | 97 | ||
98 | NOTE: | 98 | NOTE: |
99 | AFTER SYNCING THERE ARE "SYNC EVENTS" CREATED | 99 | AFTER SYNCING THERE ARE "SYNC EVENTS" CREATED |
100 | (OR UPDATED, IF IT ALREADY EXITS) FOR EACH SYNC PROFILE. | 100 | (OR UPDATED, IF IT ALREADY EXITS) FOR EACH SYNC PROFILE. |
101 | YOU MAY NOT DELETE OR CHANGE THESE EVENTS. | 101 | YOU MAY NOT DELETE OR CHANGE THESE EVENTS. |
102 | 102 | ||
103 | ************************************************************************* | 103 | ************************************************************************* |
104 | 2) Sync settings in sync dialog | 104 | 2) Sync settings in sync dialog |
105 | ************************************************************************* | 105 | ************************************************************************* |
106 | 106 | ||
107 | a) Local device name: | 107 | a) Local device name: |
108 | -> 1) b) | 108 | -> 1) b) |
109 | b) Profile: | 109 | b) Profile: |
110 | -> 1) c) | 110 | -> 1) c) |
111 | c) Include in multiple sync: | 111 | c) Include in multiple sync: |
112 | In the Synchronize menu, there is a multiple sync menu entry. | 112 | In the Synchronize menu, there is a multiple sync menu entry. |
113 | If you choose this menu entry, all user defined profiles with this | 113 | If you choose this menu entry, all user defined profiles with this |
114 | 'Include in multiple sync' option enabled will be synced | 114 | 'Include in multiple sync' option enabled will be synced |
115 | one after another. And this twice. This will take some time. | 115 | one after another. And this twice. This will take some time. |
116 | After that sync, on all devices should be the same data. | 116 | After that sync, on all devices should be the same data. |
117 | d) Ask for preferences before sync: | 117 | d) Ask for preferences before sync: |
118 | Check this to be asked for sync preferences settings before each sync. | 118 | Check this to be asked for sync preferences settings before each sync. |
119 | If the profile kind is "Pi-Sync" you will be asked to confirm | 119 | If the profile kind is "Pi-Sync" you will be asked to confirm |
120 | the "Pi-Sync" specific settings (Password,IP address, port number) | 120 | the "Pi-Sync" specific settings (Password,IP address, port number) |
121 | as well. That makes it possible to use that profile for a | 121 | as well. That makes it possible to use that profile for a |
122 | device that is connected via DHCP to the network and gets different | 122 | device that is connected via DHCP to the network and gets different |
123 | IP addresses when connection to the network. | 123 | IP addresses when connection to the network. |
124 | e) Sync preferences: | 124 | e) Sync preferences: |
125 | Choose here your sync preferences. | 125 | Choose here your sync preferences. |
126 | Details -> 4) | 126 | Details -> 4) |
127 | f) Show summary after sync: | 127 | f) Show summary after sync: |
128 | Check this to get a small summary dialog after sync | 128 | Check this to get a small summary dialog after sync |
129 | about number of added/changed/deleted events on local/remote. | 129 | about number of added/changed/deleted events on local/remote. |
130 | g) Write back synced data: | 130 | g) Write back synced data: |
131 | Uncheck this to update the local calendar only. | 131 | Uncheck this to update the local calendar only. |
132 | I.e. your local calendar is synced with the remote calendar | 132 | I.e. your local calendar is synced with the remote calendar |
133 | but nothing on the remote calendar is changed. | 133 | but nothing on the remote calendar is changed. |
134 | If you uncheck "Write back synced data", the settings | 134 | If you uncheck "Write back synced data", the settings |
135 | under h) and i) are ignored, of course. | 135 | under h) and i) are ignored, of course. |
136 | h) --Write back (on remote) existing entries only: | 136 | h) --Write back (on remote) existing entries only: |
137 | Check this to update the remote data only. | 137 | Check this to update the remote data only. |
138 | I.e. no data from yor local calendar/addressbook is added to the | 138 | I.e. no data from yor local calendar/addressbook is added to the |
139 | remote device. You may use this option to | 139 | remote device. You may use this option to |
140 | sync against some kind of "public calendar/addressbook" without | 140 | sync against some kind of "public calendar/addressbook" without |
141 | writing back your personal data. | 141 | writing back your personal data. |
142 | i) --Write back (calendar) entries in future only: | 142 | i) --Write back (calendar) entries in future only: |
143 | Check this to write back only calendar entries in future. | 143 | Check this to write back only calendar entries in future. |
144 | (Useful when syncing with mobile phones.) | 144 | (Useful when syncing with mobile phones.) |
145 | You can specify the date range in weeks with | 145 | You can specify the date range in weeks with |
146 | ---- Max. weeks in future. | 146 | ---- Max. weeks in future. |
147 | Note: The date range starts always 7 days before the actual date! | 147 | Note: The date range starts always 7 days before the actual date! |
148 | I.e. the calendar events of the last week are written back always. | 148 | I.e. the calendar events of the last week are written back always. |
149 | j) Profile kind: | 149 | j) Profile kind: |
150 | Details -> 5) | 150 | Details -> 5) |
151 | 151 | ||
152 | ************************************************************************* | 152 | ************************************************************************* |
153 | 3) Syncing background | 153 | 3) Syncing background |
154 | ************************************************************************* | 154 | ************************************************************************* |
155 | 155 | ||
156 | The same mentioned for calendars is valid for addressbooks as well. | 156 | The same mentioned for calendars is valid for addressbooks as well. |
157 | 157 | ||
158 | Synchronizing calendars ( i.e. files ) means, | 158 | Synchronizing calendars ( i.e. files ) means, |
159 | to merge two calendars in a useful way. | 159 | to merge two calendars in a useful way. |
160 | If the two calendars are completely different, | 160 | If the two calendars are completely different, |
161 | there is no problem, the resulting calendar contains | 161 | there is no problem, the resulting calendar contains |
162 | all data from the local and from the remote calendar. | 162 | all data from the local and from the remote calendar. |
163 | 163 | ||
164 | Problems will occur, if you have edited items | 164 | Problems will occur, if you have edited items |
165 | from the local calendar on the remote machine. | 165 | from the local calendar on the remote machine. |
166 | Then it could be, that items are in conflict. | 166 | Then it could be, that items are in conflict. |
167 | Two items are "in conflict", if they have the | 167 | Two items are "in conflict", if they have the |
168 | same unique ID (which get an item at time of | 168 | same unique ID (which get an item at time of |
169 | creation and owns it until it is deleted ) | 169 | creation and owns it until it is deleted ) |
170 | and they both are modified after the last | 170 | and they both are modified after the last |
171 | synchronization. | 171 | synchronization. |
172 | 172 | ||
173 | At first sync of two calendars there is no item deleted. | 173 | At first sync of two calendars there is no item deleted. |
174 | If the calendars are synced before and there is an item, | 174 | If the calendars are synced before and there is an item, |
175 | which is not edited after the last sync and is only | 175 | which is not edited after the last sync and is only |
176 | available in one calendar, then this item is deleted | 176 | available in one calendar, then this item is deleted |
177 | in this calendar. | 177 | in this calendar. |
178 | 178 | ||
179 | But when was the last synchronization between two calendars? | 179 | But when was the last synchronization between two calendars? |
180 | 180 | ||
181 | To know that, KO/Pi creates at first syncing | 181 | To know that, KO/Pi creates at first syncing |
182 | of two files an unique event "<profile name> - sync Event" | 182 | of two files an unique event "<profile name> - sync Event" |
183 | on the remote and the local calendar. | 183 | on the remote and the local calendar. |
184 | After syncing, the start time of this event is set | 184 | After syncing, the start time of this event is set |
185 | to the time of syncing. | 185 | to the time of syncing. |
186 | The event is read only and the user may not change it. | 186 | The event is read only and the user may not change it. |
187 | 187 | ||
188 | If two such files are synced, that both have an event | 188 | If two such files are synced, that both have an event |
189 | "<profile name> - sync Event" and the events have | 189 | "<profile name> - sync Event" and the events have |
190 | the same start time, then deleted items on the one calendar | 190 | the same start time, then deleted items on the one calendar |
191 | are deleted on the other as well. | 191 | are deleted on the other as well. |
192 | 192 | ||
193 | 193 | ||
194 | ************************************************************************* | 194 | ************************************************************************* |
195 | 4) Sync preferences | 195 | 4) Sync preferences |
196 | ************************************************************************* | 196 | ************************************************************************* |
197 | 197 | ||
198 | Two items are "in conflict", if they have the same unique ID | 198 | Two items are "in conflict", if they have the same unique ID |
199 | and they both are modified after the last synchronization. | 199 | and they both are modified after the last synchronization. |
200 | (Details -> 3) ). | 200 | (Details -> 3) ). |
201 | 201 | ||
202 | If an item is not modified after the last sync and | 202 | If an item is not modified after the last sync and |
203 | it is not found in the other calendar, it is deleted. | 203 | it is not found in the other calendar, it is deleted. |
204 | 204 | ||
205 | On the first sync, there is no item deleted. | 205 | On the first sync, there is no item deleted. |
206 | 206 | ||
207 | SYNC PREFERENCES: | 207 | SYNC PREFERENCES: |
208 | -Take local entry on conflict: | 208 | -Take local entry on conflict: |
209 | Takes the local entry on conflict. | 209 | Takes the local entry on conflict. |
210 | If it is the first sync, | 210 | If it is the first sync, |
211 | "Ask for every entry" | 211 | "Ask for every entry" |
212 | is chosen automatically, | 212 | is chosen automatically, |
213 | if this is selected. | 213 | if this is selected. |
214 | 214 | ||
215 | -Take remote entry on conflict: | 215 | -Take remote entry on conflict: |
216 | Takes the remote entry on conflict. | 216 | Takes the remote entry on conflict. |
217 | If it is the first sync, | 217 | If it is the first sync, |
218 | "Ask for every entry" | 218 | "Ask for every entry" |
219 | is chosen automatically, | 219 | is chosen automatically, |
220 | if this is selected. | 220 | if this is selected. |
221 | 221 | ||
222 | -Take newest entry on conflict: | 222 | -Take newest entry on conflict: |
223 | This takes the newest entry on conflict. | 223 | This takes the newest entry on conflict. |
224 | May be the most useful syncing mode. | 224 | May be the most useful syncing mode. |
225 | 225 | ||
226 | -Ask for every entry on conflict: | 226 | -Ask for every entry on conflict: |
227 | Pops up an event viewer dialog and | 227 | Pops up an event viewer dialog and |
228 | shows the two conflicting entries there. | 228 | shows the two conflicting entries there. |
229 | The user can chose, which entry he would like to take. | 229 | The user can chose, which entry he would like to take. |
230 | The button for the newest entry | 230 | The button for the newest entry |
231 | is automatically set as default button. | 231 | is automatically set as default button. |
232 | The color for the newest entry is green. | 232 | The color for the newest entry is green. |
233 | 233 | ||
234 | -Force: Take local entry always: | 234 | -Force: Take local entry always: |
235 | Even if the calendars are already synced | 235 | Even if the calendars are already synced |
236 | there is no item deleted on local. | 236 | there is no item deleted on local. |
237 | 237 | ||
238 | -Force: Take remote entry always: | 238 | -Force: Take remote entry always: |
239 | Analogous to | 239 | Analogous to |
240 | "Force: Take local entry always" | 240 | "Force: Take local entry always" |
241 | 241 | ||
242 | ************************************************************************* | 242 | ************************************************************************* |
243 | 5) Details about sync profile kinds | 243 | 5) Details about sync profile kinds |
244 | ************************************************************************* | 244 | ************************************************************************* |
245 | 245 | ||
246 | a) Local file | 246 | a) Local file |
247 | Please specify a local file you want to sync with. | 247 | Please specify a local file you want to sync with. |
248 | 248 | ||
249 | b) Pi-Sync (direct Kx/Pi to Kx/Pi sync) | 249 | b) Pi-Sync (direct Kx/Pi to Kx/Pi sync) |
250 | We mention here only KO/Pi, but the same is valid for KA/Pi. | 250 | We mention here only KO/Pi, but the same is valid for KA/Pi. |
251 | If you want to sync with a device, where KO/Pi is | 251 | If you want to sync with a device, where KO/Pi is |
252 | installed, you can easily get the remote file via network | 252 | installed, you can easily get the remote file via network |
253 | with the build in file transfer feature "Pi-Sync": | 253 | with the build in file transfer feature "Pi-Sync": |
254 | You have first to enable file transfer on the remote device: | 254 | You have first to enable file transfer on the remote device: |
255 | - Start KO/Pi on the remote device. | 255 | - Start KO/Pi on the remote device. |
256 | - Choose Menu Synchronize-Enable Pi-Sync. | 256 | - Choose Menu Synchronize-Enable Pi-Sync. |
257 | - Choose a port number, where KO/Pi should listen for | 257 | - Choose a port number, where KO/Pi should listen for |
258 | file sending requests. Valid port numbers are numbers | 258 | file sending requests. Valid port numbers are numbers |
259 | between 1 and 65565. Do not specify port numbers, that are | 259 | between 1 and 65565. Do not specify port numbers, that are |
260 | used by other applications. A port number between 9000 and 9999 | 260 | used by other applications. A port number between 9000 and 9999 |
261 | is most likely not used by another application. | 261 | is most likely not used by another application. |
262 | The default port number is 9197 for KO/Pi. | 262 | The default port number is 9197 for KO/Pi. |
263 | If you specify a port number, which is already in use, | 263 | If you specify a port number, which is already in use, |
264 | you will get an error message when closing this dialog. | 264 | you will get an error message when closing this dialog. |
265 | - Choose a password. | 265 | - Choose a password. |
266 | - Click OK. | 266 | - Click OK. |
267 | Now KO/Pi will send the calendar data via the network, | 267 | Now KO/Pi will send the calendar data via the network, |
268 | if some other device is sending a "please send calendar" | 268 | if some other device is sending a "please send calendar" |
269 | request on the given port using the given password. | 269 | request on the given port using the given password. |
270 | If you want to be sure, nobody can access your calendar | 270 | If you want to be sure, nobody can access your calendar |
271 | data, simply disable the file transfer feature on the | 271 | data, simply disable the file transfer feature on the |
272 | remote device after the syncing is done by choosing: | 272 | remote device after the syncing is done by choosing: |
273 | Menu Synchronize-Disable Pi-Sync. | 273 | Menu Synchronize-Disable Pi-Sync. |
274 | 274 | ||
275 | Note: If you want to sync with a remote device that gets different | 275 | Note: If you want to sync with a remote device that gets different |
276 | IPaddresses each time connected to the network | 276 | IPaddresses each time connected to the network |
277 | (this may be the case, if you use DHCP for connection | 277 | (this may be the case, if you use DHCP for connection |
278 | of the remote device to the network) simply enable | 278 | of the remote device to the network) simply enable |
279 | "Ask for preferences before sync". | 279 | "Ask for preferences before sync". |
280 | Then you will be asked to confirm the | 280 | Then you will be asked to confirm the |
281 | "Pi-Sync" specific settings | 281 | "Pi-Sync" specific settings |
282 | (Password,IP address, port number) | 282 | (Password,IP address, port number) |
283 | and you can easily change the IP address before each sync. | 283 | and you can easily change the IP address before each sync. |
284 | 284 | ||
285 | On your local device, create a new profile and choose | 285 | On your local device, create a new profile and choose |
286 | profile kind "Pi-Sync". | 286 | profile kind "Pi-Sync". |
287 | Fill in the needed values: | 287 | Fill in the needed values: |
288 | - Password for remote access: | 288 | - Password for remote access: |
289 | The password you specified on the remote device. | 289 | The password you specified on the remote device. |
290 | - Remote IP address: | 290 | - Remote IP address: |
291 | The IP address of the remote device. | 291 | The IP address of the remote device. |
292 | - Remote port number: | 292 | - Remote port number: |
293 | The port number you specified on the remote device. | 293 | The port number you specified on the remote device. |
294 | 294 | ||
295 | Now you can syncronize your local device easily with your | 295 | Now you can syncronize your local device easily with your |
296 | remote device. This works well for all platforms KO/Pi is | 296 | remote device. This works well for all platforms KO/Pi is |
297 | running on, e.g. syncing a KO/Pi on Zaurus with KO/Pi on Windows | 297 | running on, e.g. syncing a KO/Pi on Zaurus with KO/Pi on Windows |
298 | is now very easy. | 298 | is now very easy. |
299 | 299 | ||
300 | c) Remote file | 300 | c) Remote file |
301 | Syncing with the profile kind "Remote file" is performed in three steps: | 301 | Syncing with the profile kind "Remote file" is performed in three steps: |
302 | i) download the remote file to your local machine to a temp file | 302 | i) download the remote file to your local machine to a temp file |
303 | ii) sync with this temp file | 303 | ii) sync with this temp file |
304 | iii) upload the synced file to the remote device | 304 | iii) upload the synced file to the remote device |
305 | 305 | ||
306 | The down-/uploading if i) and iii) is done via a command line command. | 306 | The down-/uploading if i) and iii) is done via a command line command. |
307 | Please specify the download/upload command ( like scp, ftp, ...) and the | 307 | Please specify the download/upload command ( like scp, ftp, ...) and the |
308 | file name of the temp file in the corresponding fields. | 308 | file name of the temp file in the corresponding fields. |
309 | 309 | ||
310 | d) Mobile device (cell phone) | 310 | d) Mobile device (cell phone) |
311 | Note: On the Zaurus you have to install the kammu_xxx_arm.ipk package | 311 | Note: On the Zaurus you have to install the phoneaccess_xxx_arm.ipk package |
312 | to be able to access mobile phones. | 312 | to be able to access mobile phones. |
313 | We mention here only KO/Pi, but the same is valid for KA/Pi. | 313 | We mention here only KO/Pi, but the same is valid for KA/Pi. |
314 | Note: | 314 | Note: |
315 | It is only possible to sync a mobile phone with one particular device | 315 | It is only possible to sync a mobile phone with one particular device |
316 | running KO/Pi. If you want to be able to write data of more than one device | 316 | running KO/Pi. If you want to be able to write data of more than one device |
317 | to the mobile phone (e.g. from your Zaurus and from your Windows Laptop) | 317 | to the mobile phone (e.g. from your Zaurus and from your Windows Laptop) |
318 | do not sync with the mobile phone at all, but use the | 318 | do not sync with the mobile phone at all, but use the |
319 | "Export to phone" functionality from the different devices. | 319 | "Export to phone" functionality from the different devices. |
320 | Using "Export to phone" makes it not possible to get back data from the | 320 | Using "Export to phone" makes it not possible to get back data from the |
321 | phone, if it was changed there, of course. | 321 | phone, if it was changed there, of course. |
322 | If you sync with the phone, do not use "Export to phone" from any device. | 322 | If you sync with the phone, do not use "Export to phone" from any device. |
323 | (And do not sync, as mentioned above, from any other device with that phone). | 323 | (And do not sync, as mentioned above, from any other device with that phone). |
324 | It would delete the needed information for syncing with that phone! | 324 | It would delete the needed information for syncing with that phone! |
325 | 325 | ||
326 | We are using Gammu (Version: 0.98.9) ( http://freshmeat.net/projects/gammu/ ) | 326 | We are using Gammu (Version: 0.98.9) ( http://freshmeat.net/projects/gammu/ ) |
327 | for accessing the phones. | 327 | for accessing the phones. |
328 | Note: You cannot use the original Gammu for syncing KDE-Pim/Pi, because | 328 | Note: You cannot use the original Gammu for syncing KDE-Pim/Pi, because |
329 | we have modified the original version to make it useable for syncing! | 329 | we have modified the original version to make it useable for syncing! |
330 | Gammu allows access to many phones in many ways (Irda, Bluetooth, serial,...). | 330 | Gammu allows access to many phones in many ways (Irda, Bluetooth, serial,...). |
331 | The recommended phone access using Gammu with KDE-Pim/Pi is Irda (infrared). | 331 | The recommended phone access using Gammu with KDE-Pim/Pi is Irda (infrared). |
332 | Bluetooth access is disabled on the Zaurus, but may work on Windows. | 332 | Bluetooth access is disabled on the Zaurus, but may work on Windows. |
333 | Please look at the Gammu homepage and documentation about more details | 333 | Please look at the Gammu homepage and documentation about more details |
334 | configuring Gammu how to access your phone. | 334 | configuring Gammu how to access your phone. |
335 | If you have problems accessing your phone, start KO/Pi from the konsole | 335 | If you have problems accessing your phone, start KO/Pi from the konsole |
336 | and you will get a more detailed output what went wrong. | 336 | and you will get a more detailed output what went wrong. |
337 | About Gammu from the Gammu homepage: | 337 | About Gammu from the Gammu homepage: |
338 | Gammu (formerly known as MyGnokii2) is a cellular | 338 | Gammu (formerly known as MyGnokii2) is a cellular |
339 | manager for various mobile phones/modems. | 339 | manager for various mobile phones/modems. |
340 | It supports the Nokia 2100, 3100, 32xx, 33xx, | 340 | It supports the Nokia 2100, 3100, 32xx, 33xx, |
341 | 3410, 35xx, 51xx, 5210, 5510, 61xx, 62xx, | 341 | 3410, 35xx, 51xx, 5210, 5510, 61xx, 62xx, |
342 | 63xx, 6510, 6610, 6800, 71xx, 7210, 7250, | 342 | 63xx, 6510, 6610, 6800, 71xx, 7210, 7250, |
343 | 7250i, 82xx, 83xx, 8910, 9110, 9210 | 343 | 7250i, 82xx, 83xx, 8910, 9110, 9210 |
344 | and compatible and AT devices (Siemens, Alcatel, | 344 | and compatible and AT devices (Siemens, Alcatel, |
345 | Falcom, WaveCom, IPAQ, Samsung, SE, and others) | 345 | Falcom, WaveCom, IPAQ, Samsung, SE, and others) |
346 | over cables/infrared/BlueTooth. | 346 | over cables/infrared/BlueTooth. |
347 | 347 | ||
348 | Here is an example what to specify to access a Nokia 6310i via infrared: | 348 | Here is an example what to specify to access a Nokia 6310i via infrared: |
349 | On Linux (Zaurus): | 349 | On Linux (Zaurus): |
350 | I/O device: /dev/ircomm | 350 | I/O device: /dev/ircomm |
351 | Connection: irda | 351 | Connection: irda |
352 | Model: <leave empty> | 352 | Model: <leave empty> |
353 | 353 | ||
354 | On Windows: | 354 | On Windows: |
355 | I/O device: <ignored - i.e. leave empty> | 355 | I/O device: <ignored - i.e. leave empty> |
356 | Connection: irda | 356 | Connection: irda |
357 | Model: <leave empty> | 357 | Model: <leave empty> |
358 | 358 | ||
359 | Here is the overview from the Gammu documentation, | 359 | Here is the overview from the Gammu documentation, |
360 | how to specify the connection settings for | 360 | how to specify the connection settings for |
361 | I/O device: | 361 | I/O device: |
362 | Connection: | 362 | Connection: |
363 | Model: | 363 | Model: |
364 | 364 | ||
365 | Note: The documentation uses the term "port", | 365 | Note: The documentation uses the term "port", |
366 | where we use the term "I/O device". | 366 | where we use the term "I/O device". |
367 | Note: You do not have to create/change the gammurc configuration file. | 367 | Note: You do not have to create/change the gammurc configuration file. |
368 | That will do KO/Pi for you. | 368 | That will do KO/Pi for you. |
369 | Note: For a known model, leave "Model:" always empty, | 369 | Note: For a known model, leave "Model:" always empty, |
370 | such that Gammu can auto detect the model. | 370 | such that Gammu can auto detect the model. |
371 | 371 | ||
372 | # This is a sample ~/.gammurc file. | 372 | # This is a sample ~/.gammurc file. |
373 | # In Unix/Linux copy it into your home directory and name it .gammurc | 373 | # In Unix/Linux copy it into your home directory and name it .gammurc |
374 | # or into /etc and name it gammurc | 374 | # or into /etc and name it gammurc |
375 | # In Win32 copy it into directory with Gammu.exe and name gammurc | 375 | # In Win32 copy it into directory with Gammu.exe and name gammurc |
376 | # More about parameters later | 376 | # More about parameters later |
377 | # ----------------------------------------------------------------------------- | 377 | # ----------------------------------------------------------------------------- |
378 | 378 | ||
379 | [gammu] | 379 | [gammu] |
380 | 380 | ||
381 | port = com8: | 381 | port = com8: |
382 | #model = 6110 | 382 | #model = 6110 |
383 | connection = fbusblue | 383 | connection = fbusblue |
384 | #synchronizetime = yes | 384 | #synchronizetime = yes |
385 | #logfile = gammulog | 385 | #logfile = gammulog |
386 | #logformat = textall | 386 | #logformat = textall |
387 | #use_locking = yes | 387 | #use_locking = yes |
388 | #gammuloc = locfile | 388 | #gammuloc = locfile |
389 | #startinfo = yes | 389 | #startinfo = yes |
390 | #gammucoding = utf8 | 390 | #gammucoding = utf8 |
391 | 391 | ||
392 | [gammu1] | 392 | [gammu1] |
393 | 393 | ||
394 | port = com8: | 394 | port = com8: |
395 | #model = 6110 | 395 | #model = 6110 |
396 | connection = fbusblue | 396 | connection = fbusblue |
397 | #synchronizetime = yes | 397 | #synchronizetime = yes |
398 | #logfile = gammulog | 398 | #logfile = gammulog |
399 | #logformat = textall | 399 | #logformat = textall |
400 | #use_locking = yes | 400 | #use_locking = yes |
401 | #gammuloc = locfile | 401 | #gammuloc = locfile |
402 | #startinfo = yes | 402 | #startinfo = yes |
403 | #gammucoding = utf8 | 403 | #gammucoding = utf8 |
404 | 404 | ||
405 | # ----------------------------------------------------------------------------- | 405 | # ----------------------------------------------------------------------------- |
406 | # Now info about "Connection" parameter and connected with it port type | 406 | # Now info about "Connection" parameter and connected with it port type |
407 | # (more about port types later) | 407 | # (more about port types later) |
408 | # ----------------------------------------------------------------------------- | 408 | # ----------------------------------------------------------------------------- |
409 | # "Connection" parameter | Port type | More details | 409 | # "Connection" parameter | Port type | More details |
410 | # -----------------------|-----------|----------------------------------------- | 410 | # -----------------------|-----------|----------------------------------------- |
411 | # "fbus" | serial | Nokia FBUS2 | 411 | # "fbus" | serial | Nokia FBUS2 |
412 | # "fbusirda"/"infrared" | serial | Nokia FBUS2 over direct infrared device | 412 | # "fbusirda"/"infrared" | serial | Nokia FBUS2 over direct infrared device |
413 | # "fbusdlr3"/"dlr3" | serial | Nokia FBUS2 with DLR3 cable | 413 | # "fbusdlr3"/"dlr3" | serial | Nokia FBUS2 with DLR3 cable |
414 | # "fbusdku5" | dku5 | Nokia FBUS2 with DKU5 cable. WIN32 ONLY | 414 | # "fbusdku5" | dku5 | Nokia FBUS2 with DKU5 cable. WIN32 ONLY |
415 | # "fbuspl2303" | usb | Nokia FBUS2 with USB cable based on | 415 | # "fbuspl2303" | usb | Nokia FBUS2 with USB cable based on |
416 | # | | PL2303 chip. | 416 | # | | PL2303 chip. |
417 | # "fbusblue" | serial | Nokia FBUS2 over Bluetooth serial device | 417 | # "fbusblue" | serial | Nokia FBUS2 over Bluetooth serial device |
418 | # "phonetblue" | serial | Nokia PHONET FBUS over Bluetooth serial | 418 | # "phonetblue" | serial | Nokia PHONET FBUS over Bluetooth serial |
419 | # | | device | 419 | # | | device |
420 | # "mrouterblue" | serial | | 420 | # "mrouterblue" | serial | |
421 | # "mbus" | serial | Nokia MBUS2 | 421 | # "mbus" | serial | Nokia MBUS2 |
422 | # "at19200"/"at115200"/..| serial | AT commands.8 bits, None parity, 1 stop | 422 | # "at19200"/"at115200"/..| serial | AT commands.8 bits, None parity, 1 stop |
423 | # | | bit, no flow control | 423 | # | | bit, no flow control |
424 | # -----------------------|-----------|----------------------------------------- | 424 | # -----------------------|-----------|----------------------------------------- |
425 | # "irdaphonet"/"irda" | irda | Nokia PHONET FBUS over socket infrared | 425 | # "irdaphonet"/"irda" | irda | Nokia PHONET FBUS over socket infrared |
426 | # "irdaat" | irda | AT commands with socket infrared | 426 | # "irdaat" | irda | AT commands with socket infrared |
427 | # "irdaobex" | irda | OBEX over socket infrared. MODEL "obex" | 427 | # "irdaobex" | irda | OBEX over socket infrared. MODEL "obex" |
428 | # -----------------------|-----------|----------------------------------------- | 428 | # -----------------------|-----------|----------------------------------------- |
429 | # "bluephonet" | BT | Nokia PHONET FBUS with Bluetooth stack | 429 | # "bluephonet" | BT | Nokia PHONET FBUS with Bluetooth stack |
430 | # "bluefbus"/"dlr3blue" | BT | Nokia FBUS2 with Bluetooth stack | 430 | # "bluefbus"/"dlr3blue" | BT | Nokia FBUS2 with Bluetooth stack |
431 | # "blueat"/"atblue" | BT | AT commands with Bluetooth stack | 431 | # "blueat"/"atblue" | BT | AT commands with Bluetooth stack |
432 | # "blueobex" | BT | OBEX with Bluetooth. MODEL "obex" | 432 | # "blueobex" | BT | OBEX with Bluetooth. MODEL "obex" |
433 | # | 433 | # |
434 | # Now more about port types and connected with it "Port" parameter | 434 | # Now more about port types and connected with it "Port" parameter |
435 | # ----------------------------------------------------------------------------- | 435 | # ----------------------------------------------------------------------------- |
436 | # Port type | "Port" parameter in Windows/DOS | "Port" parameter in Linux/Unix | 436 | # Port type | "Port" parameter in Windows/DOS | "Port" parameter in Linux/Unix |
437 | # ----------|---------------------------------|-------------------------------- | 437 | # ----------|---------------------------------|-------------------------------- |
438 | # serial | "com*:" | "/dev/ttyS*" | 438 | # serial | "com*:" | "/dev/ttyS*" |
439 | # | (example "com1:") | (example "/dev/ttyS1") | 439 | # | (example "com1:") | (example "/dev/ttyS1") |
440 | # | | or "/dev/tts/**" (with DevFS) | 440 | # | | or "/dev/tts/**" (with DevFS) |
441 | # ----------|---------------------------------|-------------------------------- | 441 | # ----------|---------------------------------|-------------------------------- |
442 | # irda | ignored (can be empty) | "/dev/ircomm*" | 442 | # irda | ignored (can be empty) | "/dev/ircomm*" |
443 | # ----------|---------------------------------|-------------------------------- | 443 | # ----------|---------------------------------|-------------------------------- |
444 | # BT | Bluetooth device address | 444 | # BT | Bluetooth device address |
445 | # | (example "") | 445 | # | (example "") |
446 | # ----------|---------------------------------|-------------------------------- | 446 | # ----------|---------------------------------|-------------------------------- |
447 | # dku5 | ignored (can be empty) | connection with it not possible | 447 | # dku5 | ignored (can be empty) | connection with it not possible |
448 | # ----------|---------------------------------|-------------------------------- | 448 | # ----------|---------------------------------|-------------------------------- |
449 | # usb | connection with it not possible | "/dev/ttyUSB*" | 449 | # usb | connection with it not possible | "/dev/ttyUSB*" |
450 | # | 450 | # |
451 | # Other config parameters | 451 | # Other config parameters |
452 | # ----------------------------------------------------------------------------- | 452 | # ----------------------------------------------------------------------------- |
453 | # Parameter name | Description | 453 | # Parameter name | Description |
454 | # ----------------|------------------------------------------------------------ | 454 | # ----------------|------------------------------------------------------------ |
455 | # Model | use only, when Gammu doesn't recognize your phone model. | 455 | # Model | use only, when Gammu doesn't recognize your phone model. |
456 | # | Put it here. Example values: "6110", "6150", "6210", "8210" | 456 | # | Put it here. Example values: "6110", "6150", "6210", "8210" |
457 | # SynchronizeTime | if you want to set time from computer to phone during | 457 | # SynchronizeTime | if you want to set time from computer to phone during |
458 | # | starting connection. Do not rather use this option when | 458 | # | starting connection. Do not rather use this option when |
459 | # | when to reset phone during connection (in some phones need | 459 | # | when to reset phone during connection (in some phones need |
460 | # | to set time again after restart) | 460 | # | to set time again after restart) |
461 | # GammuLoc | name of localisation file | 461 | # GammuLoc | name of localisation file |
462 | # StartInfo | this option allow to set, that you want (setting "yes") | 462 | # StartInfo | this option allow to set, that you want (setting "yes") |
463 | # | to see message on the phone screen or phone should enable | 463 | # | to see message on the phone screen or phone should enable |
464 | # | light for a moment during starting connection. Phone | 464 | # | light for a moment during starting connection. Phone |
465 | # | WON'T beep during starting connection with this option. | 465 | # | WON'T beep during starting connection with this option. |
466 | # GammuCoding | forces using specified codepage (in win32 - for example | 466 | # GammuCoding | forces using specified codepage (in win32 - for example |
467 | # | "1250" will force CP1250) or UTF8 (in Linux - "utf8") | 467 | # | "1250" will force CP1250) or UTF8 (in Linux - "utf8") |
468 | # ----------------|------------------------------------------------------------ | 468 | # ----------------|------------------------------------------------------------ |
469 | # Logfile | Use, when want to have logfile from communication. | 469 | # Logfile | Use, when want to have logfile from communication. |
470 | # Logformat | What debug info and format should be used: | 470 | # Logformat | What debug info and format should be used: |
471 | # | "nothing" - no debug level (default) | 471 | # | "nothing" - no debug level (default) |
472 | # | "text" - transmission dump in text format | 472 | # | "text" - transmission dump in text format |
473 | # | "textall" - all possible info in text format | 473 | # | "textall" - all possible info in text format |
474 | # | "errors" - errors in text format | 474 | # | "errors" - errors in text format |
475 | # | "binary" - transmission dump in binary format | 475 | # | "binary" - transmission dump in binary format |
476 | # ----------------|------------------------------------------------------------ | 476 | # ----------------|------------------------------------------------------------ |
477 | # Use_Locking | under Unix/Linux use "yes", if want to lock used device | 477 | # Use_Locking | under Unix/Linux use "yes", if want to lock used device |
478 | # | to prevent using it by other applications. In win32 ignored | 478 | # | to prevent using it by other applications. In win32 ignored |
479 | 479 | ||
480 | 480 | ||
481 | 481 | ||
482 | 482 | ||
483 | \ No newline at end of file | 483 | \ No newline at end of file |
diff --git a/gammu/emb/gammu/gammu.c b/gammu/emb/gammu/gammu.c index c436b90..8db9afb 100644 --- a/gammu/emb/gammu/gammu.c +++ b/gammu/emb/gammu/gammu.c | |||
@@ -2518,3073 +2518,3073 @@ static void DisplaySMSFrame(GSM_SMSMessage *SMS) | |||
2518 | #else | 2518 | #else |
2519 | for (i=0;i<buffer[PHONE_SMSSubmit.SMSCNumber]+1;i++) { | 2519 | for (i=0;i<buffer[PHONE_SMSSubmit.SMSCNumber]+1;i++) { |
2520 | req[current++]=buffer[PHONE_SMSSubmit.SMSCNumber+i]; | 2520 | req[current++]=buffer[PHONE_SMSSubmit.SMSCNumber+i]; |
2521 | } | 2521 | } |
2522 | req[current++]=buffer[PHONE_SMSSubmit.firstbyte]; | 2522 | req[current++]=buffer[PHONE_SMSSubmit.firstbyte]; |
2523 | req[current++]=buffer[PHONE_SMSSubmit.TPMR]; | 2523 | req[current++]=buffer[PHONE_SMSSubmit.TPMR]; |
2524 | for (i=0;i<((buffer[PHONE_SMSSubmit.Number]+1)/2+1)+1;i++) { | 2524 | for (i=0;i<((buffer[PHONE_SMSSubmit.Number]+1)/2+1)+1;i++) { |
2525 | req[current++]=buffer[PHONE_SMSSubmit.Number+i]; | 2525 | req[current++]=buffer[PHONE_SMSSubmit.Number+i]; |
2526 | } | 2526 | } |
2527 | req[current++]=buffer[PHONE_SMSSubmit.TPPID]; | 2527 | req[current++]=buffer[PHONE_SMSSubmit.TPPID]; |
2528 | req[current++]=buffer[PHONE_SMSSubmit.TPDCS]; | 2528 | req[current++]=buffer[PHONE_SMSSubmit.TPDCS]; |
2529 | req[current++]=buffer[PHONE_SMSSubmit.TPVP]; | 2529 | req[current++]=buffer[PHONE_SMSSubmit.TPVP]; |
2530 | req[current++]=buffer[PHONE_SMSSubmit.TPUDL]; | 2530 | req[current++]=buffer[PHONE_SMSSubmit.TPUDL]; |
2531 | for(i=0;i<length;i++) req[current++]=buffer[PHONE_SMSSubmit.Text+i]; | 2531 | for(i=0;i<length;i++) req[current++]=buffer[PHONE_SMSSubmit.Text+i]; |
2532 | EncodeHexBin(hexreq, req, current); | 2532 | EncodeHexBin(hexreq, req, current); |
2533 | printmsg("%s\n\n",hexreq); | 2533 | printmsg("%s\n\n",hexreq); |
2534 | #endif | 2534 | #endif |
2535 | } | 2535 | } |
2536 | 2536 | ||
2537 | #define SEND_SAVE_SMS_BUFFER_SIZE 10000 | 2537 | #define SEND_SAVE_SMS_BUFFER_SIZE 10000 |
2538 | 2538 | ||
2539 | static GSM_Error SMSStatus; | 2539 | static GSM_Error SMSStatus; |
2540 | 2540 | ||
2541 | static void SendSMSStatus (char *Device, int status, int MessageReference) | 2541 | static void SendSMSStatus (char *Device, int status, int MessageReference) |
2542 | { | 2542 | { |
2543 | dbgprintf("Sent SMS on device: \"%s\"\n",Device); | 2543 | dbgprintf("Sent SMS on device: \"%s\"\n",Device); |
2544 | if (status==0) { | 2544 | if (status==0) { |
2545 | printmsg("..OK"); | 2545 | printmsg("..OK"); |
2546 | SMSStatus = ERR_NONE; | 2546 | SMSStatus = ERR_NONE; |
2547 | } else { | 2547 | } else { |
2548 | printmsg("..error %i",status); | 2548 | printmsg("..error %i",status); |
2549 | SMSStatus = ERR_UNKNOWN; | 2549 | SMSStatus = ERR_UNKNOWN; |
2550 | } | 2550 | } |
2551 | printmsg(", message reference=%d\n",MessageReference); | 2551 | printmsg(", message reference=%d\n",MessageReference); |
2552 | } | 2552 | } |
2553 | 2553 | ||
2554 | static void SendSaveDisplaySMS(int argc, char *argv[]) | 2554 | static void SendSaveDisplaySMS(int argc, char *argv[]) |
2555 | { | 2555 | { |
2556 | #ifdef GSM_ENABLE_BACKUP | 2556 | #ifdef GSM_ENABLE_BACKUP |
2557 | GSM_Backup Backup; | 2557 | GSM_Backup Backup; |
2558 | #endif | 2558 | #endif |
2559 | int i,j,z,FramesNum = 0; | 2559 | int i,j,z,FramesNum = 0; |
2560 | int Protected = 0; | 2560 | int Protected = 0; |
2561 | GSM_SMSFolders folders; | 2561 | GSM_SMSFolders folders; |
2562 | GSM_MultiSMSMessage sms; | 2562 | GSM_MultiSMSMessage sms; |
2563 | GSM_Ringtone ringtone[MAX_MULTI_SMS]; | 2563 | GSM_Ringtone ringtone[MAX_MULTI_SMS]; |
2564 | GSM_MultiBitmap bitmap[MAX_MULTI_SMS],bitmap2; | 2564 | GSM_MultiBitmap bitmap[MAX_MULTI_SMS],bitmap2; |
2565 | GSM_MultiPartSMSInfo SMSInfo; | 2565 | GSM_MultiPartSMSInfo SMSInfo; |
2566 | GSM_NetworkInfo NetInfo; | 2566 | GSM_NetworkInfo NetInfo; |
2567 | GSM_MMSIndicator MMSInfo; | 2567 | GSM_MMSIndicator MMSInfo; |
2568 | FILE *ReplaceFile,*f; | 2568 | FILE *ReplaceFile,*f; |
2569 | char ReplaceBuffer2[200],ReplaceBuffer[200]; | 2569 | char ReplaceBuffer2[200],ReplaceBuffer[200]; |
2570 | char InputBuffer[SEND_SAVE_SMS_BUFFER_SIZE/2+1]; | 2570 | char InputBuffer[SEND_SAVE_SMS_BUFFER_SIZE/2+1]; |
2571 | char Buffer [MAX_MULTI_SMS][SEND_SAVE_SMS_BUFFER_SIZE]; | 2571 | char Buffer [MAX_MULTI_SMS][SEND_SAVE_SMS_BUFFER_SIZE]; |
2572 | char Sender [(GSM_MAX_NUMBER_LENGTH+1)*2]; | 2572 | char Sender [(GSM_MAX_NUMBER_LENGTH+1)*2]; |
2573 | char Name [(GSM_MAX_NUMBER_LENGTH+1)*2]; | 2573 | char Name [(GSM_MAX_NUMBER_LENGTH+1)*2]; |
2574 | char SMSC [(GSM_MAX_NUMBER_LENGTH+1)*2]; | 2574 | char SMSC [(GSM_MAX_NUMBER_LENGTH+1)*2]; |
2575 | int startarg = 0; | 2575 | int startarg = 0; |
2576 | int chars_read = 0; | 2576 | int chars_read = 0; |
2577 | int nextlong = 0; | 2577 | int nextlong = 0; |
2578 | bool ReplyViaSameSMSC = false; | 2578 | bool ReplyViaSameSMSC = false; |
2579 | int SMSCSet = 1; | 2579 | int SMSCSet = 1; |
2580 | int MaxSMS = -1; | 2580 | int MaxSMS = -1; |
2581 | bool EMS16Bit = false; | 2581 | bool EMS16Bit = false; |
2582 | bool SendSaved = false; | 2582 | bool SendSaved = false; |
2583 | 2583 | ||
2584 | /* Parameters required only during saving */ | 2584 | /* Parameters required only during saving */ |
2585 | int Folder = 1; /*Inbox by default */ | 2585 | int Folder = 1; /*Inbox by default */ |
2586 | GSM_SMS_State State = SMS_Sent; | 2586 | GSM_SMS_State State = SMS_Sent; |
2587 | 2587 | ||
2588 | /* Required only during sending */ | 2588 | /* Required only during sending */ |
2589 | GSM_SMSValidity Validity; | 2589 | GSM_SMSValidity Validity; |
2590 | GSM_SMSC PhoneSMSC; | 2590 | GSM_SMSC PhoneSMSC; |
2591 | bool DeliveryReport = false; | 2591 | bool DeliveryReport = false; |
2592 | 2592 | ||
2593 | ReplaceBuffer[0] = 0; | 2593 | ReplaceBuffer[0] = 0; |
2594 | ReplaceBuffer[1] = 0; | 2594 | ReplaceBuffer[1] = 0; |
2595 | GSM_ClearMultiPartSMSInfo(&SMSInfo); | 2595 | GSM_ClearMultiPartSMSInfo(&SMSInfo); |
2596 | SMSInfo.ReplaceMessage = 0; | 2596 | SMSInfo.ReplaceMessage = 0; |
2597 | SMSInfo.EntriesNum = 1; | 2597 | SMSInfo.EntriesNum = 1; |
2598 | 2598 | ||
2599 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2599 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2600 | EncodeUnicode(Sender,"Gammu",5); | 2600 | EncodeUnicode(Sender,"Gammu",5); |
2601 | Name[0] = 0; | 2601 | Name[0] = 0; |
2602 | Name[1] = 0; | 2602 | Name[1] = 0; |
2603 | startarg = 0; | 2603 | startarg = 0; |
2604 | } else { | 2604 | } else { |
2605 | EncodeUnicode(Sender,argv[3],strlen(argv[3])); | 2605 | EncodeUnicode(Sender,argv[3],strlen(argv[3])); |
2606 | startarg = 1; | 2606 | startarg = 1; |
2607 | Validity.Format = 0; | 2607 | Validity.Format = 0; |
2608 | } | 2608 | } |
2609 | if (mystrncasecmp(argv[1],"--sendsmsdsms",0)) { | 2609 | if (mystrncasecmp(argv[1],"--sendsmsdsms",0)) { |
2610 | startarg=startarg+2; | 2610 | startarg=startarg+2; |
2611 | EncodeUnicode(SMSC,"1234",4); | 2611 | EncodeUnicode(SMSC,"1234",4); |
2612 | SMSCSet= 0; | 2612 | SMSCSet= 0; |
2613 | } | 2613 | } |
2614 | 2614 | ||
2615 | if (mystrncasecmp(argv[2],"TEXT",0)) { | 2615 | if (mystrncasecmp(argv[2],"TEXT",0)) { |
2616 | chars_read = fread(InputBuffer, 1, SEND_SAVE_SMS_BUFFER_SIZE/2, stdin); | 2616 | chars_read = fread(InputBuffer, 1, SEND_SAVE_SMS_BUFFER_SIZE/2, stdin); |
2617 | if (chars_read == 0) printmsg("Warning: 0 chars read !\n"); | 2617 | if (chars_read == 0) printmsg("Warning: 0 chars read !\n"); |
2618 | InputBuffer[chars_read] = 0x00; | 2618 | InputBuffer[chars_read] = 0x00; |
2619 | InputBuffer[chars_read+1] = 0x00; | 2619 | InputBuffer[chars_read+1] = 0x00; |
2620 | EncodeUnicode(Buffer[0],InputBuffer,strlen(InputBuffer)); | 2620 | EncodeUnicode(Buffer[0],InputBuffer,strlen(InputBuffer)); |
2621 | SMSInfo.Entries[0].Buffer = Buffer[0]; | 2621 | SMSInfo.Entries[0].Buffer = Buffer[0]; |
2622 | SMSInfo.Entries[0].ID = SMS_Text; | 2622 | SMSInfo.Entries[0].ID = SMS_Text; |
2623 | SMSInfo.UnicodeCoding = false; | 2623 | SMSInfo.UnicodeCoding = false; |
2624 | startarg += 3; | 2624 | startarg += 3; |
2625 | } else if (mystrncasecmp(argv[2],"SMSTEMPLATE",0)) { | 2625 | } else if (mystrncasecmp(argv[2],"SMSTEMPLATE",0)) { |
2626 | SMSInfo.UnicodeCoding = false; | 2626 | SMSInfo.UnicodeCoding = false; |
2627 | SMSInfo.EntriesNum = 1; | 2627 | SMSInfo.EntriesNum = 1; |
2628 | Buffer[0][0] = 0x00; | 2628 | Buffer[0][0] = 0x00; |
2629 | Buffer[0][1] = 0x00; | 2629 | Buffer[0][1] = 0x00; |
2630 | SMSInfo.Entries[0].Buffer = Buffer[0]; | 2630 | SMSInfo.Entries[0].Buffer = Buffer[0]; |
2631 | SMSInfo.Entries[0].ID = SMS_AlcatelSMSTemplateName; | 2631 | SMSInfo.Entries[0].ID = SMS_AlcatelSMSTemplateName; |
2632 | startarg += 3; | 2632 | startarg += 3; |
2633 | } else if (mystrncasecmp(argv[2],"EMS",0)) { | 2633 | } else if (mystrncasecmp(argv[2],"EMS",0)) { |
2634 | SMSInfo.UnicodeCoding = false; | 2634 | SMSInfo.UnicodeCoding = false; |
2635 | SMSInfo.EntriesNum = 0; | 2635 | SMSInfo.EntriesNum = 0; |
2636 | startarg += 3; | 2636 | startarg += 3; |
2637 | } else if (mystrncasecmp(argv[2],"MMSINDICATOR",0)) { | 2637 | } else if (mystrncasecmp(argv[2],"MMSINDICATOR",0)) { |
2638 | if (argc<6+startarg) { | 2638 | if (argc<6+startarg) { |
2639 | printmsg("Where are parameters ?\n"); | 2639 | printmsg("Where are parameters ?\n"); |
2640 | exit(-1); | 2640 | exit(-1); |
2641 | } | 2641 | } |
2642 | SMSInfo.Entries[0].ID = SMS_MMSIndicatorLong; | 2642 | SMSInfo.Entries[0].ID = SMS_MMSIndicatorLong; |
2643 | SMSInfo.Entries[0].MMSIndicator = &MMSInfo; | 2643 | SMSInfo.Entries[0].MMSIndicator = &MMSInfo; |
2644 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2644 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2645 | EncodeUnicode(Sender,"MMS Info",8); | 2645 | EncodeUnicode(Sender,"MMS Info",8); |
2646 | } | 2646 | } |
2647 | strcpy(MMSInfo.Address,argv[3+startarg]); | 2647 | strcpy(MMSInfo.Address,argv[3+startarg]); |
2648 | strcpy(MMSInfo.Title,argv[4+startarg]); | 2648 | strcpy(MMSInfo.Title,argv[4+startarg]); |
2649 | strcpy(MMSInfo.Sender,argv[5+startarg]); | 2649 | strcpy(MMSInfo.Sender,argv[5+startarg]); |
2650 | startarg += 6; | 2650 | startarg += 6; |
2651 | } else if (mystrncasecmp(argv[2],"WAPINDICATOR",0)) { | 2651 | } else if (mystrncasecmp(argv[2],"WAPINDICATOR",0)) { |
2652 | if (argc<5+startarg) { | 2652 | if (argc<5+startarg) { |
2653 | printmsg("Where are parameters ?\n"); | 2653 | printmsg("Where are parameters ?\n"); |
2654 | exit(-1); | 2654 | exit(-1); |
2655 | } | 2655 | } |
2656 | SMSInfo.Entries[0].ID = SMS_WAPIndicatorLong; | 2656 | SMSInfo.Entries[0].ID = SMS_WAPIndicatorLong; |
2657 | SMSInfo.Entries[0].MMSIndicator = &MMSInfo; | 2657 | SMSInfo.Entries[0].MMSIndicator = &MMSInfo; |
2658 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2658 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2659 | EncodeUnicode(Sender,"WAP Info",8); | 2659 | EncodeUnicode(Sender,"WAP Info",8); |
2660 | } | 2660 | } |
2661 | strcpy(MMSInfo.Address,argv[3+startarg]); | 2661 | strcpy(MMSInfo.Address,argv[3+startarg]); |
2662 | strcpy(MMSInfo.Title,argv[4+startarg]); | 2662 | strcpy(MMSInfo.Title,argv[4+startarg]); |
2663 | startarg += 5; | 2663 | startarg += 5; |
2664 | } else if (mystrncasecmp(argv[2],"RINGTONE",0)) { | 2664 | } else if (mystrncasecmp(argv[2],"RINGTONE",0)) { |
2665 | if (argc<4+startarg) { | 2665 | if (argc<4+startarg) { |
2666 | printmsg("Where is ringtone filename ?\n"); | 2666 | printmsg("Where is ringtone filename ?\n"); |
2667 | exit(-1); | 2667 | exit(-1); |
2668 | } | 2668 | } |
2669 | ringtone[0].Format=RING_NOTETONE; | 2669 | ringtone[0].Format=RING_NOTETONE; |
2670 | error=GSM_ReadRingtoneFile(argv[3+startarg],&ringtone[0]); | 2670 | error=GSM_ReadRingtoneFile(argv[3+startarg],&ringtone[0]); |
2671 | Print_Error(error); | 2671 | Print_Error(error); |
2672 | SMSInfo.Entries[0].ID = SMS_NokiaRingtone; | 2672 | SMSInfo.Entries[0].ID = SMS_NokiaRingtone; |
2673 | SMSInfo.Entries[0].Ringtone = &ringtone[0]; | 2673 | SMSInfo.Entries[0].Ringtone = &ringtone[0]; |
2674 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2674 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2675 | CopyUnicodeString(Sender, ringtone[0].Name); | 2675 | CopyUnicodeString(Sender, ringtone[0].Name); |
2676 | EncodeUnicode(Name,"Ringtone ",9); | 2676 | EncodeUnicode(Name,"Ringtone ",9); |
2677 | CopyUnicodeString(Name+9*2, ringtone[0].Name); | 2677 | CopyUnicodeString(Name+9*2, ringtone[0].Name); |
2678 | } | 2678 | } |
2679 | startarg += 4; | 2679 | startarg += 4; |
2680 | } else if (mystrncasecmp(argv[2],"OPERATOR",0)) { | 2680 | } else if (mystrncasecmp(argv[2],"OPERATOR",0)) { |
2681 | if (argc<4+startarg) { | 2681 | if (argc<4+startarg) { |
2682 | printmsg("Where is logo filename ?\n"); | 2682 | printmsg("Where is logo filename ?\n"); |
2683 | exit(-1); | 2683 | exit(-1); |
2684 | } | 2684 | } |
2685 | bitmap[0].Bitmap[0].Type=GSM_OperatorLogo; | 2685 | bitmap[0].Bitmap[0].Type=GSM_OperatorLogo; |
2686 | error=GSM_ReadBitmapFile(argv[3+startarg],&bitmap[0]); | 2686 | error=GSM_ReadBitmapFile(argv[3+startarg],&bitmap[0]); |
2687 | Print_Error(error); | 2687 | Print_Error(error); |
2688 | strcpy(bitmap[0].Bitmap[0].NetworkCode,"000 00"); | 2688 | strcpy(bitmap[0].Bitmap[0].NetworkCode,"000 00"); |
2689 | SMSInfo.Entries[0].ID = SMS_NokiaOperatorLogo; | 2689 | SMSInfo.Entries[0].ID = SMS_NokiaOperatorLogo; |
2690 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; | 2690 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; |
2691 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2691 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2692 | EncodeUnicode(Sender, "OpLogo",6); | 2692 | EncodeUnicode(Sender, "OpLogo",6); |
2693 | EncodeUnicode(Name,"OpLogo ",7); | 2693 | EncodeUnicode(Name,"OpLogo ",7); |
2694 | } | 2694 | } |
2695 | startarg += 4; | 2695 | startarg += 4; |
2696 | } else if (mystrncasecmp(argv[2],"CALLER",0)) { | 2696 | } else if (mystrncasecmp(argv[2],"CALLER",0)) { |
2697 | if (argc<4+startarg) { | 2697 | if (argc<4+startarg) { |
2698 | printmsg("Where is logo filename ?\n"); | 2698 | printmsg("Where is logo filename ?\n"); |
2699 | exit(-1); | 2699 | exit(-1); |
2700 | } | 2700 | } |
2701 | bitmap[0].Bitmap[0].Type=GSM_CallerGroupLogo; | 2701 | bitmap[0].Bitmap[0].Type=GSM_CallerGroupLogo; |
2702 | error=GSM_ReadBitmapFile(argv[3+startarg],&bitmap[0]); | 2702 | error=GSM_ReadBitmapFile(argv[3+startarg],&bitmap[0]); |
2703 | Print_Error(error); | 2703 | Print_Error(error); |
2704 | SMSInfo.Entries[0].ID = SMS_NokiaCallerLogo; | 2704 | SMSInfo.Entries[0].ID = SMS_NokiaCallerLogo; |
2705 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; | 2705 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; |
2706 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2706 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2707 | EncodeUnicode(Sender, "Caller",6); | 2707 | EncodeUnicode(Sender, "Caller",6); |
2708 | } | 2708 | } |
2709 | startarg += 4; | 2709 | startarg += 4; |
2710 | } else if (mystrncasecmp(argv[2],"ANIMATION",0)) { | 2710 | } else if (mystrncasecmp(argv[2],"ANIMATION",0)) { |
2711 | SMSInfo.UnicodeCoding = false; | 2711 | SMSInfo.UnicodeCoding = false; |
2712 | SMSInfo.EntriesNum = 1; | 2712 | SMSInfo.EntriesNum = 1; |
2713 | if (argc<4+startarg) { | 2713 | if (argc<4+startarg) { |
2714 | printmsg("Where is number of frames ?\n"); | 2714 | printmsg("Where is number of frames ?\n"); |
2715 | exit(-1); | 2715 | exit(-1); |
2716 | } | 2716 | } |
2717 | bitmap[0].Number = 0; | 2717 | bitmap[0].Number = 0; |
2718 | i = 1; | 2718 | i = 1; |
2719 | while (1) { | 2719 | while (1) { |
2720 | bitmap2.Bitmap[0].Type=GSM_StartupLogo; | 2720 | bitmap2.Bitmap[0].Type=GSM_StartupLogo; |
2721 | error=GSM_ReadBitmapFile(argv[3+startarg+i],&bitmap2); | 2721 | error=GSM_ReadBitmapFile(argv[3+startarg+i],&bitmap2); |
2722 | Print_Error(error); | 2722 | Print_Error(error); |
2723 | for (j=0;j<bitmap2.Number;j++) { | 2723 | for (j=0;j<bitmap2.Number;j++) { |
2724 | if (bitmap[0].Number == atoi(argv[3+startarg])) break; | 2724 | if (bitmap[0].Number == atoi(argv[3+startarg])) break; |
2725 | memcpy(&bitmap[0].Bitmap[bitmap[0].Number],&bitmap2.Bitmap[j],sizeof(GSM_Bitmap)); | 2725 | memcpy(&bitmap[0].Bitmap[bitmap[0].Number],&bitmap2.Bitmap[j],sizeof(GSM_Bitmap)); |
2726 | bitmap[0].Number++; | 2726 | bitmap[0].Number++; |
2727 | } | 2727 | } |
2728 | if (bitmap[0].Number == atoi(argv[3+startarg])) break; | 2728 | if (bitmap[0].Number == atoi(argv[3+startarg])) break; |
2729 | i++; | 2729 | i++; |
2730 | } | 2730 | } |
2731 | SMSInfo.Entries[0].ID = SMS_AlcatelMonoAnimationLong; | 2731 | SMSInfo.Entries[0].ID = SMS_AlcatelMonoAnimationLong; |
2732 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; | 2732 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; |
2733 | bitmap[0].Bitmap[0].Text[0]= 0; | 2733 | bitmap[0].Bitmap[0].Text[0]= 0; |
2734 | bitmap[0].Bitmap[0].Text[1]= 0; | 2734 | bitmap[0].Bitmap[0].Text[1]= 0; |
2735 | startarg += 4 + atoi(argv[3+startarg]); | 2735 | startarg += 4 + atoi(argv[3+startarg]); |
2736 | } else if (mystrncasecmp(argv[2],"PICTURE",0)) { | 2736 | } else if (mystrncasecmp(argv[2],"PICTURE",0)) { |
2737 | if (argc<4+startarg) { | 2737 | if (argc<4+startarg) { |
2738 | printmsg("Where is logo filename ?\n"); | 2738 | printmsg("Where is logo filename ?\n"); |
2739 | exit(-1); | 2739 | exit(-1); |
2740 | } | 2740 | } |
2741 | bitmap[0].Bitmap[0].Type=GSM_PictureImage; | 2741 | bitmap[0].Bitmap[0].Type=GSM_PictureImage; |
2742 | error=GSM_ReadBitmapFile(argv[3+startarg],&bitmap[0]); | 2742 | error=GSM_ReadBitmapFile(argv[3+startarg],&bitmap[0]); |
2743 | printmsg("File \"%s\"\n",argv[3+startarg]); | 2743 | printmsg("File \"%s\"\n",argv[3+startarg]); |
2744 | Print_Error(error); | 2744 | Print_Error(error); |
2745 | SMSInfo.Entries[0].ID = SMS_NokiaPictureImageLong; | 2745 | SMSInfo.Entries[0].ID = SMS_NokiaPictureImageLong; |
2746 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; | 2746 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; |
2747 | SMSInfo.UnicodeCoding = false; | 2747 | SMSInfo.UnicodeCoding = false; |
2748 | bitmap[0].Bitmap[0].Text[0]= 0; | 2748 | bitmap[0].Bitmap[0].Text[0]= 0; |
2749 | bitmap[0].Bitmap[0].Text[1]= 0; | 2749 | bitmap[0].Bitmap[0].Text[1]= 0; |
2750 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2750 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2751 | EncodeUnicode(Sender, "Picture",7); | 2751 | EncodeUnicode(Sender, "Picture",7); |
2752 | EncodeUnicode(Name,"Picture Image",13); | 2752 | EncodeUnicode(Name,"Picture Image",13); |
2753 | } | 2753 | } |
2754 | startarg += 4; | 2754 | startarg += 4; |
2755 | #ifdef GSM_ENABLE_BACKUP | 2755 | #ifdef GSM_ENABLE_BACKUP |
2756 | } else if (mystrncasecmp(argv[2],"BOOKMARK",0)) { | 2756 | } else if (mystrncasecmp(argv[2],"BOOKMARK",0)) { |
2757 | if (argc<5+startarg) { | 2757 | if (argc<5+startarg) { |
2758 | printmsg("Where is backup filename and location ?\n"); | 2758 | printmsg("Where is backup filename and location ?\n"); |
2759 | exit(-1); | 2759 | exit(-1); |
2760 | } | 2760 | } |
2761 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); | 2761 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); |
2762 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 2762 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
2763 | i = 0; | 2763 | i = 0; |
2764 | while (Backup.WAPBookmark[i]!=NULL) { | 2764 | while (Backup.WAPBookmark[i]!=NULL) { |
2765 | if (i == atoi(argv[4+startarg])-1) break; | 2765 | if (i == atoi(argv[4+startarg])-1) break; |
2766 | i++; | 2766 | i++; |
2767 | } | 2767 | } |
2768 | if (i != atoi(argv[4+startarg])-1) { | 2768 | if (i != atoi(argv[4+startarg])-1) { |
2769 | printmsg("Bookmark not found in file\n"); | 2769 | printmsg("Bookmark not found in file\n"); |
2770 | exit(-1); | 2770 | exit(-1); |
2771 | } | 2771 | } |
2772 | SMSInfo.Entries[0].ID = SMS_NokiaWAPBookmarkLong; | 2772 | SMSInfo.Entries[0].ID = SMS_NokiaWAPBookmarkLong; |
2773 | SMSInfo.Entries[0].Bookmark = Backup.WAPBookmark[i]; | 2773 | SMSInfo.Entries[0].Bookmark = Backup.WAPBookmark[i]; |
2774 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2774 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2775 | EncodeUnicode(Sender, "Bookmark",8); | 2775 | EncodeUnicode(Sender, "Bookmark",8); |
2776 | EncodeUnicode(Name,"WAP Bookmark",12); | 2776 | EncodeUnicode(Name,"WAP Bookmark",12); |
2777 | } | 2777 | } |
2778 | startarg += 5; | 2778 | startarg += 5; |
2779 | } else if (mystrncasecmp(argv[2],"WAPSETTINGS",0)) { | 2779 | } else if (mystrncasecmp(argv[2],"WAPSETTINGS",0)) { |
2780 | if (argc<6+startarg) { | 2780 | if (argc<6+startarg) { |
2781 | printmsg("Where is backup filename and location ?\n"); | 2781 | printmsg("Where is backup filename and location ?\n"); |
2782 | exit(-1); | 2782 | exit(-1); |
2783 | } | 2783 | } |
2784 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); | 2784 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); |
2785 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 2785 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
2786 | i = 0; | 2786 | i = 0; |
2787 | while (Backup.WAPSettings[i]!=NULL) { | 2787 | while (Backup.WAPSettings[i]!=NULL) { |
2788 | if (i == atoi(argv[4+startarg])-1) break; | 2788 | if (i == atoi(argv[4+startarg])-1) break; |
2789 | i++; | 2789 | i++; |
2790 | } | 2790 | } |
2791 | if (i != atoi(argv[4+startarg])-1) { | 2791 | if (i != atoi(argv[4+startarg])-1) { |
2792 | printmsg("WAP settings not found in file\n"); | 2792 | printmsg("WAP settings not found in file\n"); |
2793 | exit(-1); | 2793 | exit(-1); |
2794 | } | 2794 | } |
2795 | SMSInfo.Entries[0].Settings = NULL; | 2795 | SMSInfo.Entries[0].Settings = NULL; |
2796 | for (j=0;j<Backup.WAPSettings[i]->Number;j++) { | 2796 | for (j=0;j<Backup.WAPSettings[i]->Number;j++) { |
2797 | switch (Backup.WAPSettings[i]->Settings[j].Bearer) { | 2797 | switch (Backup.WAPSettings[i]->Settings[j].Bearer) { |
2798 | case WAPSETTINGS_BEARER_GPRS: | 2798 | case WAPSETTINGS_BEARER_GPRS: |
2799 | if (mystrncasecmp(argv[5+startarg],"GPRS",0)) { | 2799 | if (mystrncasecmp(argv[5+startarg],"GPRS",0)) { |
2800 | SMSInfo.Entries[0].Settings = &Backup.WAPSettings[i]->Settings[j]; | 2800 | SMSInfo.Entries[0].Settings = &Backup.WAPSettings[i]->Settings[j]; |
2801 | break; | 2801 | break; |
2802 | } | 2802 | } |
2803 | case WAPSETTINGS_BEARER_DATA: | 2803 | case WAPSETTINGS_BEARER_DATA: |
2804 | if (mystrncasecmp(argv[5+startarg],"DATA",0)) { | 2804 | if (mystrncasecmp(argv[5+startarg],"DATA",0)) { |
2805 | SMSInfo.Entries[0].Settings = &Backup.WAPSettings[i]->Settings[j]; | 2805 | SMSInfo.Entries[0].Settings = &Backup.WAPSettings[i]->Settings[j]; |
2806 | break; | 2806 | break; |
2807 | } | 2807 | } |
2808 | default: | 2808 | default: |
2809 | break; | 2809 | break; |
2810 | } | 2810 | } |
2811 | } | 2811 | } |
2812 | if (SMSInfo.Entries[0].Settings == NULL) { | 2812 | if (SMSInfo.Entries[0].Settings == NULL) { |
2813 | printmsg("Sorry. For now there is only support for GPRS or DATA bearers end\n"); | 2813 | printmsg("Sorry. For now there is only support for GPRS or DATA bearers end\n"); |
2814 | exit(-1); | 2814 | exit(-1); |
2815 | } | 2815 | } |
2816 | SMSInfo.Entries[0].ID = SMS_NokiaWAPSettingsLong; | 2816 | SMSInfo.Entries[0].ID = SMS_NokiaWAPSettingsLong; |
2817 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2817 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2818 | EncodeUnicode(Sender, "Settings",8); | 2818 | EncodeUnicode(Sender, "Settings",8); |
2819 | EncodeUnicode(Name,"WAP Settings",12); | 2819 | EncodeUnicode(Name,"WAP Settings",12); |
2820 | } | 2820 | } |
2821 | startarg += 6; | 2821 | startarg += 6; |
2822 | } else if (mystrncasecmp(argv[2],"MMSSETTINGS",0)) { | 2822 | } else if (mystrncasecmp(argv[2],"MMSSETTINGS",0)) { |
2823 | if (argc<5+startarg) { | 2823 | if (argc<5+startarg) { |
2824 | printmsg("Where is backup filename and location ?\n"); | 2824 | printmsg("Where is backup filename and location ?\n"); |
2825 | exit(-1); | 2825 | exit(-1); |
2826 | } | 2826 | } |
2827 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); | 2827 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); |
2828 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 2828 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
2829 | i = 0; | 2829 | i = 0; |
2830 | while (Backup.MMSSettings[i]!=NULL) { | 2830 | while (Backup.MMSSettings[i]!=NULL) { |
2831 | if (i == atoi(argv[4+startarg])-1) break; | 2831 | if (i == atoi(argv[4+startarg])-1) break; |
2832 | i++; | 2832 | i++; |
2833 | } | 2833 | } |
2834 | if (i != atoi(argv[4+startarg])-1) { | 2834 | if (i != atoi(argv[4+startarg])-1) { |
2835 | printmsg("MMS settings not found in file\n"); | 2835 | printmsg("MMS settings not found in file\n"); |
2836 | exit(-1); | 2836 | exit(-1); |
2837 | } | 2837 | } |
2838 | SMSInfo.Entries[0].Settings = NULL; | 2838 | SMSInfo.Entries[0].Settings = NULL; |
2839 | for (j=0;j<Backup.MMSSettings[i]->Number;j++) { | 2839 | for (j=0;j<Backup.MMSSettings[i]->Number;j++) { |
2840 | switch (Backup.MMSSettings[i]->Settings[j].Bearer) { | 2840 | switch (Backup.MMSSettings[i]->Settings[j].Bearer) { |
2841 | case WAPSETTINGS_BEARER_GPRS: | 2841 | case WAPSETTINGS_BEARER_GPRS: |
2842 | SMSInfo.Entries[0].Settings = &Backup.MMSSettings[i]->Settings[j]; | 2842 | SMSInfo.Entries[0].Settings = &Backup.MMSSettings[i]->Settings[j]; |
2843 | break; | 2843 | break; |
2844 | default: | 2844 | default: |
2845 | break; | 2845 | break; |
2846 | } | 2846 | } |
2847 | } | 2847 | } |
2848 | if (SMSInfo.Entries[0].Settings == NULL) { | 2848 | if (SMSInfo.Entries[0].Settings == NULL) { |
2849 | printmsg("Sorry. No GPRS bearer found in MMS settings\n"); | 2849 | printmsg("Sorry. No GPRS bearer found in MMS settings\n"); |
2850 | exit(-1); | 2850 | exit(-1); |
2851 | } | 2851 | } |
2852 | SMSInfo.Entries[0].ID = SMS_NokiaMMSSettingsLong; | 2852 | SMSInfo.Entries[0].ID = SMS_NokiaMMSSettingsLong; |
2853 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2853 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2854 | EncodeUnicode(Sender, "Settings",8); | 2854 | EncodeUnicode(Sender, "Settings",8); |
2855 | EncodeUnicode(Name,"MMS Settings",12); | 2855 | EncodeUnicode(Name,"MMS Settings",12); |
2856 | } | 2856 | } |
2857 | startarg += 5; | 2857 | startarg += 5; |
2858 | } else if (mystrncasecmp(argv[2],"CALENDAR",0)) { | 2858 | } else if (mystrncasecmp(argv[2],"CALENDAR",0)) { |
2859 | if (argc<5+startarg) { | 2859 | if (argc<5+startarg) { |
2860 | printmsg("Where is backup filename and location ?\n"); | 2860 | printmsg("Where is backup filename and location ?\n"); |
2861 | exit(-1); | 2861 | exit(-1); |
2862 | } | 2862 | } |
2863 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); | 2863 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); |
2864 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 2864 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
2865 | i = 0; | 2865 | i = 0; |
2866 | while (Backup.Calendar[i]!=NULL) { | 2866 | while (Backup.Calendar[i]!=NULL) { |
2867 | if (i == atoi(argv[4+startarg])-1) break; | 2867 | if (i == atoi(argv[4+startarg])-1) break; |
2868 | i++; | 2868 | i++; |
2869 | } | 2869 | } |
2870 | if (i != atoi(argv[4+startarg])-1) { | 2870 | if (i != atoi(argv[4+startarg])-1) { |
2871 | printmsg("Calendar note not found in file\n"); | 2871 | printmsg("Calendar note not found in file\n"); |
2872 | exit(-1); | 2872 | exit(-1); |
2873 | } | 2873 | } |
2874 | SMSInfo.Entries[0].ID = SMS_NokiaVCALENDAR10Long; | 2874 | SMSInfo.Entries[0].ID = SMS_NokiaVCALENDAR10Long; |
2875 | SMSInfo.Entries[0].Calendar = Backup.Calendar[i]; | 2875 | SMSInfo.Entries[0].Calendar = Backup.Calendar[i]; |
2876 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2876 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2877 | EncodeUnicode(Sender, "Calendar",8); | 2877 | EncodeUnicode(Sender, "Calendar",8); |
2878 | } | 2878 | } |
2879 | startarg += 5; | 2879 | startarg += 5; |
2880 | } else if (mystrncasecmp(argv[2],"TODO",0)) { | 2880 | } else if (mystrncasecmp(argv[2],"TODO",0)) { |
2881 | if (argc<5+startarg) { | 2881 | if (argc<5+startarg) { |
2882 | printmsg("Where is backup filename and location ?\n"); | 2882 | printmsg("Where is backup filename and location ?\n"); |
2883 | exit(-1); | 2883 | exit(-1); |
2884 | } | 2884 | } |
2885 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); | 2885 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); |
2886 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 2886 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
2887 | i = 0; | 2887 | i = 0; |
2888 | while (Backup.ToDo[i]!=NULL) { | 2888 | while (Backup.ToDo[i]!=NULL) { |
2889 | if (i == atoi(argv[4+startarg])-1) break; | 2889 | if (i == atoi(argv[4+startarg])-1) break; |
2890 | i++; | 2890 | i++; |
2891 | } | 2891 | } |
2892 | if (i != atoi(argv[4+startarg])-1) { | 2892 | if (i != atoi(argv[4+startarg])-1) { |
2893 | printmsg("ToDo note not found in file\n"); | 2893 | printmsg("ToDo note not found in file\n"); |
2894 | exit(-1); | 2894 | exit(-1); |
2895 | } | 2895 | } |
2896 | SMSInfo.Entries[0].ID = SMS_NokiaVTODOLong; | 2896 | SMSInfo.Entries[0].ID = SMS_NokiaVTODOLong; |
2897 | SMSInfo.Entries[0].ToDo = Backup.ToDo[i]; | 2897 | SMSInfo.Entries[0].ToDo = Backup.ToDo[i]; |
2898 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2898 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2899 | EncodeUnicode(Sender, "ToDo",8); | 2899 | EncodeUnicode(Sender, "ToDo",8); |
2900 | } | 2900 | } |
2901 | startarg += 5; | 2901 | startarg += 5; |
2902 | } else if (mystrncasecmp(argv[2],"VCARD10",0) || mystrncasecmp(argv[2],"VCARD21",0)) { | 2902 | } else if (mystrncasecmp(argv[2],"VCARD10",0) || mystrncasecmp(argv[2],"VCARD21",0)) { |
2903 | if (argc<6+startarg) { | 2903 | if (argc<6+startarg) { |
2904 | printmsg("Where is backup filename and location and memory type ?\n"); | 2904 | printmsg("Where is backup filename and location and memory type ?\n"); |
2905 | exit(-1); | 2905 | exit(-1); |
2906 | } | 2906 | } |
2907 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); | 2907 | error=GSM_ReadBackupFile(argv[3+startarg],&Backup); |
2908 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 2908 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
2909 | i = 0; | 2909 | i = 0; |
2910 | if (mystrncasecmp(argv[4+startarg],"SM",0)) { | 2910 | if (mystrncasecmp(argv[4+startarg],"SM",0)) { |
2911 | while (Backup.SIMPhonebook[i]!=NULL) { | 2911 | while (Backup.SIMPhonebook[i]!=NULL) { |
2912 | if (i == atoi(argv[5+startarg])-1) break; | 2912 | if (i == atoi(argv[5+startarg])-1) break; |
2913 | i++; | 2913 | i++; |
2914 | } | 2914 | } |
2915 | if (i != atoi(argv[5+startarg])-1) { | 2915 | if (i != atoi(argv[5+startarg])-1) { |
2916 | printmsg("Phonebook entry not found in file\n"); | 2916 | printmsg("Phonebook entry not found in file\n"); |
2917 | exit(-1); | 2917 | exit(-1); |
2918 | } | 2918 | } |
2919 | SMSInfo.Entries[0].Phonebook = Backup.SIMPhonebook[i]; | 2919 | SMSInfo.Entries[0].Phonebook = Backup.SIMPhonebook[i]; |
2920 | } else if (mystrncasecmp(argv[4+startarg],"ME",0)) { | 2920 | } else if (mystrncasecmp(argv[4+startarg],"ME",0)) { |
2921 | while (Backup.PhonePhonebook[i]!=NULL) { | 2921 | while (Backup.PhonePhonebook[i]!=NULL) { |
2922 | if (i == atoi(argv[5+startarg])-1) break; | 2922 | if (i == atoi(argv[5+startarg])-1) break; |
2923 | i++; | 2923 | i++; |
2924 | } | 2924 | } |
2925 | if (i != atoi(argv[5+startarg])-1) { | 2925 | if (i != atoi(argv[5+startarg])-1) { |
2926 | printmsg("Phonebook entry not found in file\n"); | 2926 | printmsg("Phonebook entry not found in file\n"); |
2927 | exit(-1); | 2927 | exit(-1); |
2928 | } | 2928 | } |
2929 | SMSInfo.Entries[0].Phonebook = Backup.PhonePhonebook[i]; | 2929 | SMSInfo.Entries[0].Phonebook = Backup.PhonePhonebook[i]; |
2930 | } else { | 2930 | } else { |
2931 | printmsg("Unknown memory type: \"%s\"\n",argv[4+startarg]); | 2931 | printmsg("Unknown memory type: \"%s\"\n",argv[4+startarg]); |
2932 | exit(-1); | 2932 | exit(-1); |
2933 | } | 2933 | } |
2934 | if (mystrncasecmp(argv[2],"VCARD10",0)) { | 2934 | if (mystrncasecmp(argv[2],"VCARD10",0)) { |
2935 | SMSInfo.Entries[0].ID = SMS_VCARD10Long; | 2935 | SMSInfo.Entries[0].ID = SMS_VCARD10Long; |
2936 | } else { | 2936 | } else { |
2937 | SMSInfo.Entries[0].ID = SMS_VCARD21Long; | 2937 | SMSInfo.Entries[0].ID = SMS_VCARD21Long; |
2938 | } | 2938 | } |
2939 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2939 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2940 | EncodeUnicode(Sender, "VCARD",5); | 2940 | EncodeUnicode(Sender, "VCARD",5); |
2941 | EncodeUnicode(Name, "Phonebook entry",15); | 2941 | EncodeUnicode(Name, "Phonebook entry",15); |
2942 | } | 2942 | } |
2943 | startarg += 6; | 2943 | startarg += 6; |
2944 | #endif | 2944 | #endif |
2945 | } else if (mystrncasecmp(argv[2],"PROFILE",0)) { | 2945 | } else if (mystrncasecmp(argv[2],"PROFILE",0)) { |
2946 | SMSInfo.Entries[0].ID = SMS_NokiaProfileLong; | 2946 | SMSInfo.Entries[0].ID = SMS_NokiaProfileLong; |
2947 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2947 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2948 | EncodeUnicode(Sender, "Profile",7); | 2948 | EncodeUnicode(Sender, "Profile",7); |
2949 | } | 2949 | } |
2950 | startarg += 3; | 2950 | startarg += 3; |
2951 | } else { | 2951 | } else { |
2952 | printmsg("What format of sms (\"%s\") ?\n",argv[2]); | 2952 | printmsg("What format of sms (\"%s\") ?\n",argv[2]); |
2953 | exit(-1); | 2953 | exit(-1); |
2954 | } | 2954 | } |
2955 | 2955 | ||
2956 | for (i=startarg;i<argc;i++) { | 2956 | for (i=startarg;i<argc;i++) { |
2957 | switch (nextlong) { | 2957 | switch (nextlong) { |
2958 | case 0: | 2958 | case 0: |
2959 | if (mystrncasecmp(argv[1],"--savesms",0) || SendSaved) { | 2959 | if (mystrncasecmp(argv[1],"--savesms",0) || SendSaved) { |
2960 | if (mystrncasecmp(argv[i],"-folder",0)) { | 2960 | if (mystrncasecmp(argv[i],"-folder",0)) { |
2961 | nextlong=1; | 2961 | nextlong=1; |
2962 | continue; | 2962 | continue; |
2963 | } | 2963 | } |
2964 | } | 2964 | } |
2965 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 2965 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
2966 | if (mystrncasecmp(argv[i],"-unread",0)) { | 2966 | if (mystrncasecmp(argv[i],"-unread",0)) { |
2967 | State = SMS_UnRead; | 2967 | State = SMS_UnRead; |
2968 | continue; | 2968 | continue; |
2969 | } | 2969 | } |
2970 | if (mystrncasecmp(argv[i],"-read",0)) { | 2970 | if (mystrncasecmp(argv[i],"-read",0)) { |
2971 | State = SMS_Read; | 2971 | State = SMS_Read; |
2972 | continue; | 2972 | continue; |
2973 | } | 2973 | } |
2974 | if (mystrncasecmp(argv[i],"-unsent",0)) { | 2974 | if (mystrncasecmp(argv[i],"-unsent",0)) { |
2975 | State = SMS_UnSent; | 2975 | State = SMS_UnSent; |
2976 | continue; | 2976 | continue; |
2977 | } | 2977 | } |
2978 | if (mystrncasecmp(argv[i],"-sent",0)) { | 2978 | if (mystrncasecmp(argv[i],"-sent",0)) { |
2979 | State = SMS_Sent; | 2979 | State = SMS_Sent; |
2980 | continue; | 2980 | continue; |
2981 | } | 2981 | } |
2982 | if (mystrncasecmp(argv[i],"-sender",0)) { | 2982 | if (mystrncasecmp(argv[i],"-sender",0)) { |
2983 | nextlong=2; | 2983 | nextlong=2; |
2984 | continue; | 2984 | continue; |
2985 | } | 2985 | } |
2986 | } else { | 2986 | } else { |
2987 | if (mystrncasecmp(argv[i],"-save",0)) { | 2987 | if (mystrncasecmp(argv[i],"-save",0)) { |
2988 | SendSaved=true; | 2988 | SendSaved=true; |
2989 | continue; | 2989 | continue; |
2990 | } | 2990 | } |
2991 | if (mystrncasecmp(argv[i],"-report",0)) { | 2991 | if (mystrncasecmp(argv[i],"-report",0)) { |
2992 | DeliveryReport=true; | 2992 | DeliveryReport=true; |
2993 | continue; | 2993 | continue; |
2994 | } | 2994 | } |
2995 | if (mystrncasecmp(argv[i],"-validity",0)) { | 2995 | if (mystrncasecmp(argv[i],"-validity",0)) { |
2996 | nextlong=10; | 2996 | nextlong=10; |
2997 | continue; | 2997 | continue; |
2998 | } | 2998 | } |
2999 | } | 2999 | } |
3000 | if (mystrncasecmp(argv[i],"-smscset",0)) { | 3000 | if (mystrncasecmp(argv[i],"-smscset",0)) { |
3001 | nextlong=3; | 3001 | nextlong=3; |
3002 | continue; | 3002 | continue; |
3003 | } | 3003 | } |
3004 | if (mystrncasecmp(argv[i],"-smscnumber",0)) { | 3004 | if (mystrncasecmp(argv[i],"-smscnumber",0)) { |
3005 | nextlong=4; | 3005 | nextlong=4; |
3006 | continue; | 3006 | continue; |
3007 | } | 3007 | } |
3008 | if (mystrncasecmp(argv[i],"-protected",0)) { | 3008 | if (mystrncasecmp(argv[i],"-protected",0)) { |
3009 | nextlong=19; | 3009 | nextlong=19; |
3010 | continue; | 3010 | continue; |
3011 | } | 3011 | } |
3012 | if (mystrncasecmp(argv[i],"-reply",0)) { | 3012 | if (mystrncasecmp(argv[i],"-reply",0)) { |
3013 | ReplyViaSameSMSC=true; | 3013 | ReplyViaSameSMSC=true; |
3014 | continue; | 3014 | continue; |
3015 | } | 3015 | } |
3016 | if (mystrncasecmp(argv[i],"-maxsms",0)) { | 3016 | if (mystrncasecmp(argv[i],"-maxsms",0)) { |
3017 | nextlong=21; | 3017 | nextlong=21; |
3018 | continue; | 3018 | continue; |
3019 | } | 3019 | } |
3020 | if (mystrncasecmp(argv[2],"RINGTONE",0)) { | 3020 | if (mystrncasecmp(argv[2],"RINGTONE",0)) { |
3021 | if (mystrncasecmp(argv[i],"-long",0)) { | 3021 | if (mystrncasecmp(argv[i],"-long",0)) { |
3022 | SMSInfo.Entries[0].ID = SMS_NokiaRingtoneLong; | 3022 | SMSInfo.Entries[0].ID = SMS_NokiaRingtoneLong; |
3023 | break; | 3023 | break; |
3024 | } | 3024 | } |
3025 | if (mystrncasecmp(argv[i],"-scale",0)) { | 3025 | if (mystrncasecmp(argv[i],"-scale",0)) { |
3026 | ringtone[0].NoteTone.AllNotesScale=true; | 3026 | ringtone[0].NoteTone.AllNotesScale=true; |
3027 | break; | 3027 | break; |
3028 | } | 3028 | } |
3029 | } | 3029 | } |
3030 | if (mystrncasecmp(argv[2],"TEXT",0)) { | 3030 | if (mystrncasecmp(argv[2],"TEXT",0)) { |
3031 | if (mystrncasecmp(argv[i],"-inputunicode",0)) { | 3031 | if (mystrncasecmp(argv[i],"-inputunicode",0)) { |
3032 | ReadUnicodeFile(Buffer[0],InputBuffer); | 3032 | ReadUnicodeFile(Buffer[0],InputBuffer); |
3033 | break; | 3033 | break; |
3034 | } | 3034 | } |
3035 | if (mystrncasecmp(argv[i],"-16bit",0)) { | 3035 | if (mystrncasecmp(argv[i],"-16bit",0)) { |
3036 | if (SMSInfo.Entries[0].ID == SMS_ConcatenatedTextLong) SMSInfo.Entries[0].ID = SMS_ConcatenatedTextLong16bit; | 3036 | if (SMSInfo.Entries[0].ID == SMS_ConcatenatedTextLong) SMSInfo.Entries[0].ID = SMS_ConcatenatedTextLong16bit; |
3037 | if (SMSInfo.Entries[0].ID == SMS_ConcatenatedAutoTextLong) SMSInfo.Entries[0].ID = SMS_ConcatenatedAutoTextLong16bit; | 3037 | if (SMSInfo.Entries[0].ID == SMS_ConcatenatedAutoTextLong) SMSInfo.Entries[0].ID = SMS_ConcatenatedAutoTextLong16bit; |
3038 | break; | 3038 | break; |
3039 | } | 3039 | } |
3040 | if (mystrncasecmp(argv[i],"-flash",0)) { | 3040 | if (mystrncasecmp(argv[i],"-flash",0)) { |
3041 | SMSInfo.Class = 0; | 3041 | SMSInfo.Class = 0; |
3042 | break; | 3042 | break; |
3043 | } | 3043 | } |
3044 | if (mystrncasecmp(argv[i],"-len",0)) { | 3044 | if (mystrncasecmp(argv[i],"-len",0)) { |
3045 | nextlong = 5; | 3045 | nextlong = 5; |
3046 | break; | 3046 | break; |
3047 | } | 3047 | } |
3048 | if (mystrncasecmp(argv[i],"-autolen",0)) { | 3048 | if (mystrncasecmp(argv[i],"-autolen",0)) { |
3049 | nextlong = 5; | 3049 | nextlong = 5; |
3050 | break; | 3050 | break; |
3051 | } | 3051 | } |
3052 | if (mystrncasecmp(argv[i],"-unicode",0)) { | 3052 | if (mystrncasecmp(argv[i],"-unicode",0)) { |
3053 | SMSInfo.UnicodeCoding = true; | 3053 | SMSInfo.UnicodeCoding = true; |
3054 | break; | 3054 | break; |
3055 | } | 3055 | } |
3056 | if (mystrncasecmp(argv[i],"-enablevoice",0)) { | 3056 | if (mystrncasecmp(argv[i],"-enablevoice",0)) { |
3057 | SMSInfo.Entries[0].ID = SMS_EnableVoice; | 3057 | SMSInfo.Entries[0].ID = SMS_EnableVoice; |
3058 | break; | 3058 | break; |
3059 | } | 3059 | } |
3060 | if (mystrncasecmp(argv[i],"-disablevoice",0)) { | 3060 | if (mystrncasecmp(argv[i],"-disablevoice",0)) { |
3061 | SMSInfo.Entries[0].ID = SMS_DisableVoice; | 3061 | SMSInfo.Entries[0].ID = SMS_DisableVoice; |
3062 | break; | 3062 | break; |
3063 | } | 3063 | } |
3064 | if (mystrncasecmp(argv[i],"-enablefax",0)) { | 3064 | if (mystrncasecmp(argv[i],"-enablefax",0)) { |
3065 | SMSInfo.Entries[0].ID = SMS_EnableFax; | 3065 | SMSInfo.Entries[0].ID = SMS_EnableFax; |
3066 | break; | 3066 | break; |
3067 | } | 3067 | } |
3068 | if (mystrncasecmp(argv[i],"-disablefax",0)) { | 3068 | if (mystrncasecmp(argv[i],"-disablefax",0)) { |
3069 | SMSInfo.Entries[0].ID = SMS_DisableFax; | 3069 | SMSInfo.Entries[0].ID = SMS_DisableFax; |
3070 | break; | 3070 | break; |
3071 | } | 3071 | } |
3072 | if (mystrncasecmp(argv[i],"-enableemail",0)) { | 3072 | if (mystrncasecmp(argv[i],"-enableemail",0)) { |
3073 | SMSInfo.Entries[0].ID = SMS_EnableEmail; | 3073 | SMSInfo.Entries[0].ID = SMS_EnableEmail; |
3074 | break; | 3074 | break; |
3075 | } | 3075 | } |
3076 | if (mystrncasecmp(argv[i],"-disableemail",0)) { | 3076 | if (mystrncasecmp(argv[i],"-disableemail",0)) { |
3077 | SMSInfo.Entries[0].ID = SMS_DisableEmail; | 3077 | SMSInfo.Entries[0].ID = SMS_DisableEmail; |
3078 | break; | 3078 | break; |
3079 | } | 3079 | } |
3080 | if (mystrncasecmp(argv[i],"-voidsms",0)) { | 3080 | if (mystrncasecmp(argv[i],"-voidsms",0)) { |
3081 | SMSInfo.Entries[0].ID = SMS_VoidSMS; | 3081 | SMSInfo.Entries[0].ID = SMS_VoidSMS; |
3082 | break; | 3082 | break; |
3083 | } | 3083 | } |
3084 | if (mystrncasecmp(argv[i],"-replacemessages",0) && | 3084 | if (mystrncasecmp(argv[i],"-replacemessages",0) && |
3085 | SMSInfo.Entries[0].ID != SMS_ConcatenatedTextLong) { | 3085 | SMSInfo.Entries[0].ID != SMS_ConcatenatedTextLong) { |
3086 | nextlong = 8; | 3086 | nextlong = 8; |
3087 | break; | 3087 | break; |
3088 | } | 3088 | } |
3089 | if (mystrncasecmp(argv[i],"-replacefile",0)) { | 3089 | if (mystrncasecmp(argv[i],"-replacefile",0)) { |
3090 | nextlong = 9; | 3090 | nextlong = 9; |
3091 | continue; | 3091 | continue; |
3092 | } | 3092 | } |
3093 | } | 3093 | } |
3094 | if (mystrncasecmp(argv[2],"PICTURE",0)) { | 3094 | if (mystrncasecmp(argv[2],"PICTURE",0)) { |
3095 | if (mystrncasecmp(argv[i],"-text",0)) { | 3095 | if (mystrncasecmp(argv[i],"-text",0)) { |
3096 | nextlong = 6; | 3096 | nextlong = 6; |
3097 | break; | 3097 | break; |
3098 | } | 3098 | } |
3099 | if (mystrncasecmp(argv[i],"-unicode",0)) { | 3099 | if (mystrncasecmp(argv[i],"-unicode",0)) { |
3100 | SMSInfo.UnicodeCoding = true; | 3100 | SMSInfo.UnicodeCoding = true; |
3101 | break; | 3101 | break; |
3102 | } | 3102 | } |
3103 | if (mystrncasecmp(argv[i],"-alcatelbmmi",0)) { | 3103 | if (mystrncasecmp(argv[i],"-alcatelbmmi",0)) { |
3104 | bitmap[0].Bitmap[0].Type=GSM_StartupLogo; | 3104 | bitmap[0].Bitmap[0].Type=GSM_StartupLogo; |
3105 | error=GSM_ReadBitmapFile(argv[startarg-1],&bitmap[0]); | 3105 | error=GSM_ReadBitmapFile(argv[startarg-1],&bitmap[0]); |
3106 | Print_Error(error); | 3106 | Print_Error(error); |
3107 | SMSInfo.UnicodeCoding = true; | 3107 | SMSInfo.UnicodeCoding = true; |
3108 | SMSInfo.Entries[0].ID = SMS_AlcatelMonoBitmapLong; | 3108 | SMSInfo.Entries[0].ID = SMS_AlcatelMonoBitmapLong; |
3109 | break; | 3109 | break; |
3110 | } | 3110 | } |
3111 | break; | 3111 | break; |
3112 | } | 3112 | } |
3113 | if (mystrncasecmp(argv[2],"VCARD10",0)) { | 3113 | if (mystrncasecmp(argv[2],"VCARD10",0)) { |
3114 | if (mystrncasecmp(argv[i],"-nokia",0)) { | 3114 | if (mystrncasecmp(argv[i],"-nokia",0)) { |
3115 | SMSInfo.Entries[0].ID = SMS_NokiaVCARD10Long; | 3115 | SMSInfo.Entries[0].ID = SMS_NokiaVCARD10Long; |
3116 | break; | 3116 | break; |
3117 | } | 3117 | } |
3118 | break; | 3118 | break; |
3119 | } | 3119 | } |
3120 | if (mystrncasecmp(argv[2],"VCARD21",0)) { | 3120 | if (mystrncasecmp(argv[2],"VCARD21",0)) { |
3121 | if (mystrncasecmp(argv[i],"-nokia",0)) { | 3121 | if (mystrncasecmp(argv[i],"-nokia",0)) { |
3122 | SMSInfo.Entries[0].ID = SMS_NokiaVCARD21Long; | 3122 | SMSInfo.Entries[0].ID = SMS_NokiaVCARD21Long; |
3123 | break; | 3123 | break; |
3124 | } | 3124 | } |
3125 | break; | 3125 | break; |
3126 | } | 3126 | } |
3127 | if (mystrncasecmp(argv[2],"PROFILE",0)) { | 3127 | if (mystrncasecmp(argv[2],"PROFILE",0)) { |
3128 | if (mystrncasecmp(argv[i],"-name",0)) { | 3128 | if (mystrncasecmp(argv[i],"-name",0)) { |
3129 | nextlong = 22; | 3129 | nextlong = 22; |
3130 | break; | 3130 | break; |
3131 | } | 3131 | } |
3132 | if (mystrncasecmp(argv[i],"-ringtone",0)) { | 3132 | if (mystrncasecmp(argv[i],"-ringtone",0)) { |
3133 | nextlong = 23; | 3133 | nextlong = 23; |
3134 | break; | 3134 | break; |
3135 | } | 3135 | } |
3136 | if (mystrncasecmp(argv[i],"-bitmap",0)) { | 3136 | if (mystrncasecmp(argv[i],"-bitmap",0)) { |
3137 | nextlong = 24; | 3137 | nextlong = 24; |
3138 | break; | 3138 | break; |
3139 | } | 3139 | } |
3140 | } | 3140 | } |
3141 | if (mystrncasecmp(argv[2],"SMSTEMPLATE",0)) { | 3141 | if (mystrncasecmp(argv[2],"SMSTEMPLATE",0)) { |
3142 | if (mystrncasecmp(argv[i],"-unicode",0)) { | 3142 | if (mystrncasecmp(argv[i],"-unicode",0)) { |
3143 | SMSInfo.UnicodeCoding = true; | 3143 | SMSInfo.UnicodeCoding = true; |
3144 | break; | 3144 | break; |
3145 | } | 3145 | } |
3146 | if (mystrncasecmp(argv[i],"-text",0)) { | 3146 | if (mystrncasecmp(argv[i],"-text",0)) { |
3147 | nextlong = 11; | 3147 | nextlong = 11; |
3148 | break; | 3148 | break; |
3149 | } | 3149 | } |
3150 | if (mystrncasecmp(argv[i],"-unicodefiletext",0)) { | 3150 | if (mystrncasecmp(argv[i],"-unicodefiletext",0)) { |
3151 | nextlong = 18; | 3151 | nextlong = 18; |
3152 | break; | 3152 | break; |
3153 | } | 3153 | } |
3154 | if (mystrncasecmp(argv[i],"-defsound",0)) { | 3154 | if (mystrncasecmp(argv[i],"-defsound",0)) { |
3155 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSPredefinedSound; | 3155 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSPredefinedSound; |
3156 | nextlong = 12; | 3156 | nextlong = 12; |
3157 | break; | 3157 | break; |
3158 | } | 3158 | } |
3159 | if (mystrncasecmp(argv[i],"-defanimation",0)) { | 3159 | if (mystrncasecmp(argv[i],"-defanimation",0)) { |
3160 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSPredefinedAnimation; | 3160 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSPredefinedAnimation; |
3161 | nextlong = 12; | 3161 | nextlong = 12; |
3162 | break; | 3162 | break; |
3163 | } | 3163 | } |
3164 | if (mystrncasecmp(argv[i],"-tone10",0)) { | 3164 | if (mystrncasecmp(argv[i],"-tone10",0)) { |
3165 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10; | 3165 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10; |
3166 | if (Protected != 0) { | 3166 | if (Protected != 0) { |
3167 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3167 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3168 | Protected --; | 3168 | Protected --; |
3169 | } | 3169 | } |
3170 | nextlong = 14; | 3170 | nextlong = 14; |
3171 | break; | 3171 | break; |
3172 | } | 3172 | } |
3173 | if (mystrncasecmp(argv[i],"-tone10long",0)) { | 3173 | if (mystrncasecmp(argv[i],"-tone10long",0)) { |
3174 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10Long; | 3174 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10Long; |
3175 | if (Protected != 0) { | 3175 | if (Protected != 0) { |
3176 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3176 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3177 | Protected --; | 3177 | Protected --; |
3178 | } | 3178 | } |
3179 | nextlong = 14; | 3179 | nextlong = 14; |
3180 | break; | 3180 | break; |
3181 | } | 3181 | } |
3182 | if (mystrncasecmp(argv[i],"-tone12",0)) { | 3182 | if (mystrncasecmp(argv[i],"-tone12",0)) { |
3183 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12; | 3183 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12; |
3184 | if (Protected != 0) { | 3184 | if (Protected != 0) { |
3185 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3185 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3186 | Protected --; | 3186 | Protected --; |
3187 | } | 3187 | } |
3188 | nextlong = 14; | 3188 | nextlong = 14; |
3189 | break; | 3189 | break; |
3190 | } | 3190 | } |
3191 | if (mystrncasecmp(argv[i],"-tone12long",0)) { | 3191 | if (mystrncasecmp(argv[i],"-tone12long",0)) { |
3192 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12Long; | 3192 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12Long; |
3193 | if (Protected != 0) { | 3193 | if (Protected != 0) { |
3194 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3194 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3195 | Protected --; | 3195 | Protected --; |
3196 | } | 3196 | } |
3197 | nextlong = 14; | 3197 | nextlong = 14; |
3198 | break; | 3198 | break; |
3199 | } | 3199 | } |
3200 | if (mystrncasecmp(argv[i],"-toneSE",0)) { | 3200 | if (mystrncasecmp(argv[i],"-toneSE",0)) { |
3201 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSound; | 3201 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSound; |
3202 | if (Protected != 0) { | 3202 | if (Protected != 0) { |
3203 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3203 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3204 | Protected --; | 3204 | Protected --; |
3205 | } | 3205 | } |
3206 | nextlong = 14; | 3206 | nextlong = 14; |
3207 | break; | 3207 | break; |
3208 | } | 3208 | } |
3209 | if (mystrncasecmp(argv[i],"-toneSElong",0)) { | 3209 | if (mystrncasecmp(argv[i],"-toneSElong",0)) { |
3210 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSoundLong; | 3210 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSoundLong; |
3211 | if (Protected != 0) { | 3211 | if (Protected != 0) { |
3212 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3212 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3213 | Protected --; | 3213 | Protected --; |
3214 | } | 3214 | } |
3215 | nextlong = 14; | 3215 | nextlong = 14; |
3216 | break; | 3216 | break; |
3217 | } | 3217 | } |
3218 | if (mystrncasecmp(argv[i],"-variablebitmap",0)) { | 3218 | if (mystrncasecmp(argv[i],"-variablebitmap",0)) { |
3219 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmap; | 3219 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmap; |
3220 | if (Protected != 0) { | 3220 | if (Protected != 0) { |
3221 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3221 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3222 | Protected --; | 3222 | Protected --; |
3223 | } | 3223 | } |
3224 | nextlong = 15; | 3224 | nextlong = 15; |
3225 | break; | 3225 | break; |
3226 | } | 3226 | } |
3227 | if (mystrncasecmp(argv[i],"-variablebitmaplong",0)) { | 3227 | if (mystrncasecmp(argv[i],"-variablebitmaplong",0)) { |
3228 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmapLong; | 3228 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmapLong; |
3229 | if (Protected != 0) { | 3229 | if (Protected != 0) { |
3230 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3230 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3231 | Protected --; | 3231 | Protected --; |
3232 | } | 3232 | } |
3233 | nextlong = 15; | 3233 | nextlong = 15; |
3234 | break; | 3234 | break; |
3235 | } | 3235 | } |
3236 | if (mystrncasecmp(argv[i],"-animation",0)) { | 3236 | if (mystrncasecmp(argv[i],"-animation",0)) { |
3237 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSAnimation; | 3237 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSAnimation; |
3238 | if (Protected != 0) { | 3238 | if (Protected != 0) { |
3239 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3239 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3240 | Protected --; | 3240 | Protected --; |
3241 | } | 3241 | } |
3242 | bitmap[SMSInfo.EntriesNum].Number = 0; | 3242 | bitmap[SMSInfo.EntriesNum].Number = 0; |
3243 | nextlong = 16; | 3243 | nextlong = 16; |
3244 | break; | 3244 | break; |
3245 | } | 3245 | } |
3246 | } | 3246 | } |
3247 | if (mystrncasecmp(argv[2],"EMS",0)) { | 3247 | if (mystrncasecmp(argv[2],"EMS",0)) { |
3248 | if (mystrncasecmp(argv[i],"-unicode",0)) { | 3248 | if (mystrncasecmp(argv[i],"-unicode",0)) { |
3249 | SMSInfo.UnicodeCoding = true; | 3249 | SMSInfo.UnicodeCoding = true; |
3250 | break; | 3250 | break; |
3251 | } | 3251 | } |
3252 | if (mystrncasecmp(argv[i],"-16bit",0)) { | 3252 | if (mystrncasecmp(argv[i],"-16bit",0)) { |
3253 | EMS16Bit = true; | 3253 | EMS16Bit = true; |
3254 | break; | 3254 | break; |
3255 | } | 3255 | } |
3256 | if (mystrncasecmp(argv[i],"-format",0)) { | 3256 | if (mystrncasecmp(argv[i],"-format",0)) { |
3257 | nextlong = 20; | 3257 | nextlong = 20; |
3258 | break; | 3258 | break; |
3259 | } | 3259 | } |
3260 | if (mystrncasecmp(argv[i],"-text",0)) { | 3260 | if (mystrncasecmp(argv[i],"-text",0)) { |
3261 | nextlong = 11; | 3261 | nextlong = 11; |
3262 | break; | 3262 | break; |
3263 | } | 3263 | } |
3264 | if (mystrncasecmp(argv[i],"-unicodefiletext",0)) { | 3264 | if (mystrncasecmp(argv[i],"-unicodefiletext",0)) { |
3265 | nextlong = 18; | 3265 | nextlong = 18; |
3266 | break; | 3266 | break; |
3267 | } | 3267 | } |
3268 | if (mystrncasecmp(argv[i],"-defsound",0)) { | 3268 | if (mystrncasecmp(argv[i],"-defsound",0)) { |
3269 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSPredefinedSound; | 3269 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSPredefinedSound; |
3270 | nextlong = 12; | 3270 | nextlong = 12; |
3271 | break; | 3271 | break; |
3272 | } | 3272 | } |
3273 | if (mystrncasecmp(argv[i],"-defanimation",0)) { | 3273 | if (mystrncasecmp(argv[i],"-defanimation",0)) { |
3274 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSPredefinedAnimation; | 3274 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSPredefinedAnimation; |
3275 | nextlong = 12; | 3275 | nextlong = 12; |
3276 | break; | 3276 | break; |
3277 | } | 3277 | } |
3278 | if (mystrncasecmp(argv[i],"-tone10",0)) { | 3278 | if (mystrncasecmp(argv[i],"-tone10",0)) { |
3279 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10; | 3279 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10; |
3280 | if (Protected != 0) { | 3280 | if (Protected != 0) { |
3281 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3281 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3282 | Protected --; | 3282 | Protected --; |
3283 | } | 3283 | } |
3284 | nextlong = 14; | 3284 | nextlong = 14; |
3285 | break; | 3285 | break; |
3286 | } | 3286 | } |
3287 | if (mystrncasecmp(argv[i],"-tone10long",0)) { | 3287 | if (mystrncasecmp(argv[i],"-tone10long",0)) { |
3288 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10Long; | 3288 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10Long; |
3289 | if (Protected != 0) { | 3289 | if (Protected != 0) { |
3290 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3290 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3291 | Protected --; | 3291 | Protected --; |
3292 | } | 3292 | } |
3293 | nextlong = 14; | 3293 | nextlong = 14; |
3294 | break; | 3294 | break; |
3295 | } | 3295 | } |
3296 | if (mystrncasecmp(argv[i],"-tone12",0)) { | 3296 | if (mystrncasecmp(argv[i],"-tone12",0)) { |
3297 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12; | 3297 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12; |
3298 | if (Protected != 0) { | 3298 | if (Protected != 0) { |
3299 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3299 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3300 | Protected --; | 3300 | Protected --; |
3301 | } | 3301 | } |
3302 | nextlong = 14; | 3302 | nextlong = 14; |
3303 | break; | 3303 | break; |
3304 | } | 3304 | } |
3305 | if (mystrncasecmp(argv[i],"-tone12long",0)) { | 3305 | if (mystrncasecmp(argv[i],"-tone12long",0)) { |
3306 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12Long; | 3306 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12Long; |
3307 | if (Protected != 0) { | 3307 | if (Protected != 0) { |
3308 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3308 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3309 | Protected --; | 3309 | Protected --; |
3310 | } | 3310 | } |
3311 | nextlong = 14; | 3311 | nextlong = 14; |
3312 | break; | 3312 | break; |
3313 | } | 3313 | } |
3314 | if (mystrncasecmp(argv[i],"-toneSE",0)) { | 3314 | if (mystrncasecmp(argv[i],"-toneSE",0)) { |
3315 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSound; | 3315 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSound; |
3316 | if (Protected != 0) { | 3316 | if (Protected != 0) { |
3317 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3317 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3318 | Protected --; | 3318 | Protected --; |
3319 | } | 3319 | } |
3320 | nextlong = 14; | 3320 | nextlong = 14; |
3321 | break; | 3321 | break; |
3322 | } | 3322 | } |
3323 | if (mystrncasecmp(argv[i],"-toneSElong",0)) { | 3323 | if (mystrncasecmp(argv[i],"-toneSElong",0)) { |
3324 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSoundLong; | 3324 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSoundLong; |
3325 | if (Protected != 0) { | 3325 | if (Protected != 0) { |
3326 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3326 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3327 | Protected --; | 3327 | Protected --; |
3328 | } | 3328 | } |
3329 | nextlong = 14; | 3329 | nextlong = 14; |
3330 | break; | 3330 | break; |
3331 | } | 3331 | } |
3332 | if (mystrncasecmp(argv[i],"-fixedbitmap",0)) { | 3332 | if (mystrncasecmp(argv[i],"-fixedbitmap",0)) { |
3333 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSFixedBitmap; | 3333 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSFixedBitmap; |
3334 | if (Protected != 0) { | 3334 | if (Protected != 0) { |
3335 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3335 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3336 | Protected --; | 3336 | Protected --; |
3337 | } | 3337 | } |
3338 | nextlong = 15; | 3338 | nextlong = 15; |
3339 | break; | 3339 | break; |
3340 | } | 3340 | } |
3341 | if (mystrncasecmp(argv[i],"-variablebitmap",0)) { | 3341 | if (mystrncasecmp(argv[i],"-variablebitmap",0)) { |
3342 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmap; | 3342 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmap; |
3343 | if (Protected != 0) { | 3343 | if (Protected != 0) { |
3344 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3344 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3345 | Protected --; | 3345 | Protected --; |
3346 | } | 3346 | } |
3347 | nextlong = 15; | 3347 | nextlong = 15; |
3348 | break; | 3348 | break; |
3349 | } | 3349 | } |
3350 | if (mystrncasecmp(argv[i],"-variablebitmaplong",0)) { | 3350 | if (mystrncasecmp(argv[i],"-variablebitmaplong",0)) { |
3351 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmapLong; | 3351 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmapLong; |
3352 | if (Protected != 0) { | 3352 | if (Protected != 0) { |
3353 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3353 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3354 | Protected --; | 3354 | Protected --; |
3355 | } | 3355 | } |
3356 | nextlong = 15; | 3356 | nextlong = 15; |
3357 | break; | 3357 | break; |
3358 | } | 3358 | } |
3359 | if (mystrncasecmp(argv[i],"-animation",0)) { | 3359 | if (mystrncasecmp(argv[i],"-animation",0)) { |
3360 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSAnimation; | 3360 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSAnimation; |
3361 | if (Protected != 0) { | 3361 | if (Protected != 0) { |
3362 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; | 3362 | SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; |
3363 | Protected --; | 3363 | Protected --; |
3364 | } | 3364 | } |
3365 | bitmap[SMSInfo.EntriesNum].Number = 0; | 3365 | bitmap[SMSInfo.EntriesNum].Number = 0; |
3366 | nextlong = 16; | 3366 | nextlong = 16; |
3367 | break; | 3367 | break; |
3368 | } | 3368 | } |
3369 | } | 3369 | } |
3370 | if (mystrncasecmp(argv[2],"OPERATOR",0)) { | 3370 | if (mystrncasecmp(argv[2],"OPERATOR",0)) { |
3371 | if (mystrncasecmp(argv[i],"-netcode",0)) { | 3371 | if (mystrncasecmp(argv[i],"-netcode",0)) { |
3372 | nextlong = 7; | 3372 | nextlong = 7; |
3373 | break; | 3373 | break; |
3374 | } | 3374 | } |
3375 | if (mystrncasecmp(argv[i],"-biglogo",0)) { | 3375 | if (mystrncasecmp(argv[i],"-biglogo",0)) { |
3376 | SMSInfo.Entries[0].ID = SMS_NokiaOperatorLogoLong; | 3376 | SMSInfo.Entries[0].ID = SMS_NokiaOperatorLogoLong; |
3377 | break; | 3377 | break; |
3378 | } | 3378 | } |
3379 | break; | 3379 | break; |
3380 | } | 3380 | } |
3381 | printmsg("Unknown parameter (\"%s\")\n",argv[i]); | 3381 | printmsg("Unknown parameter (\"%s\")\n",argv[i]); |
3382 | exit(-1); | 3382 | exit(-1); |
3383 | break; | 3383 | break; |
3384 | case 1: /* SMS folder - only during saving SMS */ | 3384 | case 1: /* SMS folder - only during saving SMS */ |
3385 | Folder = atoi(argv[i]); | 3385 | Folder = atoi(argv[i]); |
3386 | nextlong = 0; | 3386 | nextlong = 0; |
3387 | break; | 3387 | break; |
3388 | case 2: /* Sender number - only during saving SMS */ | 3388 | case 2: /* Sender number - only during saving SMS */ |
3389 | EncodeUnicode(Sender,argv[i],strlen(argv[i])); | 3389 | EncodeUnicode(Sender,argv[i],strlen(argv[i])); |
3390 | nextlong = 0; | 3390 | nextlong = 0; |
3391 | break; | 3391 | break; |
3392 | case 3: /* SMSC set number */ | 3392 | case 3: /* SMSC set number */ |
3393 | SMSCSet = atoi(argv[i]); | 3393 | SMSCSet = atoi(argv[i]); |
3394 | nextlong = 0; | 3394 | nextlong = 0; |
3395 | break; | 3395 | break; |
3396 | case 4: /* Number of SMSC */ | 3396 | case 4: /* Number of SMSC */ |
3397 | EncodeUnicode(SMSC,argv[i],strlen(argv[i])); | 3397 | EncodeUnicode(SMSC,argv[i],strlen(argv[i])); |
3398 | SMSCSet = 0; | 3398 | SMSCSet = 0; |
3399 | nextlong= 0; | 3399 | nextlong= 0; |
3400 | break; | 3400 | break; |
3401 | case 5: /* Length of text SMS */ | 3401 | case 5: /* Length of text SMS */ |
3402 | if (atoi(argv[i])<chars_read) | 3402 | if (atoi(argv[i])<chars_read) |
3403 | { | 3403 | { |
3404 | Buffer[0][atoi(argv[i])*2]= 0x00; | 3404 | Buffer[0][atoi(argv[i])*2]= 0x00; |
3405 | Buffer[0][atoi(argv[i])*2+1]= 0x00; | 3405 | Buffer[0][atoi(argv[i])*2+1]= 0x00; |
3406 | } | 3406 | } |
3407 | SMSInfo.Entries[0].ID = SMS_ConcatenatedTextLong; | 3407 | SMSInfo.Entries[0].ID = SMS_ConcatenatedTextLong; |
3408 | if (mystrncasecmp(argv[i-1],"-autolen",0)) SMSInfo.Entries[0].ID = SMS_ConcatenatedAutoTextLong; | 3408 | if (mystrncasecmp(argv[i-1],"-autolen",0)) SMSInfo.Entries[0].ID = SMS_ConcatenatedAutoTextLong; |
3409 | nextlong = 0; | 3409 | nextlong = 0; |
3410 | break; | 3410 | break; |
3411 | case 6:/* Picture Images - text */ | 3411 | case 6:/* Picture Images - text */ |
3412 | EncodeUnicode(bitmap[0].Bitmap[0].Text,argv[i],strlen(argv[i])); | 3412 | EncodeUnicode(bitmap[0].Bitmap[0].Text,argv[i],strlen(argv[i])); |
3413 | nextlong = 0; | 3413 | nextlong = 0; |
3414 | break; | 3414 | break; |
3415 | case 7:/* Operator Logo - network code */ | 3415 | case 7:/* Operator Logo - network code */ |
3416 | strncpy(bitmap[0].Bitmap[0].NetworkCode,argv[i],7); | 3416 | strncpy(bitmap[0].Bitmap[0].NetworkCode,argv[i],7); |
3417 | if (!strcmp(DecodeUnicodeConsole(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)),"unknown")) { | 3417 | if (!strcmp(DecodeUnicodeConsole(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)),"unknown")) { |
3418 | printmsg("Unknown GSM network code (\"%s\")\n",argv[i]); | 3418 | printmsg("Unknown GSM network code (\"%s\")\n",argv[i]); |
3419 | exit(-1); | 3419 | exit(-1); |
3420 | } | 3420 | } |
3421 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 3421 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
3422 | EncodeUnicode(Sender, "OpLogo",6); | 3422 | EncodeUnicode(Sender, "OpLogo",6); |
3423 | EncodeUnicode(Sender+6*2,bitmap[0].Bitmap[0].NetworkCode,3); | 3423 | EncodeUnicode(Sender+6*2,bitmap[0].Bitmap[0].NetworkCode,3); |
3424 | EncodeUnicode(Sender+6*2+3*2,bitmap[0].Bitmap[0].NetworkCode+4,2); | 3424 | EncodeUnicode(Sender+6*2+3*2,bitmap[0].Bitmap[0].NetworkCode+4,2); |
3425 | if (UnicodeLength(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode))<GSM_MAX_SMS_NAME_LENGTH-7) { | 3425 | if (UnicodeLength(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode))<GSM_MAX_SMS_NAME_LENGTH-7) { |
3426 | EncodeUnicode(Name,"OpLogo ",7); | 3426 | EncodeUnicode(Name,"OpLogo ",7); |
3427 | CopyUnicodeString(Name+7*2,GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)); | 3427 | CopyUnicodeString(Name+7*2,GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)); |
3428 | } else { | 3428 | } else { |
3429 | CopyUnicodeString(Name,Sender); | 3429 | CopyUnicodeString(Name,Sender); |
3430 | } | 3430 | } |
3431 | } | 3431 | } |
3432 | nextlong = 0; | 3432 | nextlong = 0; |
3433 | break; | 3433 | break; |
3434 | case 8:/* Reject duplicates ID */ | 3434 | case 8:/* Reject duplicates ID */ |
3435 | SMSInfo.ReplaceMessage = atoi(argv[i]); | 3435 | SMSInfo.ReplaceMessage = atoi(argv[i]); |
3436 | if (SMSInfo.ReplaceMessage < 1 || SMSInfo.ReplaceMessage > 7) { | 3436 | if (SMSInfo.ReplaceMessage < 1 || SMSInfo.ReplaceMessage > 7) { |
3437 | printmsg("You have to give number between 1 and 7 (\"%s\")\n",argv[i]); | 3437 | printmsg("You have to give number between 1 and 7 (\"%s\")\n",argv[i]); |
3438 | exit(-1); | 3438 | exit(-1); |
3439 | } | 3439 | } |
3440 | nextlong = 0; | 3440 | nextlong = 0; |
3441 | break; | 3441 | break; |
3442 | case 9:/* Replace file for text SMS */ | 3442 | case 9:/* Replace file for text SMS */ |
3443 | ReplaceFile = fopen(argv[i], "rb"); | 3443 | ReplaceFile = fopen(argv[i], "rb"); |
3444 | if (ReplaceFile == NULL) Print_Error(ERR_CANTOPENFILE); | 3444 | if (ReplaceFile == NULL) Print_Error(ERR_CANTOPENFILE); |
3445 | memset(ReplaceBuffer,0,sizeof(ReplaceBuffer)); | 3445 | memset(ReplaceBuffer,0,sizeof(ReplaceBuffer)); |
3446 | fread(ReplaceBuffer,1,sizeof(ReplaceBuffer),ReplaceFile); | 3446 | fread(ReplaceBuffer,1,sizeof(ReplaceBuffer),ReplaceFile); |
3447 | fclose(ReplaceFile); | 3447 | fclose(ReplaceFile); |
3448 | ReadUnicodeFile(ReplaceBuffer2,ReplaceBuffer); | 3448 | ReadUnicodeFile(ReplaceBuffer2,ReplaceBuffer); |
3449 | for(j=0;j<(int)(UnicodeLength(Buffer[0]));j++) { | 3449 | for(j=0;j<(int)(UnicodeLength(Buffer[0]));j++) { |
3450 | for (z=0;z<(int)(UnicodeLength(ReplaceBuffer2)/2);z++) { | 3450 | for (z=0;z<(int)(UnicodeLength(ReplaceBuffer2)/2);z++) { |
3451 | if (ReplaceBuffer2[z*4] == Buffer[0][j] && | 3451 | if (ReplaceBuffer2[z*4] == Buffer[0][j] && |
3452 | ReplaceBuffer2[z*4+1] == Buffer[0][j+1]) { | 3452 | ReplaceBuffer2[z*4+1] == Buffer[0][j+1]) { |
3453 | Buffer[0][j] = ReplaceBuffer2[z*4+2]; | 3453 | Buffer[0][j] = ReplaceBuffer2[z*4+2]; |
3454 | Buffer[0][j+1] = ReplaceBuffer2[z*4+3]; | 3454 | Buffer[0][j+1] = ReplaceBuffer2[z*4+3]; |
3455 | break; | 3455 | break; |
3456 | } | 3456 | } |
3457 | } | 3457 | } |
3458 | } | 3458 | } |
3459 | nextlong = 0; | 3459 | nextlong = 0; |
3460 | break; | 3460 | break; |
3461 | case 10: | 3461 | case 10: |
3462 | Validity.Format = SMS_Validity_RelativeFormat; | 3462 | Validity.Format = SMS_Validity_RelativeFormat; |
3463 | if (mystrncasecmp(argv[i],"HOUR",0)) Validity.Relative = SMS_VALID_1_Hour; | 3463 | if (mystrncasecmp(argv[i],"HOUR",0)) Validity.Relative = SMS_VALID_1_Hour; |
3464 | else if (mystrncasecmp(argv[i],"6HOURS",0))Validity.Relative = SMS_VALID_6_Hours; | 3464 | else if (mystrncasecmp(argv[i],"6HOURS",0))Validity.Relative = SMS_VALID_6_Hours; |
3465 | else if (mystrncasecmp(argv[i],"DAY",0)) Validity.Relative = SMS_VALID_1_Day; | 3465 | else if (mystrncasecmp(argv[i],"DAY",0)) Validity.Relative = SMS_VALID_1_Day; |
3466 | else if (mystrncasecmp(argv[i],"3DAYS",0)) Validity.Relative = SMS_VALID_3_Days; | 3466 | else if (mystrncasecmp(argv[i],"3DAYS",0)) Validity.Relative = SMS_VALID_3_Days; |
3467 | else if (mystrncasecmp(argv[i],"WEEK",0)) Validity.Relative = SMS_VALID_1_Week; | 3467 | else if (mystrncasecmp(argv[i],"WEEK",0)) Validity.Relative = SMS_VALID_1_Week; |
3468 | else if (mystrncasecmp(argv[i],"MAX",0)) Validity.Relative = SMS_VALID_Max_Time; | 3468 | else if (mystrncasecmp(argv[i],"MAX",0)) Validity.Relative = SMS_VALID_Max_Time; |
3469 | else { | 3469 | else { |
3470 | printmsg("Unknown validity string (\"%s\")\n",argv[i]); | 3470 | printmsg("Unknown validity string (\"%s\")\n",argv[i]); |
3471 | exit(-1); | 3471 | exit(-1); |
3472 | } | 3472 | } |
3473 | nextlong = 0; | 3473 | nextlong = 0; |
3474 | break; | 3474 | break; |
3475 | case 11:/* EMS text from parameter */ | 3475 | case 11:/* EMS text from parameter */ |
3476 | EncodeUnicode(Buffer[SMSInfo.EntriesNum],argv[i],strlen(argv[i])); | 3476 | EncodeUnicode(Buffer[SMSInfo.EntriesNum],argv[i],strlen(argv[i])); |
3477 | dbgprintf("buffer is \"%s\"\n",DecodeUnicodeConsole(Buffer[SMSInfo.EntriesNum])); | 3477 | dbgprintf("buffer is \"%s\"\n",DecodeUnicodeConsole(Buffer[SMSInfo.EntriesNum])); |
3478 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_ConcatenatedTextLong; | 3478 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_ConcatenatedTextLong; |
3479 | SMSInfo.Entries[SMSInfo.EntriesNum].Buffer = Buffer[SMSInfo.EntriesNum]; | 3479 | SMSInfo.Entries[SMSInfo.EntriesNum].Buffer = Buffer[SMSInfo.EntriesNum]; |
3480 | SMSInfo.EntriesNum++; | 3480 | SMSInfo.EntriesNum++; |
3481 | nextlong = 0; | 3481 | nextlong = 0; |
3482 | break; | 3482 | break; |
3483 | case 12:/* EMS predefined sound/animation number */ | 3483 | case 12:/* EMS predefined sound/animation number */ |
3484 | SMSInfo.Entries[SMSInfo.EntriesNum].Number = atoi(argv[i]); | 3484 | SMSInfo.Entries[SMSInfo.EntriesNum].Number = atoi(argv[i]); |
3485 | SMSInfo.EntriesNum++; | 3485 | SMSInfo.EntriesNum++; |
3486 | nextlong = 0; | 3486 | nextlong = 0; |
3487 | break; | 3487 | break; |
3488 | case 14: /* EMS ringtone - IMelody */ | 3488 | case 14: /* EMS ringtone - IMelody */ |
3489 | ringtone[SMSInfo.EntriesNum].Format=RING_NOTETONE; | 3489 | ringtone[SMSInfo.EntriesNum].Format=RING_NOTETONE; |
3490 | error=GSM_ReadRingtoneFile(argv[i],&ringtone[SMSInfo.EntriesNum]); | 3490 | error=GSM_ReadRingtoneFile(argv[i],&ringtone[SMSInfo.EntriesNum]); |
3491 | Print_Error(error); | 3491 | Print_Error(error); |
3492 | SMSInfo.Entries[SMSInfo.EntriesNum].Ringtone = &ringtone[SMSInfo.EntriesNum]; | 3492 | SMSInfo.Entries[SMSInfo.EntriesNum].Ringtone = &ringtone[SMSInfo.EntriesNum]; |
3493 | SMSInfo.EntriesNum++; | 3493 | SMSInfo.EntriesNum++; |
3494 | nextlong = 0; | 3494 | nextlong = 0; |
3495 | break; | 3495 | break; |
3496 | case 15:/* EMS bitmap file */ | 3496 | case 15:/* EMS bitmap file */ |
3497 | bitmap[SMSInfo.EntriesNum].Bitmap[0].Type=GSM_StartupLogo; | 3497 | bitmap[SMSInfo.EntriesNum].Bitmap[0].Type=GSM_StartupLogo; |
3498 | error=GSM_ReadBitmapFile(argv[i],&bitmap[SMSInfo.EntriesNum]); | 3498 | error=GSM_ReadBitmapFile(argv[i],&bitmap[SMSInfo.EntriesNum]); |
3499 | Print_Error(error); | 3499 | Print_Error(error); |
3500 | SMSInfo.Entries[SMSInfo.EntriesNum].Bitmap = &bitmap[SMSInfo.EntriesNum]; | 3500 | SMSInfo.Entries[SMSInfo.EntriesNum].Bitmap = &bitmap[SMSInfo.EntriesNum]; |
3501 | SMSInfo.EntriesNum++; | 3501 | SMSInfo.EntriesNum++; |
3502 | nextlong = 0; | 3502 | nextlong = 0; |
3503 | break; | 3503 | break; |
3504 | case 16:/* Number of frames for EMS animation */ | 3504 | case 16:/* Number of frames for EMS animation */ |
3505 | FramesNum = atoi(argv[i]); | 3505 | FramesNum = atoi(argv[i]); |
3506 | if (FramesNum < 1 || FramesNum > 4) { | 3506 | if (FramesNum < 1 || FramesNum > 4) { |
3507 | printmsg("You have to give number of EMS frames between 1 and 4 (\"%s\")\n",argv[i]); | 3507 | printmsg("You have to give number of EMS frames between 1 and 4 (\"%s\")\n",argv[i]); |
3508 | exit(-1); | 3508 | exit(-1); |
3509 | } | 3509 | } |
3510 | bitmap[SMSInfo.EntriesNum].Number = 0; | 3510 | bitmap[SMSInfo.EntriesNum].Number = 0; |
3511 | nextlong = 17; | 3511 | nextlong = 17; |
3512 | break; | 3512 | break; |
3513 | case 17:/*File for EMS animation */ | 3513 | case 17:/*File for EMS animation */ |
3514 | bitmap2.Bitmap[0].Type=GSM_StartupLogo; | 3514 | bitmap2.Bitmap[0].Type=GSM_StartupLogo; |
3515 | error=GSM_ReadBitmapFile(argv[i],&bitmap2); | 3515 | error=GSM_ReadBitmapFile(argv[i],&bitmap2); |
3516 | for (j=0;j<bitmap2.Number;j++) { | 3516 | for (j=0;j<bitmap2.Number;j++) { |
3517 | if (bitmap[SMSInfo.EntriesNum].Number == FramesNum) break; | 3517 | if (bitmap[SMSInfo.EntriesNum].Number == FramesNum) break; |
3518 | memcpy(&bitmap[SMSInfo.EntriesNum].Bitmap[bitmap[SMSInfo.EntriesNum].Number],&bitmap2.Bitmap[j],sizeof(GSM_Bitmap)); | 3518 | memcpy(&bitmap[SMSInfo.EntriesNum].Bitmap[bitmap[SMSInfo.EntriesNum].Number],&bitmap2.Bitmap[j],sizeof(GSM_Bitmap)); |
3519 | bitmap[SMSInfo.EntriesNum].Number++; | 3519 | bitmap[SMSInfo.EntriesNum].Number++; |
3520 | } | 3520 | } |
3521 | if (bitmap[SMSInfo.EntriesNum].Number == FramesNum) { | 3521 | if (bitmap[SMSInfo.EntriesNum].Number == FramesNum) { |
3522 | SMSInfo.Entries[SMSInfo.EntriesNum].Bitmap = &bitmap[SMSInfo.EntriesNum]; | 3522 | SMSInfo.Entries[SMSInfo.EntriesNum].Bitmap = &bitmap[SMSInfo.EntriesNum]; |
3523 | SMSInfo.EntriesNum++; | 3523 | SMSInfo.EntriesNum++; |
3524 | nextlong = 0; | 3524 | nextlong = 0; |
3525 | } | 3525 | } |
3526 | break; | 3526 | break; |
3527 | case 18:/* EMS text from Unicode file */ | 3527 | case 18:/* EMS text from Unicode file */ |
3528 | f = fopen(argv[i],"rb"); | 3528 | f = fopen(argv[i],"rb"); |
3529 | if (f == NULL) { | 3529 | if (f == NULL) { |
3530 | printmsg("Can't open file \"%s\"\n",argv[i]); | 3530 | printmsg("Can't open file \"%s\"\n",argv[i]); |
3531 | exit(-1); | 3531 | exit(-1); |
3532 | } | 3532 | } |
3533 | z=fread(InputBuffer,1,2000,f); | 3533 | z=fread(InputBuffer,1,2000,f); |
3534 | InputBuffer[z] = 0; | 3534 | InputBuffer[z] = 0; |
3535 | InputBuffer[z+1] = 0; | 3535 | InputBuffer[z+1] = 0; |
3536 | fclose(f); | 3536 | fclose(f); |
3537 | ReadUnicodeFile(Buffer[SMSInfo.EntriesNum],InputBuffer); | 3537 | ReadUnicodeFile(Buffer[SMSInfo.EntriesNum],InputBuffer); |
3538 | dbgprintf("buffer is \"%s\"\n",DecodeUnicodeConsole(Buffer[SMSInfo.EntriesNum])); | 3538 | dbgprintf("buffer is \"%s\"\n",DecodeUnicodeConsole(Buffer[SMSInfo.EntriesNum])); |
3539 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_ConcatenatedTextLong; | 3539 | SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_ConcatenatedTextLong; |
3540 | SMSInfo.Entries[SMSInfo.EntriesNum].Buffer = Buffer[SMSInfo.EntriesNum]; | 3540 | SMSInfo.Entries[SMSInfo.EntriesNum].Buffer = Buffer[SMSInfo.EntriesNum]; |
3541 | SMSInfo.EntriesNum++; | 3541 | SMSInfo.EntriesNum++; |
3542 | nextlong = 0; | 3542 | nextlong = 0; |
3543 | break; | 3543 | break; |
3544 | case 19:/* Number of protected items */ | 3544 | case 19:/* Number of protected items */ |
3545 | Protected = atoi(argv[i]); | 3545 | Protected = atoi(argv[i]); |
3546 | nextlong = 0; | 3546 | nextlong = 0; |
3547 | break; | 3547 | break; |
3548 | case 20:/* Formatting text for EMS */ | 3548 | case 20:/* Formatting text for EMS */ |
3549 | if (SMSInfo.Entries[SMSInfo.EntriesNum-1].ID == SMS_ConcatenatedTextLong) { | 3549 | if (SMSInfo.Entries[SMSInfo.EntriesNum-1].ID == SMS_ConcatenatedTextLong) { |
3550 | for(j=0;j<(int)strlen(argv[i]);j++) { | 3550 | for(j=0;j<(int)strlen(argv[i]);j++) { |
3551 | switch(argv[i][j]) { | 3551 | switch(argv[i][j]) { |
3552 | case 'l': case 'L': | 3552 | case 'l': case 'L': |
3553 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Left = true; | 3553 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Left = true; |
3554 | break; | 3554 | break; |
3555 | case 'c': case 'C': | 3555 | case 'c': case 'C': |
3556 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Center = true; | 3556 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Center = true; |
3557 | break; | 3557 | break; |
3558 | case 'r': case 'R': | 3558 | case 'r': case 'R': |
3559 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Right = true; | 3559 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Right = true; |
3560 | break; | 3560 | break; |
3561 | case 'a': case 'A': | 3561 | case 'a': case 'A': |
3562 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Large = true; | 3562 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Large = true; |
3563 | break; | 3563 | break; |
3564 | case 's': case 'S': | 3564 | case 's': case 'S': |
3565 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Small = true; | 3565 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Small = true; |
3566 | break; | 3566 | break; |
3567 | case 'b': case 'B': | 3567 | case 'b': case 'B': |
3568 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Bold = true; | 3568 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Bold = true; |
3569 | break; | 3569 | break; |
3570 | case 'i': case 'I': | 3570 | case 'i': case 'I': |
3571 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Italic = true; | 3571 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Italic = true; |
3572 | break; | 3572 | break; |
3573 | case 'u': case 'U': | 3573 | case 'u': case 'U': |
3574 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Underlined = true; | 3574 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Underlined = true; |
3575 | break; | 3575 | break; |
3576 | case 't': case 'T': | 3576 | case 't': case 'T': |
3577 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Strikethrough = true; | 3577 | SMSInfo.Entries[SMSInfo.EntriesNum-1].Strikethrough = true; |
3578 | break; | 3578 | break; |
3579 | default: | 3579 | default: |
3580 | printmsg("Unknown parameter \"%c\"\n",argv[i][j]); | 3580 | printmsg("Unknown parameter \"%c\"\n",argv[i][j]); |
3581 | exit(-1); | 3581 | exit(-1); |
3582 | } | 3582 | } |
3583 | } | 3583 | } |
3584 | } else { | 3584 | } else { |
3585 | printmsg("Last parameter wasn't text\n"); | 3585 | printmsg("Last parameter wasn't text\n"); |
3586 | exit(-1); | 3586 | exit(-1); |
3587 | } | 3587 | } |
3588 | nextlong = 0; | 3588 | nextlong = 0; |
3589 | break; | 3589 | break; |
3590 | case 21:/*MaxSMS*/ | 3590 | case 21:/*MaxSMS*/ |
3591 | MaxSMS = atoi(argv[i]); | 3591 | MaxSMS = atoi(argv[i]); |
3592 | nextlong = 0; | 3592 | nextlong = 0; |
3593 | break; | 3593 | break; |
3594 | case 22:/* profile name */ | 3594 | case 22:/* profile name */ |
3595 | EncodeUnicode(Buffer[0],argv[i],strlen(argv[i])); | 3595 | EncodeUnicode(Buffer[0],argv[i],strlen(argv[i])); |
3596 | SMSInfo.Entries[0].Buffer = Buffer[0]; | 3596 | SMSInfo.Entries[0].Buffer = Buffer[0]; |
3597 | nextlong = 0; | 3597 | nextlong = 0; |
3598 | break; | 3598 | break; |
3599 | case 23:/* profile ringtone */ | 3599 | case 23:/* profile ringtone */ |
3600 | ringtone[0].Format = RING_NOTETONE; | 3600 | ringtone[0].Format = RING_NOTETONE; |
3601 | error=GSM_ReadRingtoneFile(argv[i],&ringtone[0]); | 3601 | error=GSM_ReadRingtoneFile(argv[i],&ringtone[0]); |
3602 | Print_Error(error); | 3602 | Print_Error(error); |
3603 | SMSInfo.Entries[0].Ringtone = &ringtone[0]; | 3603 | SMSInfo.Entries[0].Ringtone = &ringtone[0]; |
3604 | nextlong = 0; | 3604 | nextlong = 0; |
3605 | break; | 3605 | break; |
3606 | case 24:/* profile bitmap */ | 3606 | case 24:/* profile bitmap */ |
3607 | bitmap[0].Bitmap[0].Type = GSM_PictureImage; | 3607 | bitmap[0].Bitmap[0].Type = GSM_PictureImage; |
3608 | error=GSM_ReadBitmapFile(argv[i],&bitmap[0]); | 3608 | error=GSM_ReadBitmapFile(argv[i],&bitmap[0]); |
3609 | Print_Error(error); | 3609 | Print_Error(error); |
3610 | bitmap[0].Bitmap[0].Text[0] = 0; | 3610 | bitmap[0].Bitmap[0].Text[0] = 0; |
3611 | bitmap[0].Bitmap[0].Text[1] = 0; | 3611 | bitmap[0].Bitmap[0].Text[1] = 0; |
3612 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; | 3612 | SMSInfo.Entries[0].Bitmap = &bitmap[0]; |
3613 | nextlong = 0; | 3613 | nextlong = 0; |
3614 | break; | 3614 | break; |
3615 | } | 3615 | } |
3616 | } | 3616 | } |
3617 | if (nextlong!=0) { | 3617 | if (nextlong!=0) { |
3618 | printmsg("Parameter missed...\n"); | 3618 | printmsg("Parameter missed...\n"); |
3619 | exit(-1); | 3619 | exit(-1); |
3620 | } | 3620 | } |
3621 | 3621 | ||
3622 | if (mystrncasecmp(argv[2],"EMS",0) && EMS16Bit) { | 3622 | if (mystrncasecmp(argv[2],"EMS",0) && EMS16Bit) { |
3623 | for (i=0;i<SMSInfo.EntriesNum;i++) { | 3623 | for (i=0;i<SMSInfo.EntriesNum;i++) { |
3624 | switch (SMSInfo.Entries[i].ID) { | 3624 | switch (SMSInfo.Entries[i].ID) { |
3625 | case SMS_ConcatenatedTextLong: | 3625 | case SMS_ConcatenatedTextLong: |
3626 | SMSInfo.Entries[i].ID = SMS_ConcatenatedTextLong16bit; | 3626 | SMSInfo.Entries[i].ID = SMS_ConcatenatedTextLong16bit; |
3627 | default: | 3627 | default: |
3628 | break; | 3628 | break; |
3629 | 3629 | ||
3630 | } | 3630 | } |
3631 | } | 3631 | } |
3632 | 3632 | ||
3633 | } | 3633 | } |
3634 | if (mystrncasecmp(argv[2],"TEXT",0)) { | 3634 | if (mystrncasecmp(argv[2],"TEXT",0)) { |
3635 | chars_read = UnicodeLength(Buffer[0]); | 3635 | chars_read = UnicodeLength(Buffer[0]); |
3636 | if (chars_read != 0) { | 3636 | if (chars_read != 0) { |
3637 | /* Trim \n at the end of string */ | 3637 | /* Trim \n at the end of string */ |
3638 | if (Buffer[0][chars_read*2-1] == '\n' && Buffer[0][chars_read*2-2] == 0) | 3638 | if (Buffer[0][chars_read*2-1] == '\n' && Buffer[0][chars_read*2-2] == 0) |
3639 | { | 3639 | { |
3640 | Buffer[0][chars_read*2-1] = 0; | 3640 | Buffer[0][chars_read*2-1] = 0; |
3641 | } | 3641 | } |
3642 | } | 3642 | } |
3643 | } | 3643 | } |
3644 | 3644 | ||
3645 | if (mystrncasecmp(argv[1],"--displaysms",0) || mystrncasecmp(argv[1],"--sendsmsdsms",0)) { | 3645 | if (mystrncasecmp(argv[1],"--displaysms",0) || mystrncasecmp(argv[1],"--sendsmsdsms",0)) { |
3646 | if (mystrncasecmp(argv[2],"OPERATOR",0)) { | 3646 | if (mystrncasecmp(argv[2],"OPERATOR",0)) { |
3647 | if (bitmap[0].Bitmap[0].Type==GSM_OperatorLogo && strcmp(bitmap[0].Bitmap[0].NetworkCode,"000 00")==0) { | 3647 | if (bitmap[0].Bitmap[0].Type==GSM_OperatorLogo && strcmp(bitmap[0].Bitmap[0].NetworkCode,"000 00")==0) { |
3648 | printmsg("No network code\n"); | 3648 | printmsg("No network code\n"); |
3649 | exit(-1); | 3649 | exit(-1); |
3650 | } | 3650 | } |
3651 | } | 3651 | } |
3652 | } else { | 3652 | } else { |
3653 | GSM_Init(true); | 3653 | GSM_Init(true); |
3654 | 3654 | ||
3655 | if (mystrncasecmp(argv[2],"OPERATOR",0)) { | 3655 | if (mystrncasecmp(argv[2],"OPERATOR",0)) { |
3656 | if (bitmap[0].Bitmap[0].Type==GSM_OperatorLogo && strcmp(bitmap[0].Bitmap[0].NetworkCode,"000 00")==0) { | 3656 | if (bitmap[0].Bitmap[0].Type==GSM_OperatorLogo && strcmp(bitmap[0].Bitmap[0].NetworkCode,"000 00")==0) { |
3657 | error=Phone->GetNetworkInfo(&s,&NetInfo); | 3657 | error=Phone->GetNetworkInfo(&s,&NetInfo); |
3658 | Print_Error(error); | 3658 | Print_Error(error); |
3659 | strcpy(bitmap[0].Bitmap[0].NetworkCode,NetInfo.NetworkCode); | 3659 | strcpy(bitmap[0].Bitmap[0].NetworkCode,NetInfo.NetworkCode); |
3660 | if (mystrncasecmp(argv[1],"--savesms",0)) { | 3660 | if (mystrncasecmp(argv[1],"--savesms",0)) { |
3661 | EncodeUnicode(Sender, "OpLogo",6); | 3661 | EncodeUnicode(Sender, "OpLogo",6); |
3662 | EncodeUnicode(Sender+6*2,bitmap[0].Bitmap[0].NetworkCode,3); | 3662 | EncodeUnicode(Sender+6*2,bitmap[0].Bitmap[0].NetworkCode,3); |
3663 | EncodeUnicode(Sender+6*2+3*2,bitmap[0].Bitmap[0].NetworkCode+4,2); | 3663 | EncodeUnicode(Sender+6*2+3*2,bitmap[0].Bitmap[0].NetworkCode+4,2); |
3664 | if (UnicodeLength(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode))<GSM_MAX_SMS_NAME_LENGTH-7) { | 3664 | if (UnicodeLength(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode))<GSM_MAX_SMS_NAME_LENGTH-7) { |
3665 | EncodeUnicode(Name,"OpLogo ",7); | 3665 | EncodeUnicode(Name,"OpLogo ",7); |
3666 | CopyUnicodeString(Name+7*2,GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)); | 3666 | CopyUnicodeString(Name+7*2,GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)); |
3667 | } else { | 3667 | } else { |
3668 | CopyUnicodeString(Name,Sender); | 3668 | CopyUnicodeString(Name,Sender); |
3669 | } | 3669 | } |
3670 | } | 3670 | } |
3671 | } | 3671 | } |
3672 | } | 3672 | } |
3673 | } | 3673 | } |
3674 | 3674 | ||
3675 | error=GSM_EncodeMultiPartSMS(&SMSInfo,&sms); | 3675 | error=GSM_EncodeMultiPartSMS(&SMSInfo,&sms); |
3676 | Print_Error(error); | 3676 | Print_Error(error); |
3677 | 3677 | ||
3678 | for (i=0;i<SMSInfo.EntriesNum;i++) { | 3678 | for (i=0;i<SMSInfo.EntriesNum;i++) { |
3679 | switch (SMSInfo.Entries[i].ID) { | 3679 | switch (SMSInfo.Entries[i].ID) { |
3680 | case SMS_NokiaRingtone: | 3680 | case SMS_NokiaRingtone: |
3681 | case SMS_NokiaRingtoneLong: | 3681 | case SMS_NokiaRingtoneLong: |
3682 | case SMS_NokiaProfileLong: | 3682 | case SMS_NokiaProfileLong: |
3683 | case SMS_EMSSound10: | 3683 | case SMS_EMSSound10: |
3684 | case SMS_EMSSound12: | 3684 | case SMS_EMSSound12: |
3685 | case SMS_EMSSonyEricssonSound: | 3685 | case SMS_EMSSonyEricssonSound: |
3686 | case SMS_EMSSound10Long: | 3686 | case SMS_EMSSound10Long: |
3687 | case SMS_EMSSound12Long: | 3687 | case SMS_EMSSound12Long: |
3688 | case SMS_EMSSonyEricssonSoundLong: | 3688 | case SMS_EMSSonyEricssonSoundLong: |
3689 | if (SMSInfo.Entries[i].RingtoneNotes!=SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands) { | 3689 | if (SMSInfo.Entries[i].RingtoneNotes!=SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands) { |
3690 | printmsg("Warning: ringtone too long. %i percent part cut\n", | 3690 | printmsg("Warning: ringtone too long. %i percent part cut\n", |
3691 | (SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands-SMSInfo.Entries[i].RingtoneNotes)*100/SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands); | 3691 | (SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands-SMSInfo.Entries[i].RingtoneNotes)*100/SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands); |
3692 | } | 3692 | } |
3693 | default: | 3693 | default: |
3694 | break; | 3694 | break; |
3695 | 3695 | ||
3696 | } | 3696 | } |
3697 | } | 3697 | } |
3698 | if (MaxSMS != -1 && sms.Number > MaxSMS) { | 3698 | if (MaxSMS != -1 && sms.Number > MaxSMS) { |
3699 | printmsg("There is %i SMS packed and %i limit. Exiting\n",sms.Number,MaxSMS); | 3699 | printmsg("There is %i SMS packed and %i limit. Exiting\n",sms.Number,MaxSMS); |
3700 | if (!mystrncasecmp(argv[1],"--displaysms",0) && !mystrncasecmp(argv[1],"--sendsmsdsms",0)) GSM_Terminate(); | 3700 | if (!mystrncasecmp(argv[1],"--displaysms",0) && !mystrncasecmp(argv[1],"--sendsmsdsms",0)) GSM_Terminate(); |
3701 | exit(-1); | 3701 | exit(-1); |
3702 | } | 3702 | } |
3703 | 3703 | ||
3704 | if (mystrncasecmp(argv[1],"--displaysms",0)) { | 3704 | if (mystrncasecmp(argv[1],"--displaysms",0)) { |
3705 | if (SMSCSet != 0) { | 3705 | if (SMSCSet != 0) { |
3706 | printmsg("Use -smscnumber option to give SMSC number\n"); | 3706 | printmsg("Use -smscnumber option to give SMSC number\n"); |
3707 | exit(-1); | 3707 | exit(-1); |
3708 | } | 3708 | } |
3709 | 3709 | ||
3710 | for (i=0;i<sms.Number;i++) { | 3710 | for (i=0;i<sms.Number;i++) { |
3711 | sms.SMS[i].Location = 0; | 3711 | sms.SMS[i].Location = 0; |
3712 | sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; | 3712 | sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; |
3713 | sms.SMS[i].SMSC.Location = 0; | 3713 | sms.SMS[i].SMSC.Location = 0; |
3714 | sms.SMS[i].PDU = SMS_Submit; | 3714 | sms.SMS[i].PDU = SMS_Submit; |
3715 | if (DeliveryReport) sms.SMS[i].PDU= SMS_Status_Report; | 3715 | if (DeliveryReport) sms.SMS[i].PDU= SMS_Status_Report; |
3716 | CopyUnicodeString(sms.SMS[i].Number, Sender); | 3716 | CopyUnicodeString(sms.SMS[i].Number, Sender); |
3717 | CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); | 3717 | CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); |
3718 | if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); | 3718 | if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); |
3719 | DisplaySMSFrame(&sms.SMS[i]); | 3719 | DisplaySMSFrame(&sms.SMS[i]); |
3720 | } | 3720 | } |
3721 | 3721 | ||
3722 | printmsg("\nNumber of SMS: %i\n",sms.Number); | 3722 | printmsg("\nNumber of SMS: %i\n",sms.Number); |
3723 | exit(sms.Number); | 3723 | exit(sms.Number); |
3724 | } | 3724 | } |
3725 | if (mystrncasecmp(argv[1],"--sendsmsdsms",0)) { | 3725 | if (mystrncasecmp(argv[1],"--sendsmsdsms",0)) { |
3726 | if (SMSCSet != 0) { | 3726 | if (SMSCSet != 0) { |
3727 | printmsg("Use -smscnumber option to give SMSC number\n"); | 3727 | printmsg("Use -smscnumber option to give SMSC number\n"); |
3728 | exit(-1); | 3728 | exit(-1); |
3729 | } | 3729 | } |
3730 | 3730 | ||
3731 | for (i=0;i<sms.Number;i++) { | 3731 | for (i=0;i<sms.Number;i++) { |
3732 | sms.SMS[i].Location = 0; | 3732 | sms.SMS[i].Location = 0; |
3733 | sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; | 3733 | sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; |
3734 | sms.SMS[i].SMSC.Location = 0; | 3734 | sms.SMS[i].SMSC.Location = 0; |
3735 | sms.SMS[i].PDU = SMS_Submit; | 3735 | sms.SMS[i].PDU = SMS_Submit; |
3736 | if (DeliveryReport) sms.SMS[i].PDU= SMS_Status_Report; | 3736 | if (DeliveryReport) sms.SMS[i].PDU= SMS_Status_Report; |
3737 | CopyUnicodeString(sms.SMS[i].Number, Sender); | 3737 | CopyUnicodeString(sms.SMS[i].Number, Sender); |
3738 | CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); | 3738 | CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); |
3739 | if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); | 3739 | if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); |
3740 | } | 3740 | } |
3741 | SMSDaemonSendSMS(argv[4],argv[5],&sms); | 3741 | SMSDaemonSendSMS(argv[4],argv[5],&sms); |
3742 | exit(0); | 3742 | exit(0); |
3743 | } | 3743 | } |
3744 | if (mystrncasecmp(argv[1],"--savesms",0) || SendSaved) { | 3744 | if (mystrncasecmp(argv[1],"--savesms",0) || SendSaved) { |
3745 | error=Phone->GetSMSFolders(&s, &folders); | 3745 | error=Phone->GetSMSFolders(&s, &folders); |
3746 | Print_Error(error); | 3746 | Print_Error(error); |
3747 | 3747 | ||
3748 | if (SendSaved){ | 3748 | if (SendSaved){ |
3749 | if (Validity.Format != 0 && SMSCSet != 0) { | 3749 | if (Validity.Format != 0 && SMSCSet != 0) { |
3750 | PhoneSMSC.Location = SMSCSet; | 3750 | PhoneSMSC.Location = SMSCSet; |
3751 | error=Phone->GetSMSC(&s,&PhoneSMSC); | 3751 | error=Phone->GetSMSC(&s,&PhoneSMSC); |
3752 | Print_Error(error); | 3752 | Print_Error(error); |
3753 | CopyUnicodeString(SMSC,PhoneSMSC.Number); | 3753 | CopyUnicodeString(SMSC,PhoneSMSC.Number); |
3754 | SMSCSet = 0; | 3754 | SMSCSet = 0; |
3755 | } | 3755 | } |
3756 | 3756 | ||
3757 | s.User.SendSMSStatus = SendSMSStatus; | 3757 | s.User.SendSMSStatus = SendSMSStatus; |
3758 | 3758 | ||
3759 | signal(SIGINT, interrupt); | 3759 | signal(SIGINT, interrupt); |
3760 | printmsgerr("If you want break, press Ctrl+C...\n"); | 3760 | printmsgerr("If you want break, press Ctrl+C...\n"); |
3761 | } | 3761 | } |
3762 | 3762 | ||
3763 | for (i=0;i<sms.Number;i++) { | 3763 | for (i=0;i<sms.Number;i++) { |
3764 | printmsg("Saving SMS %i/%i\n",i+1,sms.Number); | 3764 | printmsg("Saving SMS %i/%i\n",i+1,sms.Number); |
3765 | // sms.SMS[i].Location = 0; | 3765 | // sms.SMS[i].Location = 0; |
3766 | sms.SMS[i].Folder = Folder; | 3766 | sms.SMS[i].Folder = Folder; |
3767 | sms.SMS[i].State = State; | 3767 | sms.SMS[i].State = State; |
3768 | sms.SMS[i].ReplyViaSameSMSC= ReplyViaSameSMSC; | 3768 | sms.SMS[i].ReplyViaSameSMSC= ReplyViaSameSMSC; |
3769 | sms.SMS[i].SMSC.Location= SMSCSet; | 3769 | sms.SMS[i].SMSC.Location= SMSCSet; |
3770 | 3770 | ||
3771 | if (SendSaved){ | 3771 | if (SendSaved){ |
3772 | sms.SMS[i].PDU= SMS_Submit; | 3772 | sms.SMS[i].PDU= SMS_Submit; |
3773 | if (DeliveryReport) sms.SMS[i].PDU = SMS_Status_Report; | 3773 | if (DeliveryReport) sms.SMS[i].PDU = SMS_Status_Report; |
3774 | if (Validity.Format != 0) sms.SMS[i].SMSC.Validity = Validity; | 3774 | if (Validity.Format != 0) sms.SMS[i].SMSC.Validity = Validity; |
3775 | } else { | 3775 | } else { |
3776 | sms.SMS[i].PDU= SMS_Deliver; | 3776 | sms.SMS[i].PDU= SMS_Deliver; |
3777 | } | 3777 | } |
3778 | 3778 | ||
3779 | CopyUnicodeString(sms.SMS[i].Number, Sender); | 3779 | CopyUnicodeString(sms.SMS[i].Number, Sender); |
3780 | CopyUnicodeString(sms.SMS[i].Name, Name); | 3780 | CopyUnicodeString(sms.SMS[i].Name, Name); |
3781 | if (SMSCSet==0) CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); | 3781 | if (SMSCSet==0) CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); |
3782 | error=Phone->AddSMS(&s, &sms.SMS[i]); | 3782 | error=Phone->AddSMS(&s, &sms.SMS[i]); |
3783 | Print_Error(error); | 3783 | Print_Error(error); |
3784 | printmsg("Saved in folder \"%s\", location %i\n", | 3784 | printmsg("Saved in folder \"%s\", location %i\n", |
3785 | DecodeUnicodeConsole(folders.Folder[sms.SMS[i].Folder-1].Name),sms.SMS[i].Location); | 3785 | DecodeUnicodeConsole(folders.Folder[sms.SMS[i].Folder-1].Name),sms.SMS[i].Location); |
3786 | 3786 | ||
3787 | if (SendSaved) { | 3787 | if (SendSaved) { |
3788 | printmsg("Sending sms from folder \"%s\", location %i\n", | 3788 | printmsg("Sending sms from folder \"%s\", location %i\n", |
3789 | DecodeUnicodeString(folders.Folder[sms.SMS[i].Folder-1].Name),sms.SMS[i].Location); | 3789 | DecodeUnicodeString(folders.Folder[sms.SMS[i].Folder-1].Name),sms.SMS[i].Location); |
3790 | SMSStatus = ERR_TIMEOUT; | 3790 | SMSStatus = ERR_TIMEOUT; |
3791 | error=Phone->SendSavedSMS(&s, 0, sms.SMS[i].Location); | 3791 | error=Phone->SendSavedSMS(&s, 0, sms.SMS[i].Location); |
3792 | Print_Error(error); | 3792 | Print_Error(error); |
3793 | printmsg("....waiting for network answer"); | 3793 | printmsg("....waiting for network answer"); |
3794 | while (!gshutdown) { | 3794 | while (!gshutdown) { |
3795 | GSM_ReadDevice(&s,true); | 3795 | GSM_ReadDevice(&s,true); |
3796 | if (SMSStatus == ERR_UNKNOWN) { | 3796 | if (SMSStatus == ERR_UNKNOWN) { |
3797 | GSM_Terminate(); | 3797 | GSM_Terminate(); |
3798 | exit(-1); | 3798 | exit(-1); |
3799 | } | 3799 | } |
3800 | if (SMSStatus == ERR_NONE) break; | 3800 | if (SMSStatus == ERR_NONE) break; |
3801 | } | 3801 | } |
3802 | } | 3802 | } |
3803 | } | 3803 | } |
3804 | } else { | 3804 | } else { |
3805 | if (Validity.Format != 0 && SMSCSet != 0) { | 3805 | if (Validity.Format != 0 && SMSCSet != 0) { |
3806 | PhoneSMSC.Location = SMSCSet; | 3806 | PhoneSMSC.Location = SMSCSet; |
3807 | error=Phone->GetSMSC(&s,&PhoneSMSC); | 3807 | error=Phone->GetSMSC(&s,&PhoneSMSC); |
3808 | Print_Error(error); | 3808 | Print_Error(error); |
3809 | CopyUnicodeString(SMSC,PhoneSMSC.Number); | 3809 | CopyUnicodeString(SMSC,PhoneSMSC.Number); |
3810 | SMSCSet = 0; | 3810 | SMSCSet = 0; |
3811 | } | 3811 | } |
3812 | 3812 | ||
3813 | signal(SIGINT, interrupt); | 3813 | signal(SIGINT, interrupt); |
3814 | printmsgerr("If you want break, press Ctrl+C...\n"); | 3814 | printmsgerr("If you want break, press Ctrl+C...\n"); |
3815 | 3815 | ||
3816 | s.User.SendSMSStatus = SendSMSStatus; | 3816 | s.User.SendSMSStatus = SendSMSStatus; |
3817 | 3817 | ||
3818 | for (i=0;i<sms.Number;i++) { | 3818 | for (i=0;i<sms.Number;i++) { |
3819 | printmsg("Sending SMS %i/%i",i+1,sms.Number); | 3819 | printmsg("Sending SMS %i/%i",i+1,sms.Number); |
3820 | sms.SMS[i].Location = 0; | 3820 | sms.SMS[i].Location = 0; |
3821 | sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; | 3821 | sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; |
3822 | sms.SMS[i].SMSC.Location = SMSCSet; | 3822 | sms.SMS[i].SMSC.Location = SMSCSet; |
3823 | sms.SMS[i].PDU = SMS_Submit; | 3823 | sms.SMS[i].PDU = SMS_Submit; |
3824 | if (DeliveryReport) sms.SMS[i].PDU= SMS_Status_Report; | 3824 | if (DeliveryReport) sms.SMS[i].PDU= SMS_Status_Report; |
3825 | CopyUnicodeString(sms.SMS[i].Number, Sender); | 3825 | CopyUnicodeString(sms.SMS[i].Number, Sender); |
3826 | if (SMSCSet==0) CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); | 3826 | if (SMSCSet==0) CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); |
3827 | if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); | 3827 | if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); |
3828 | SMSStatus = ERR_TIMEOUT; | 3828 | SMSStatus = ERR_TIMEOUT; |
3829 | error=Phone->SendSMS(&s, &sms.SMS[i]); | 3829 | error=Phone->SendSMS(&s, &sms.SMS[i]); |
3830 | Print_Error(error); | 3830 | Print_Error(error); |
3831 | printmsg("....waiting for network answer"); | 3831 | printmsg("....waiting for network answer"); |
3832 | while (!gshutdown) { | 3832 | while (!gshutdown) { |
3833 | GSM_ReadDevice(&s,true); | 3833 | GSM_ReadDevice(&s,true); |
3834 | if (SMSStatus == ERR_UNKNOWN) { | 3834 | if (SMSStatus == ERR_UNKNOWN) { |
3835 | GSM_Terminate(); | 3835 | GSM_Terminate(); |
3836 | exit(-1); | 3836 | exit(-1); |
3837 | } | 3837 | } |
3838 | if (SMSStatus == ERR_NONE) break; | 3838 | if (SMSStatus == ERR_NONE) break; |
3839 | } | 3839 | } |
3840 | } | 3840 | } |
3841 | } | 3841 | } |
3842 | 3842 | ||
3843 | GSM_Terminate(); | 3843 | GSM_Terminate(); |
3844 | } | 3844 | } |
3845 | 3845 | ||
3846 | #ifdef GSM_ENABLE_BACKUP | 3846 | #ifdef GSM_ENABLE_BACKUP |
3847 | static void SaveFile(int argc, char *argv[]) | 3847 | static void SaveFile(int argc, char *argv[]) |
3848 | { | 3848 | { |
3849 | GSM_Backup Backup; | 3849 | GSM_Backup Backup; |
3850 | int i,j; | 3850 | int i,j; |
3851 | FILE *file; | 3851 | FILE *file; |
3852 | unsigned char Buffer[10000]; | 3852 | unsigned char Buffer[10000]; |
3853 | GSM_MemoryEntry *pbk; | 3853 | GSM_MemoryEntry *pbk; |
3854 | 3854 | ||
3855 | if (mystrncasecmp(argv[2],"CALENDAR",0)) { | 3855 | if (mystrncasecmp(argv[2],"CALENDAR",0)) { |
3856 | if (argc<5) { | 3856 | if (argc<5) { |
3857 | printmsg("Where is backup filename and location ?\n"); | 3857 | printmsg("Where is backup filename and location ?\n"); |
3858 | exit(-1); | 3858 | exit(-1); |
3859 | } | 3859 | } |
3860 | error=GSM_ReadBackupFile(argv[4],&Backup); | 3860 | error=GSM_ReadBackupFile(argv[4],&Backup); |
3861 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 3861 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
3862 | i = 0; | 3862 | i = 0; |
3863 | while (Backup.Calendar[i]!=NULL) { | 3863 | while (Backup.Calendar[i]!=NULL) { |
3864 | if (i == atoi(argv[5])-1) break; | 3864 | if (i == atoi(argv[5])-1) break; |
3865 | i++; | 3865 | i++; |
3866 | } | 3866 | } |
3867 | if (i != atoi(argv[5])-1) { | 3867 | if (i != atoi(argv[5])-1) { |
3868 | printmsg("Calendar note not found in file\n"); | 3868 | printmsg("Calendar note not found in file\n"); |
3869 | exit(-1); | 3869 | exit(-1); |
3870 | } | 3870 | } |
3871 | j = 0; | 3871 | j = 0; |
3872 | GSM_EncodeVCALENDAR(Buffer, &j, Backup.Calendar[i],true,Nokia_VCalendar); | 3872 | GSM_EncodeVCALENDAR(Buffer, &j, Backup.Calendar[i],true,Nokia_VCalendar); |
3873 | } else if (mystrncasecmp(argv[2],"BOOKMARK",0)) { | 3873 | } else if (mystrncasecmp(argv[2],"BOOKMARK",0)) { |
3874 | if (argc<5) { | 3874 | if (argc<5) { |
3875 | printmsg("Where is backup filename and location ?\n"); | 3875 | printmsg("Where is backup filename and location ?\n"); |
3876 | exit(-1); | 3876 | exit(-1); |
3877 | } | 3877 | } |
3878 | error=GSM_ReadBackupFile(argv[4],&Backup); | 3878 | error=GSM_ReadBackupFile(argv[4],&Backup); |
3879 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 3879 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
3880 | i = 0; | 3880 | i = 0; |
3881 | while (Backup.WAPBookmark[i]!=NULL) { | 3881 | while (Backup.WAPBookmark[i]!=NULL) { |
3882 | if (i == atoi(argv[5])-1) break; | 3882 | if (i == atoi(argv[5])-1) break; |
3883 | i++; | 3883 | i++; |
3884 | } | 3884 | } |
3885 | if (i != atoi(argv[5])-1) { | 3885 | if (i != atoi(argv[5])-1) { |
3886 | printmsg("WAP bookmark not found in file\n"); | 3886 | printmsg("WAP bookmark not found in file\n"); |
3887 | exit(-1); | 3887 | exit(-1); |
3888 | } | 3888 | } |
3889 | j = 0; | 3889 | j = 0; |
3890 | GSM_EncodeURLFile(Buffer, &j, Backup.WAPBookmark[i]); | 3890 | GSM_EncodeURLFile(Buffer, &j, Backup.WAPBookmark[i]); |
3891 | } else if (mystrncasecmp(argv[2],"NOTE",0)) { | 3891 | } else if (mystrncasecmp(argv[2],"NOTE",0)) { |
3892 | if (argc<5) { | 3892 | if (argc<5) { |
3893 | printmsg("Where is backup filename and location ?\n"); | 3893 | printmsg("Where is backup filename and location ?\n"); |
3894 | exit(-1); | 3894 | exit(-1); |
3895 | } | 3895 | } |
3896 | error=GSM_ReadBackupFile(argv[4],&Backup); | 3896 | error=GSM_ReadBackupFile(argv[4],&Backup); |
3897 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 3897 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
3898 | i = 0; | 3898 | i = 0; |
3899 | while (Backup.Note[i]!=NULL) { | 3899 | while (Backup.Note[i]!=NULL) { |
3900 | if (i == atoi(argv[5])-1) break; | 3900 | if (i == atoi(argv[5])-1) break; |
3901 | i++; | 3901 | i++; |
3902 | } | 3902 | } |
3903 | if (i != atoi(argv[5])-1) { | 3903 | if (i != atoi(argv[5])-1) { |
3904 | printmsg("Note not found in file\n"); | 3904 | printmsg("Note not found in file\n"); |
3905 | exit(-1); | 3905 | exit(-1); |
3906 | } | 3906 | } |
3907 | j = 0; | 3907 | j = 0; |
3908 | GSM_EncodeVNTFile(Buffer, &j, Backup.Note[i]); | 3908 | GSM_EncodeVNTFile(Buffer, &j, Backup.Note[i]); |
3909 | } else if (mystrncasecmp(argv[2],"TODO",0)) { | 3909 | } else if (mystrncasecmp(argv[2],"TODO",0)) { |
3910 | if (argc<5) { | 3910 | if (argc<5) { |
3911 | printmsg("Where is backup filename and location ?\n"); | 3911 | printmsg("Where is backup filename and location ?\n"); |
3912 | exit(-1); | 3912 | exit(-1); |
3913 | } | 3913 | } |
3914 | error=GSM_ReadBackupFile(argv[4],&Backup); | 3914 | error=GSM_ReadBackupFile(argv[4],&Backup); |
3915 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 3915 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
3916 | i = 0; | 3916 | i = 0; |
3917 | while (Backup.ToDo[i]!=NULL) { | 3917 | while (Backup.ToDo[i]!=NULL) { |
3918 | if (i == atoi(argv[5])-1) break; | 3918 | if (i == atoi(argv[5])-1) break; |
3919 | i++; | 3919 | i++; |
3920 | } | 3920 | } |
3921 | if (i != atoi(argv[5])-1) { | 3921 | if (i != atoi(argv[5])-1) { |
3922 | printmsg("ToDo note not found in file\n"); | 3922 | printmsg("ToDo note not found in file\n"); |
3923 | exit(-1); | 3923 | exit(-1); |
3924 | } | 3924 | } |
3925 | j = 0; | 3925 | j = 0; |
3926 | GSM_EncodeVTODO(Buffer, &j, Backup.ToDo[i], true, Nokia_VToDo); | 3926 | GSM_EncodeVTODO(Buffer, &j, Backup.ToDo[i], true, Nokia_VToDo); |
3927 | } else if (mystrncasecmp(argv[2],"VCARD10",0) || mystrncasecmp(argv[2],"VCARD21",0)) { | 3927 | } else if (mystrncasecmp(argv[2],"VCARD10",0) || mystrncasecmp(argv[2],"VCARD21",0)) { |
3928 | if (argc<6) { | 3928 | if (argc<6) { |
3929 | printmsg("Where is backup filename and location and memory type ?\n"); | 3929 | printmsg("Where is backup filename and location and memory type ?\n"); |
3930 | exit(-1); | 3930 | exit(-1); |
3931 | } | 3931 | } |
3932 | error=GSM_ReadBackupFile(argv[4],&Backup); | 3932 | error=GSM_ReadBackupFile(argv[4],&Backup); |
3933 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 3933 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
3934 | i = 0; | 3934 | i = 0; |
3935 | if (mystrncasecmp(argv[5],"SM",0)) { | 3935 | if (mystrncasecmp(argv[5],"SM",0)) { |
3936 | while (Backup.SIMPhonebook[i]!=NULL) { | 3936 | while (Backup.SIMPhonebook[i]!=NULL) { |
3937 | if (i == atoi(argv[6])-1) break; | 3937 | if (i == atoi(argv[6])-1) break; |
3938 | i++; | 3938 | i++; |
3939 | } | 3939 | } |
3940 | if (i != atoi(argv[6])-1) { | 3940 | if (i != atoi(argv[6])-1) { |
3941 | printmsg("Phonebook entry not found in file\n"); | 3941 | printmsg("Phonebook entry not found in file\n"); |
3942 | exit(-1); | 3942 | exit(-1); |
3943 | } | 3943 | } |
3944 | pbk = Backup.SIMPhonebook[i]; | 3944 | pbk = Backup.SIMPhonebook[i]; |
3945 | } else if (mystrncasecmp(argv[5],"ME",0)) { | 3945 | } else if (mystrncasecmp(argv[5],"ME",0)) { |
3946 | while (Backup.PhonePhonebook[i]!=NULL) { | 3946 | while (Backup.PhonePhonebook[i]!=NULL) { |
3947 | if (i == atoi(argv[6])-1) break; | 3947 | if (i == atoi(argv[6])-1) break; |
3948 | i++; | 3948 | i++; |
3949 | } | 3949 | } |
3950 | if (i != atoi(argv[6])-1) { | 3950 | if (i != atoi(argv[6])-1) { |
3951 | printmsg("Phonebook entry not found in file\n"); | 3951 | printmsg("Phonebook entry not found in file\n"); |
3952 | exit(-1); | 3952 | exit(-1); |
3953 | } | 3953 | } |
3954 | pbk = Backup.PhonePhonebook[i]; | 3954 | pbk = Backup.PhonePhonebook[i]; |
3955 | } else { | 3955 | } else { |
3956 | printmsg("Unknown memory type: \"%s\"\n",argv[5]); | 3956 | printmsg("Unknown memory type: \"%s\"\n",argv[5]); |
3957 | exit(-1); | 3957 | exit(-1); |
3958 | } | 3958 | } |
3959 | j = 0; | 3959 | j = 0; |
3960 | if (mystrncasecmp(argv[2],"VCARD10",0)) { | 3960 | if (mystrncasecmp(argv[2],"VCARD10",0)) { |
3961 | GSM_EncodeVCARD(Buffer,&j,pbk,true,Nokia_VCard10); | 3961 | GSM_EncodeVCARD(Buffer,&j,pbk,true,Nokia_VCard10); |
3962 | } else { | 3962 | } else { |
3963 | GSM_EncodeVCARD(Buffer,&j,pbk,true,Nokia_VCard21); | 3963 | GSM_EncodeVCARD(Buffer,&j,pbk,true,Nokia_VCard21); |
3964 | } | 3964 | } |
3965 | } else { | 3965 | } else { |
3966 | printmsg("What format of file (\"%s\") ?\n",argv[2]); | 3966 | printmsg("What format of file (\"%s\") ?\n",argv[2]); |
3967 | exit(-1); | 3967 | exit(-1); |
3968 | } | 3968 | } |
3969 | 3969 | ||
3970 | file = fopen(argv[3],"wb"); | 3970 | file = fopen(argv[3],"wb"); |
3971 | fwrite(Buffer,1,j,file); | 3971 | fwrite(Buffer,1,j,file); |
3972 | fclose(file); | 3972 | fclose(file); |
3973 | } | 3973 | } |
3974 | 3974 | ||
3975 | static void Backup(int argc, char *argv[]) | 3975 | static void Backup(int argc, char *argv[]) |
3976 | { | 3976 | { |
3977 | int i, used; | 3977 | int i, used; |
3978 | GSM_MemoryStatusMemStatus; | 3978 | GSM_MemoryStatusMemStatus; |
3979 | GSM_ToDoEntry ToDo; | 3979 | GSM_ToDoEntry ToDo; |
3980 | GSM_ToDoStatus ToDoStatus; | 3980 | GSM_ToDoStatus ToDoStatus; |
3981 | GSM_MemoryEntry Pbk; | 3981 | GSM_MemoryEntry Pbk; |
3982 | GSM_CalendarEntryCalendar; | 3982 | GSM_CalendarEntryCalendar; |
3983 | GSM_Bitmap Bitmap; | 3983 | GSM_Bitmap Bitmap; |
3984 | GSM_WAPBookmark Bookmark; | 3984 | GSM_WAPBookmark Bookmark; |
3985 | GSM_Profile Profile; | 3985 | GSM_Profile Profile; |
3986 | GSM_MultiWAPSettingsSettings; | 3986 | GSM_MultiWAPSettingsSettings; |
3987 | GSM_SyncMLSettingsSyncML; | 3987 | GSM_SyncMLSettingsSyncML; |
3988 | GSM_ChatSettingsChat; | 3988 | GSM_ChatSettingsChat; |
3989 | GSM_Ringtone Ringtone; | 3989 | GSM_Ringtone Ringtone; |
3990 | GSM_SMSC SMSC; | 3990 | GSM_SMSC SMSC; |
3991 | GSM_Backup Backup; | 3991 | GSM_Backup Backup; |
3992 | GSM_NoteEntry Note; | 3992 | GSM_NoteEntry Note; |
3993 | GSM_Backup_Info Info; | 3993 | GSM_Backup_Info Info; |
3994 | GSM_FMStation FMStation; | 3994 | GSM_FMStation FMStation; |
3995 | GSM_GPRSAccessPointGPRSPoint; | 3995 | GSM_GPRSAccessPointGPRSPoint; |
3996 | bool DoBackup; | 3996 | bool DoBackup; |
3997 | 3997 | ||
3998 | if (argc == 4 && mystrncasecmp(argv[3],"-yes",0)) always_answer_yes = true; | 3998 | if (argc == 4 && mystrncasecmp(argv[3],"-yes",0)) always_answer_yes = true; |
3999 | 3999 | ||
4000 | GSM_ClearBackup(&Backup); | 4000 | GSM_ClearBackup(&Backup); |
4001 | GSM_GetBackupFormatFeatures(argv[2],&Info); | 4001 | GSM_GetBackupFormatFeatures(argv[2],&Info); |
4002 | 4002 | ||
4003 | sprintf(Backup.Creator,"Gammu %s",VERSION); | 4003 | sprintf(Backup.Creator,"Gammu %s",VERSION); |
4004 | if (strlen(GetOS()) != 0) { | 4004 | if (strlen(GetOS()) != 0) { |
4005 | strcat(Backup.Creator+strlen(Backup.Creator),", "); | 4005 | strcat(Backup.Creator+strlen(Backup.Creator),", "); |
4006 | strcat(Backup.Creator+strlen(Backup.Creator),GetOS()); | 4006 | strcat(Backup.Creator+strlen(Backup.Creator),GetOS()); |
4007 | } | 4007 | } |
4008 | if (strlen(GetCompiler()) != 0) { | 4008 | if (strlen(GetCompiler()) != 0) { |
4009 | strcat(Backup.Creator+strlen(Backup.Creator),", "); | 4009 | strcat(Backup.Creator+strlen(Backup.Creator),", "); |
4010 | strcat(Backup.Creator+strlen(Backup.Creator),GetCompiler()); | 4010 | strcat(Backup.Creator+strlen(Backup.Creator),GetCompiler()); |
4011 | } | 4011 | } |
4012 | 4012 | ||
4013 | signal(SIGINT, interrupt); | 4013 | signal(SIGINT, interrupt); |
4014 | printmsgerr("Press Ctrl+C to break...\n"); | 4014 | printmsgerr("Press Ctrl+C to break...\n"); |
4015 | 4015 | ||
4016 | GSM_Init(true); | 4016 | GSM_Init(true); |
4017 | 4017 | ||
4018 | if (Info.UseUnicode) { | 4018 | if (Info.UseUnicode) { |
4019 | Info.UseUnicode=answer_yes("Use Unicode subformat of backup file"); | 4019 | Info.UseUnicode=answer_yes("Use Unicode subformat of backup file"); |
4020 | } | 4020 | } |
4021 | if (Info.DateTime) { | 4021 | if (Info.DateTime) { |
4022 | GSM_GetCurrentDateTime (&Backup.DateTime); | 4022 | GSM_GetCurrentDateTime (&Backup.DateTime); |
4023 | Backup.DateTimeAvailable=true; | 4023 | Backup.DateTimeAvailable=true; |
4024 | } | 4024 | } |
4025 | if (Info.Model) { | 4025 | if (Info.Model) { |
4026 | error=Phone->GetManufacturer(&s); | 4026 | error=Phone->GetManufacturer(&s); |
4027 | Print_Error(error); | 4027 | Print_Error(error); |
4028 | sprintf(Backup.Model,"%s ",s.Phone.Data.Manufacturer); | 4028 | sprintf(Backup.Model,"%s ",s.Phone.Data.Manufacturer); |
4029 | if (s.Phone.Data.ModelInfo->model[0]!=0) { | 4029 | if (s.Phone.Data.ModelInfo->model[0]!=0) { |
4030 | strcat(Backup.Model,s.Phone.Data.ModelInfo->model); | 4030 | strcat(Backup.Model,s.Phone.Data.ModelInfo->model); |
4031 | } else { | 4031 | } else { |
4032 | strcat(Backup.Model,s.Phone.Data.Model); | 4032 | strcat(Backup.Model,s.Phone.Data.Model); |
4033 | } | 4033 | } |
4034 | strcat(Backup.Model," "); | 4034 | strcat(Backup.Model," "); |
4035 | strcat(Backup.Model,s.Phone.Data.Version); | 4035 | strcat(Backup.Model,s.Phone.Data.Version); |
4036 | } | 4036 | } |
4037 | if (Info.IMEI) { | 4037 | if (Info.IMEI) { |
4038 | error=Phone->GetIMEI(&s); | 4038 | error=Phone->GetIMEI(&s); |
4039 | if (error != ERR_NOTSUPPORTED) { | 4039 | if (error != ERR_NOTSUPPORTED) { |
4040 | strcpy(Backup.IMEI, s.Phone.Data.IMEI); | 4040 | strcpy(Backup.IMEI, s.Phone.Data.IMEI); |
4041 | Print_Error(error); | 4041 | Print_Error(error); |
4042 | } else { | 4042 | } else { |
4043 | Backup.IMEI[0] = 0; | 4043 | Backup.IMEI[0] = 0; |
4044 | } | 4044 | } |
4045 | } | 4045 | } |
4046 | printf("\n"); | 4046 | printf("\n"); |
4047 | 4047 | ||
4048 | DoBackup = false; | 4048 | DoBackup = false; |
4049 | if (Info.PhonePhonebook) { | 4049 | if (Info.PhonePhonebook) { |
4050 | printmsg("Checking phone phonebook\n"); | 4050 | printmsg("Checking phone phonebook\n"); |
4051 | MemStatus.MemoryType = MEM_ME; | 4051 | MemStatus.MemoryType = MEM_ME; |
4052 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 4052 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
4053 | if (error==ERR_NONE && MemStatus.MemoryUsed != 0) { | 4053 | if (error==ERR_NONE && MemStatus.MemoryUsed != 0) { |
4054 | if (answer_yes(" Backup phone phonebook")) DoBackup = true; | 4054 | /*LRif (answer_yes(" Backup phone phonebook")) */DoBackup = true; |
4055 | } | 4055 | } |
4056 | } | 4056 | } |
4057 | if (DoBackup) { | 4057 | if (DoBackup) { |
4058 | Pbk.MemoryType = MEM_ME; | 4058 | Pbk.MemoryType = MEM_ME; |
4059 | i = 1; | 4059 | i = 1; |
4060 | used = 0; | 4060 | used = 0; |
4061 | while (used != MemStatus.MemoryUsed) { | 4061 | while (used != MemStatus.MemoryUsed) { |
4062 | Pbk.Location = i; | 4062 | Pbk.Location = i; |
4063 | error=Phone->GetMemory(&s, &Pbk); | 4063 | error=Phone->GetMemory(&s, &Pbk); |
4064 | if (error != ERR_EMPTY) { | 4064 | if (error != ERR_EMPTY) { |
4065 | Print_Error(error); | 4065 | Print_Error(error); |
4066 | if (used < GSM_BACKUP_MAX_PHONEPHONEBOOK) { | 4066 | if (used < GSM_BACKUP_MAX_PHONEPHONEBOOK) { |
4067 | Backup.PhonePhonebook[used] = malloc(sizeof(GSM_MemoryEntry)); | 4067 | Backup.PhonePhonebook[used] = malloc(sizeof(GSM_MemoryEntry)); |
4068 | if (Backup.PhonePhonebook[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4068 | if (Backup.PhonePhonebook[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4069 | Backup.PhonePhonebook[used+1] = NULL; | 4069 | Backup.PhonePhonebook[used+1] = NULL; |
4070 | } else { | 4070 | } else { |
4071 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_PHONEPHONEBOOK"); | 4071 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_PHONEPHONEBOOK"); |
4072 | GSM_Terminate(); | 4072 | GSM_Terminate(); |
4073 | exit(-1); | 4073 | exit(-1); |
4074 | } | 4074 | } |
4075 | *Backup.PhonePhonebook[used]=Pbk; | 4075 | *Backup.PhonePhonebook[used]=Pbk; |
4076 | used++; | 4076 | used++; |
4077 | } | 4077 | } |
4078 | printmsgerr("%c Reading: %i percent",13,used*100/MemStatus.MemoryUsed); | 4078 | printmsgerr("%c Reading: %i percent",13,used*100/MemStatus.MemoryUsed); |
4079 | i++; | 4079 | i++; |
4080 | if (gshutdown) { | 4080 | if (gshutdown) { |
4081 | GSM_Terminate(); | 4081 | GSM_Terminate(); |
4082 | exit(0); | 4082 | exit(0); |
4083 | } | 4083 | } |
4084 | } | 4084 | } |
4085 | printmsgerr("\n"); | 4085 | printmsgerr("\n"); |
4086 | } | 4086 | } |
4087 | DoBackup = false; | 4087 | DoBackup = false; |
4088 | if (Info.SIMPhonebook) { | 4088 | if (Info.SIMPhonebook) { |
4089 | printmsg("Checking SIM phonebook\n"); | 4089 | printmsg("Checking SIM phonebook\n"); |
4090 | MemStatus.MemoryType = MEM_SM; | 4090 | MemStatus.MemoryType = MEM_SM; |
4091 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 4091 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
4092 | if (error==ERR_NONE && MemStatus.MemoryUsed != 0) { | 4092 | if (error==ERR_NONE && MemStatus.MemoryUsed != 0) { |
4093 | if (answer_yes(" Backup SIM phonebook")) DoBackup=true; | 4093 | if (answer_yes(" Backup SIM phonebook")) DoBackup=true; |
4094 | } | 4094 | } |
4095 | } | 4095 | } |
4096 | if (DoBackup) { | 4096 | if (DoBackup) { |
4097 | Pbk.MemoryType = MEM_SM; | 4097 | Pbk.MemoryType = MEM_SM; |
4098 | i = 1; | 4098 | i = 1; |
4099 | used = 0; | 4099 | used = 0; |
4100 | while (used != MemStatus.MemoryUsed) { | 4100 | while (used != MemStatus.MemoryUsed) { |
4101 | Pbk.Location = i; | 4101 | Pbk.Location = i; |
4102 | error=Phone->GetMemory(&s, &Pbk); | 4102 | error=Phone->GetMemory(&s, &Pbk); |
4103 | if (error != ERR_EMPTY) { | 4103 | if (error != ERR_EMPTY) { |
4104 | Print_Error(error); | 4104 | Print_Error(error); |
4105 | if (used < GSM_BACKUP_MAX_SIMPHONEBOOK) { | 4105 | if (used < GSM_BACKUP_MAX_SIMPHONEBOOK) { |
4106 | Backup.SIMPhonebook[used] = malloc(sizeof(GSM_MemoryEntry)); | 4106 | Backup.SIMPhonebook[used] = malloc(sizeof(GSM_MemoryEntry)); |
4107 | if (Backup.SIMPhonebook[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4107 | if (Backup.SIMPhonebook[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4108 | Backup.SIMPhonebook[used + 1] = NULL; | 4108 | Backup.SIMPhonebook[used + 1] = NULL; |
4109 | } else { | 4109 | } else { |
4110 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SIMPHONEBOOK"); | 4110 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SIMPHONEBOOK"); |
4111 | GSM_Terminate(); | 4111 | GSM_Terminate(); |
4112 | exit(-1); | 4112 | exit(-1); |
4113 | } | 4113 | } |
4114 | *Backup.SIMPhonebook[used]=Pbk; | 4114 | *Backup.SIMPhonebook[used]=Pbk; |
4115 | used++; | 4115 | used++; |
4116 | } | 4116 | } |
4117 | printmsgerr("%c Reading: %i percent",13,used*100/MemStatus.MemoryUsed); | 4117 | printmsgerr("%c Reading: %i percent",13,used*100/MemStatus.MemoryUsed); |
4118 | i++; | 4118 | i++; |
4119 | if (gshutdown) { | 4119 | if (gshutdown) { |
4120 | GSM_Terminate(); | 4120 | GSM_Terminate(); |
4121 | exit(0); | 4121 | exit(0); |
4122 | } | 4122 | } |
4123 | } | 4123 | } |
4124 | printmsgerr("\n"); | 4124 | printmsgerr("\n"); |
4125 | } | 4125 | } |
4126 | DoBackup = false; | 4126 | DoBackup = false; |
4127 | if (Info.Calendar) { | 4127 | if (Info.Calendar) { |
4128 | printmsg("Checking calendar\n"); | 4128 | printmsg("Checking calendar\n"); |
4129 | error=Phone->GetNextCalendar(&s,&Calendar,true); | 4129 | error=Phone->GetNextCalendar(&s,&Calendar,true); |
4130 | if (error==ERR_NONE) { | 4130 | if (error==ERR_NONE) { |
4131 | if (answer_yes(" Backup calendar notes")) DoBackup = true; | 4131 | if (answer_yes(" Backup calendar notes")) DoBackup = true; |
4132 | } | 4132 | } |
4133 | } | 4133 | } |
4134 | if (DoBackup) { | 4134 | if (DoBackup) { |
4135 | used = 0; | 4135 | used = 0; |
4136 | printmsgerr(" Reading : "); | 4136 | printmsgerr(" Reading : "); |
4137 | while (error == ERR_NONE) { | 4137 | while (error == ERR_NONE) { |
4138 | if (used < GSM_MAXCALENDARTODONOTES) { | 4138 | if (used < GSM_MAXCALENDARTODONOTES) { |
4139 | Backup.Calendar[used] = malloc(sizeof(GSM_CalendarEntry)); | 4139 | Backup.Calendar[used] = malloc(sizeof(GSM_CalendarEntry)); |
4140 | if (Backup.Calendar[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4140 | if (Backup.Calendar[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4141 | Backup.Calendar[used+1] = NULL; | 4141 | Backup.Calendar[used+1] = NULL; |
4142 | } else { | 4142 | } else { |
4143 | printmsg(" Increase %s\n" , "GSM_MAXCALENDARTODONOTES"); | 4143 | printmsg(" Increase %s\n" , "GSM_MAXCALENDARTODONOTES"); |
4144 | GSM_Terminate(); | 4144 | GSM_Terminate(); |
4145 | exit(-1); | 4145 | exit(-1); |
4146 | } | 4146 | } |
4147 | *Backup.Calendar[used]=Calendar; | 4147 | *Backup.Calendar[used]=Calendar; |
4148 | used ++; | 4148 | used ++; |
4149 | error=Phone->GetNextCalendar(&s,&Calendar,false); | 4149 | error=Phone->GetNextCalendar(&s,&Calendar,false); |
4150 | printmsgerr("*"); | 4150 | printmsgerr("*"); |
4151 | if (gshutdown) { | 4151 | if (gshutdown) { |
4152 | GSM_Terminate(); | 4152 | GSM_Terminate(); |
4153 | exit(0); | 4153 | exit(0); |
4154 | } | 4154 | } |
4155 | } | 4155 | } |
4156 | printmsgerr("\n"); | 4156 | printmsgerr("\n"); |
4157 | } | 4157 | } |
4158 | DoBackup = false; | 4158 | DoBackup = false; |
4159 | if (Info.ToDo) { | 4159 | if (Info.ToDo) { |
4160 | printmsg("Checking ToDo\n"); | 4160 | printmsg("Checking ToDo\n"); |
4161 | error=Phone->GetToDoStatus(&s,&ToDoStatus); | 4161 | error=Phone->GetToDoStatus(&s,&ToDoStatus); |
4162 | if (error == ERR_NONE && ToDoStatus.Used != 0) { | 4162 | if (error == ERR_NONE && ToDoStatus.Used != 0) { |
4163 | if (answer_yes(" Backup ToDo")) DoBackup = true; | 4163 | if (answer_yes(" Backup ToDo")) DoBackup = true; |
4164 | } | 4164 | } |
4165 | } | 4165 | } |
4166 | if (DoBackup) { | 4166 | if (DoBackup) { |
4167 | used = 0; | 4167 | used = 0; |
4168 | error=Phone->GetNextToDo(&s,&ToDo,true); | 4168 | error=Phone->GetNextToDo(&s,&ToDo,true); |
4169 | while (error == ERR_NONE) { | 4169 | while (error == ERR_NONE) { |
4170 | if (used < GSM_MAXCALENDARTODONOTES) { | 4170 | if (used < GSM_MAXCALENDARTODONOTES) { |
4171 | Backup.ToDo[used] = malloc(sizeof(GSM_ToDoEntry)); | 4171 | Backup.ToDo[used] = malloc(sizeof(GSM_ToDoEntry)); |
4172 | if (Backup.ToDo[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4172 | if (Backup.ToDo[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4173 | Backup.ToDo[used+1] = NULL; | 4173 | Backup.ToDo[used+1] = NULL; |
4174 | } else { | 4174 | } else { |
4175 | printmsg(" Increase %s\n" , "GSM_MAXCALENDARTODONOTES"); | 4175 | printmsg(" Increase %s\n" , "GSM_MAXCALENDARTODONOTES"); |
4176 | GSM_Terminate(); | 4176 | GSM_Terminate(); |
4177 | exit(-1); | 4177 | exit(-1); |
4178 | } | 4178 | } |
4179 | *Backup.ToDo[used]=ToDo; | 4179 | *Backup.ToDo[used]=ToDo; |
4180 | used ++; | 4180 | used ++; |
4181 | error=Phone->GetNextToDo(&s,&ToDo,false); | 4181 | error=Phone->GetNextToDo(&s,&ToDo,false); |
4182 | printmsgerr("%c Reading: %i percent",13,used*100/ToDoStatus.Used); | 4182 | printmsgerr("%c Reading: %i percent",13,used*100/ToDoStatus.Used); |
4183 | if (gshutdown) { | 4183 | if (gshutdown) { |
4184 | GSM_Terminate(); | 4184 | GSM_Terminate(); |
4185 | exit(0); | 4185 | exit(0); |
4186 | } | 4186 | } |
4187 | } | 4187 | } |
4188 | printmsgerr("\n"); | 4188 | printmsgerr("\n"); |
4189 | } | 4189 | } |
4190 | DoBackup = false; | 4190 | DoBackup = false; |
4191 | if (Info.Note) { | 4191 | if (Info.Note) { |
4192 | printmsg("Checking notes\n"); | 4192 | printmsg("Checking notes\n"); |
4193 | error=Phone->GetNextNote(&s,&Note,true); | 4193 | error=Phone->GetNextNote(&s,&Note,true); |
4194 | if (error==ERR_NONE) { | 4194 | if (error==ERR_NONE) { |
4195 | if (answer_yes(" Backup notes")) DoBackup = true; | 4195 | if (answer_yes(" Backup notes")) DoBackup = true; |
4196 | } | 4196 | } |
4197 | } | 4197 | } |
4198 | if (DoBackup) { | 4198 | if (DoBackup) { |
4199 | used = 0; | 4199 | used = 0; |
4200 | printmsgerr(" Reading : "); | 4200 | printmsgerr(" Reading : "); |
4201 | while (error == ERR_NONE) { | 4201 | while (error == ERR_NONE) { |
4202 | if (used < GSM_BACKUP_MAX_NOTE) { | 4202 | if (used < GSM_BACKUP_MAX_NOTE) { |
4203 | Backup.Note[used] = malloc(sizeof(GSM_NoteEntry)); | 4203 | Backup.Note[used] = malloc(sizeof(GSM_NoteEntry)); |
4204 | if (Backup.Note[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4204 | if (Backup.Note[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4205 | Backup.Note[used+1] = NULL; | 4205 | Backup.Note[used+1] = NULL; |
4206 | } else { | 4206 | } else { |
4207 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_NOTE"); | 4207 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_NOTE"); |
4208 | GSM_Terminate(); | 4208 | GSM_Terminate(); |
4209 | exit(-1); | 4209 | exit(-1); |
4210 | } | 4210 | } |
4211 | *Backup.Note[used]=Note; | 4211 | *Backup.Note[used]=Note; |
4212 | used ++; | 4212 | used ++; |
4213 | error=Phone->GetNextNote(&s,&Note,false); | 4213 | error=Phone->GetNextNote(&s,&Note,false); |
4214 | printmsgerr("*"); | 4214 | printmsgerr("*"); |
4215 | if (gshutdown) { | 4215 | if (gshutdown) { |
4216 | GSM_Terminate(); | 4216 | GSM_Terminate(); |
4217 | exit(0); | 4217 | exit(0); |
4218 | } | 4218 | } |
4219 | } | 4219 | } |
4220 | printmsgerr("\n"); | 4220 | printmsgerr("\n"); |
4221 | } | 4221 | } |
4222 | DoBackup = false; | 4222 | DoBackup = false; |
4223 | if (Info.CallerLogos) { | 4223 | if (Info.CallerLogos) { |
4224 | printmsg("Checking caller logos\n"); | 4224 | printmsg("Checking caller logos\n"); |
4225 | Bitmap.Type = GSM_CallerGroupLogo; | 4225 | Bitmap.Type = GSM_CallerGroupLogo; |
4226 | Bitmap.Location = 1; | 4226 | Bitmap.Location = 1; |
4227 | error=Phone->GetBitmap(&s,&Bitmap); | 4227 | error=Phone->GetBitmap(&s,&Bitmap); |
4228 | if (error == ERR_NONE) { | 4228 | if (error == ERR_NONE) { |
4229 | if (answer_yes(" Backup caller groups and logos")) DoBackup = true; | 4229 | if (answer_yes(" Backup caller groups and logos")) DoBackup = true; |
4230 | } | 4230 | } |
4231 | } | 4231 | } |
4232 | if (DoBackup) { | 4232 | if (DoBackup) { |
4233 | printmsgerr(" Reading : "); | 4233 | printmsgerr(" Reading : "); |
4234 | error = ERR_NONE; | 4234 | error = ERR_NONE; |
4235 | used = 0; | 4235 | used = 0; |
4236 | while (error == ERR_NONE) { | 4236 | while (error == ERR_NONE) { |
4237 | if (used < GSM_BACKUP_MAX_CALLER) { | 4237 | if (used < GSM_BACKUP_MAX_CALLER) { |
4238 | Backup.CallerLogos[used] = malloc(sizeof(GSM_Bitmap)); | 4238 | Backup.CallerLogos[used] = malloc(sizeof(GSM_Bitmap)); |
4239 | if (Backup.CallerLogos[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4239 | if (Backup.CallerLogos[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4240 | Backup.CallerLogos[used+1] = NULL; | 4240 | Backup.CallerLogos[used+1] = NULL; |
4241 | } else { | 4241 | } else { |
4242 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_CALLER"); | 4242 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_CALLER"); |
4243 | GSM_Terminate(); | 4243 | GSM_Terminate(); |
4244 | exit(-1); | 4244 | exit(-1); |
4245 | } | 4245 | } |
4246 | *Backup.CallerLogos[used] = Bitmap; | 4246 | *Backup.CallerLogos[used] = Bitmap; |
4247 | used ++; | 4247 | used ++; |
4248 | Bitmap.Location = used + 1; | 4248 | Bitmap.Location = used + 1; |
4249 | error=Phone->GetBitmap(&s,&Bitmap); | 4249 | error=Phone->GetBitmap(&s,&Bitmap); |
4250 | printmsgerr("*"); | 4250 | printmsgerr("*"); |
4251 | if (gshutdown) { | 4251 | if (gshutdown) { |
4252 | GSM_Terminate(); | 4252 | GSM_Terminate(); |
4253 | exit(0); | 4253 | exit(0); |
4254 | } | 4254 | } |
4255 | } | 4255 | } |
4256 | printmsgerr("\n"); | 4256 | printmsgerr("\n"); |
4257 | } | 4257 | } |
4258 | DoBackup = false; | 4258 | DoBackup = false; |
4259 | if (Info.SMSC) { | 4259 | if (Info.SMSC) { |
4260 | printmsg("Checking SMS profiles\n"); | 4260 | printmsg("Checking SMS profiles\n"); |
4261 | if (answer_yes(" Backup SMS profiles")) DoBackup = true; | 4261 | if (answer_yes(" Backup SMS profiles")) DoBackup = true; |
4262 | } | 4262 | } |
4263 | if (DoBackup) { | 4263 | if (DoBackup) { |
4264 | used = 0; | 4264 | used = 0; |
4265 | printmsgerr(" Reading: "); | 4265 | printmsgerr(" Reading: "); |
4266 | while (true) { | 4266 | while (true) { |
4267 | SMSC.Location = used + 1; | 4267 | SMSC.Location = used + 1; |
4268 | error = Phone->GetSMSC(&s,&SMSC); | 4268 | error = Phone->GetSMSC(&s,&SMSC); |
4269 | if (error != ERR_NONE) break; | 4269 | if (error != ERR_NONE) break; |
4270 | if (used < GSM_BACKUP_MAX_SMSC) { | 4270 | if (used < GSM_BACKUP_MAX_SMSC) { |
4271 | Backup.SMSC[used] = malloc(sizeof(GSM_SMSC)); | 4271 | Backup.SMSC[used] = malloc(sizeof(GSM_SMSC)); |
4272 | if (Backup.SMSC[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4272 | if (Backup.SMSC[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4273 | Backup.SMSC[used + 1] = NULL; | 4273 | Backup.SMSC[used + 1] = NULL; |
4274 | } else { | 4274 | } else { |
4275 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SMSC"); | 4275 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SMSC"); |
4276 | GSM_Terminate(); | 4276 | GSM_Terminate(); |
4277 | exit(-1); | 4277 | exit(-1); |
4278 | } | 4278 | } |
4279 | *Backup.SMSC[used]=SMSC; | 4279 | *Backup.SMSC[used]=SMSC; |
4280 | used++; | 4280 | used++; |
4281 | printmsgerr("*"); | 4281 | printmsgerr("*"); |
4282 | } | 4282 | } |
4283 | printmsgerr("\n"); | 4283 | printmsgerr("\n"); |
4284 | } | 4284 | } |
4285 | DoBackup = false; | 4285 | DoBackup = false; |
4286 | if (Info.StartupLogo) { | 4286 | if (Info.StartupLogo) { |
4287 | printmsg("Checking startup text\n"); | 4287 | printmsg("Checking startup text\n"); |
4288 | Bitmap.Type = GSM_WelcomeNote_Text; | 4288 | Bitmap.Type = GSM_WelcomeNote_Text; |
4289 | error = Phone->GetBitmap(&s,&Bitmap); | 4289 | error = Phone->GetBitmap(&s,&Bitmap); |
4290 | if (error == ERR_NONE) { | 4290 | if (error == ERR_NONE) { |
4291 | if (answer_yes(" Backup startup logo/text")) DoBackup = true; | 4291 | if (answer_yes(" Backup startup logo/text")) DoBackup = true; |
4292 | } | 4292 | } |
4293 | } | 4293 | } |
4294 | if (DoBackup) { | 4294 | if (DoBackup) { |
4295 | Backup.StartupLogo = malloc(sizeof(GSM_Bitmap)); | 4295 | Backup.StartupLogo = malloc(sizeof(GSM_Bitmap)); |
4296 | if (Backup.StartupLogo == NULL) Print_Error(ERR_MOREMEMORY); | 4296 | if (Backup.StartupLogo == NULL) Print_Error(ERR_MOREMEMORY); |
4297 | *Backup.StartupLogo = Bitmap; | 4297 | *Backup.StartupLogo = Bitmap; |
4298 | if (Bitmap.Text[0]==0 && Bitmap.Text[1]==0) { | 4298 | if (Bitmap.Text[0]==0 && Bitmap.Text[1]==0) { |
4299 | Bitmap.Type = GSM_StartupLogo; | 4299 | Bitmap.Type = GSM_StartupLogo; |
4300 | error = Phone->GetBitmap(&s,&Bitmap); | 4300 | error = Phone->GetBitmap(&s,&Bitmap); |
4301 | if (error == ERR_NONE) *Backup.StartupLogo = Bitmap; | 4301 | if (error == ERR_NONE) *Backup.StartupLogo = Bitmap; |
4302 | } | 4302 | } |
4303 | } | 4303 | } |
4304 | DoBackup = false; | 4304 | DoBackup = false; |
4305 | if (Info.OperatorLogo) { | 4305 | if (Info.OperatorLogo) { |
4306 | printmsg("Checking operator logo\n"); | 4306 | printmsg("Checking operator logo\n"); |
4307 | Bitmap.Type = GSM_OperatorLogo; | 4307 | Bitmap.Type = GSM_OperatorLogo; |
4308 | error=Phone->GetBitmap(&s,&Bitmap); | 4308 | error=Phone->GetBitmap(&s,&Bitmap); |
4309 | if (error == ERR_NONE) { | 4309 | if (error == ERR_NONE) { |
4310 | if (strcmp(Bitmap.NetworkCode,"000 00")!=0) { | 4310 | if (strcmp(Bitmap.NetworkCode,"000 00")!=0) { |
4311 | if (answer_yes(" Backup operator logo")) DoBackup = true; | 4311 | if (answer_yes(" Backup operator logo")) DoBackup = true; |
4312 | } | 4312 | } |
4313 | } | 4313 | } |
4314 | } | 4314 | } |
4315 | if (DoBackup) { | 4315 | if (DoBackup) { |
4316 | Backup.OperatorLogo = malloc(sizeof(GSM_Bitmap)); | 4316 | Backup.OperatorLogo = malloc(sizeof(GSM_Bitmap)); |
4317 | if (Backup.OperatorLogo == NULL) Print_Error(ERR_MOREMEMORY); | 4317 | if (Backup.OperatorLogo == NULL) Print_Error(ERR_MOREMEMORY); |
4318 | *Backup.OperatorLogo = Bitmap; | 4318 | *Backup.OperatorLogo = Bitmap; |
4319 | } | 4319 | } |
4320 | DoBackup = false; | 4320 | DoBackup = false; |
4321 | if (Info.WAPBookmark) { | 4321 | if (Info.WAPBookmark) { |
4322 | printmsg("Checking WAP bookmarks\n"); | 4322 | printmsg("Checking WAP bookmarks\n"); |
4323 | Bookmark.Location = 1; | 4323 | Bookmark.Location = 1; |
4324 | error=Phone->GetWAPBookmark(&s,&Bookmark); | 4324 | error=Phone->GetWAPBookmark(&s,&Bookmark); |
4325 | if (error==ERR_NONE) { | 4325 | if (error==ERR_NONE) { |
4326 | if (answer_yes(" Backup WAP bookmarks")) DoBackup = true; | 4326 | if (answer_yes(" Backup WAP bookmarks")) DoBackup = true; |
4327 | } | 4327 | } |
4328 | } | 4328 | } |
4329 | if (DoBackup) { | 4329 | if (DoBackup) { |
4330 | used = 0; | 4330 | used = 0; |
4331 | printmsgerr(" Reading : "); | 4331 | printmsgerr(" Reading : "); |
4332 | while (error == ERR_NONE) { | 4332 | while (error == ERR_NONE) { |
4333 | if (used < GSM_BACKUP_MAX_WAPBOOKMARK) { | 4333 | if (used < GSM_BACKUP_MAX_WAPBOOKMARK) { |
4334 | Backup.WAPBookmark[used] = malloc(sizeof(GSM_WAPBookmark)); | 4334 | Backup.WAPBookmark[used] = malloc(sizeof(GSM_WAPBookmark)); |
4335 | if (Backup.WAPBookmark[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4335 | if (Backup.WAPBookmark[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4336 | Backup.WAPBookmark[used+1] = NULL; | 4336 | Backup.WAPBookmark[used+1] = NULL; |
4337 | } else { | 4337 | } else { |
4338 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_WAPBOOKMARK"); | 4338 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_WAPBOOKMARK"); |
4339 | GSM_Terminate(); | 4339 | GSM_Terminate(); |
4340 | exit(-1); | 4340 | exit(-1); |
4341 | } | 4341 | } |
4342 | *Backup.WAPBookmark[used]=Bookmark; | 4342 | *Backup.WAPBookmark[used]=Bookmark; |
4343 | used ++; | 4343 | used ++; |
4344 | Bookmark.Location = used+1; | 4344 | Bookmark.Location = used+1; |
4345 | error=Phone->GetWAPBookmark(&s,&Bookmark); | 4345 | error=Phone->GetWAPBookmark(&s,&Bookmark); |
4346 | printmsgerr("*"); | 4346 | printmsgerr("*"); |
4347 | if (gshutdown) { | 4347 | if (gshutdown) { |
4348 | GSM_Terminate(); | 4348 | GSM_Terminate(); |
4349 | exit(0); | 4349 | exit(0); |
4350 | } | 4350 | } |
4351 | } | 4351 | } |
4352 | printmsgerr("\n"); | 4352 | printmsgerr("\n"); |
4353 | } | 4353 | } |
4354 | DoBackup = false; | 4354 | DoBackup = false; |
4355 | if (Info.WAPSettings) { | 4355 | if (Info.WAPSettings) { |
4356 | printmsg("Checking WAP settings\n"); | 4356 | printmsg("Checking WAP settings\n"); |
4357 | Settings.Location = 1; | 4357 | Settings.Location = 1; |
4358 | error=Phone->GetWAPSettings(&s,&Settings); | 4358 | error=Phone->GetWAPSettings(&s,&Settings); |
4359 | if (error==ERR_NONE) { | 4359 | if (error==ERR_NONE) { |
4360 | if (answer_yes(" Backup WAP settings")) DoBackup = true; | 4360 | if (answer_yes(" Backup WAP settings")) DoBackup = true; |
4361 | } | 4361 | } |
4362 | } | 4362 | } |
4363 | if (DoBackup) { | 4363 | if (DoBackup) { |
4364 | used = 0; | 4364 | used = 0; |
4365 | printmsgerr(" Reading : "); | 4365 | printmsgerr(" Reading : "); |
4366 | while (error == ERR_NONE) { | 4366 | while (error == ERR_NONE) { |
4367 | if (used < GSM_BACKUP_MAX_WAPSETTINGS) { | 4367 | if (used < GSM_BACKUP_MAX_WAPSETTINGS) { |
4368 | Backup.WAPSettings[used] = malloc(sizeof(GSM_MultiWAPSettings)); | 4368 | Backup.WAPSettings[used] = malloc(sizeof(GSM_MultiWAPSettings)); |
4369 | if (Backup.WAPSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4369 | if (Backup.WAPSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4370 | Backup.WAPSettings[used+1] = NULL; | 4370 | Backup.WAPSettings[used+1] = NULL; |
4371 | } else { | 4371 | } else { |
4372 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_WAPSETTINGS"); | 4372 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_WAPSETTINGS"); |
4373 | GSM_Terminate(); | 4373 | GSM_Terminate(); |
4374 | exit(-1); | 4374 | exit(-1); |
4375 | } | 4375 | } |
4376 | *Backup.WAPSettings[used]=Settings; | 4376 | *Backup.WAPSettings[used]=Settings; |
4377 | used ++; | 4377 | used ++; |
4378 | Settings.Location = used+1; | 4378 | Settings.Location = used+1; |
4379 | error=Phone->GetWAPSettings(&s,&Settings); | 4379 | error=Phone->GetWAPSettings(&s,&Settings); |
4380 | printmsgerr("*"); | 4380 | printmsgerr("*"); |
4381 | if (gshutdown) { | 4381 | if (gshutdown) { |
4382 | GSM_Terminate(); | 4382 | GSM_Terminate(); |
4383 | exit(0); | 4383 | exit(0); |
4384 | } | 4384 | } |
4385 | } | 4385 | } |
4386 | printmsgerr("\n"); | 4386 | printmsgerr("\n"); |
4387 | } | 4387 | } |
4388 | DoBackup = false; | 4388 | DoBackup = false; |
4389 | if (Info.MMSSettings) { | 4389 | if (Info.MMSSettings) { |
4390 | printmsg("Checking MMS settings\n"); | 4390 | printmsg("Checking MMS settings\n"); |
4391 | Settings.Location = 1; | 4391 | Settings.Location = 1; |
4392 | error=Phone->GetMMSSettings(&s,&Settings); | 4392 | error=Phone->GetMMSSettings(&s,&Settings); |
4393 | if (error==ERR_NONE) { | 4393 | if (error==ERR_NONE) { |
4394 | if (answer_yes(" Backup MMS settings")) DoBackup = true; | 4394 | if (answer_yes(" Backup MMS settings")) DoBackup = true; |
4395 | } | 4395 | } |
4396 | } | 4396 | } |
4397 | if (DoBackup) { | 4397 | if (DoBackup) { |
4398 | used = 0; | 4398 | used = 0; |
4399 | printmsgerr(" Reading : "); | 4399 | printmsgerr(" Reading : "); |
4400 | while (error == ERR_NONE) { | 4400 | while (error == ERR_NONE) { |
4401 | if (used < GSM_BACKUP_MAX_MMSSETTINGS) { | 4401 | if (used < GSM_BACKUP_MAX_MMSSETTINGS) { |
4402 | Backup.MMSSettings[used] = malloc(sizeof(GSM_MultiWAPSettings)); | 4402 | Backup.MMSSettings[used] = malloc(sizeof(GSM_MultiWAPSettings)); |
4403 | if (Backup.MMSSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4403 | if (Backup.MMSSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4404 | Backup.MMSSettings[used+1] = NULL; | 4404 | Backup.MMSSettings[used+1] = NULL; |
4405 | } else { | 4405 | } else { |
4406 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_MMSSETTINGS"); | 4406 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_MMSSETTINGS"); |
4407 | GSM_Terminate(); | 4407 | GSM_Terminate(); |
4408 | exit(-1); | 4408 | exit(-1); |
4409 | } | 4409 | } |
4410 | *Backup.MMSSettings[used]=Settings; | 4410 | *Backup.MMSSettings[used]=Settings; |
4411 | used ++; | 4411 | used ++; |
4412 | Settings.Location = used+1; | 4412 | Settings.Location = used+1; |
4413 | error=Phone->GetMMSSettings(&s,&Settings); | 4413 | error=Phone->GetMMSSettings(&s,&Settings); |
4414 | printmsgerr("*"); | 4414 | printmsgerr("*"); |
4415 | if (gshutdown) { | 4415 | if (gshutdown) { |
4416 | GSM_Terminate(); | 4416 | GSM_Terminate(); |
4417 | exit(0); | 4417 | exit(0); |
4418 | } | 4418 | } |
4419 | } | 4419 | } |
4420 | printmsgerr("\n"); | 4420 | printmsgerr("\n"); |
4421 | } | 4421 | } |
4422 | DoBackup = false; | 4422 | DoBackup = false; |
4423 | if (Info.ChatSettings) { | 4423 | if (Info.ChatSettings) { |
4424 | printmsg("Checking Chat settings\n"); | 4424 | printmsg("Checking Chat settings\n"); |
4425 | Chat.Location = 1; | 4425 | Chat.Location = 1; |
4426 | error=Phone->GetChatSettings(&s,&Chat); | 4426 | error=Phone->GetChatSettings(&s,&Chat); |
4427 | if (error==ERR_NONE) { | 4427 | if (error==ERR_NONE) { |
4428 | if (answer_yes(" Backup Chat settings")) DoBackup = true; | 4428 | if (answer_yes(" Backup Chat settings")) DoBackup = true; |
4429 | } | 4429 | } |
4430 | } | 4430 | } |
4431 | if (DoBackup) { | 4431 | if (DoBackup) { |
4432 | used = 0; | 4432 | used = 0; |
4433 | printmsgerr(" Reading : "); | 4433 | printmsgerr(" Reading : "); |
4434 | while (error == ERR_NONE) { | 4434 | while (error == ERR_NONE) { |
4435 | if (used < GSM_BACKUP_MAX_CHATSETTINGS) { | 4435 | if (used < GSM_BACKUP_MAX_CHATSETTINGS) { |
4436 | Backup.ChatSettings[used] = malloc(sizeof(GSM_ChatSettings)); | 4436 | Backup.ChatSettings[used] = malloc(sizeof(GSM_ChatSettings)); |
4437 | if (Backup.ChatSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4437 | if (Backup.ChatSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4438 | Backup.ChatSettings[used+1] = NULL; | 4438 | Backup.ChatSettings[used+1] = NULL; |
4439 | } else { | 4439 | } else { |
4440 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_CHATSETTINGS"); | 4440 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_CHATSETTINGS"); |
4441 | GSM_Terminate(); | 4441 | GSM_Terminate(); |
4442 | exit(-1); | 4442 | exit(-1); |
4443 | } | 4443 | } |
4444 | *Backup.ChatSettings[used]=Chat; | 4444 | *Backup.ChatSettings[used]=Chat; |
4445 | used ++; | 4445 | used ++; |
4446 | Chat.Location = used+1; | 4446 | Chat.Location = used+1; |
4447 | error=Phone->GetChatSettings(&s,&Chat); | 4447 | error=Phone->GetChatSettings(&s,&Chat); |
4448 | printmsgerr("*"); | 4448 | printmsgerr("*"); |
4449 | if (gshutdown) { | 4449 | if (gshutdown) { |
4450 | GSM_Terminate(); | 4450 | GSM_Terminate(); |
4451 | exit(0); | 4451 | exit(0); |
4452 | } | 4452 | } |
4453 | } | 4453 | } |
4454 | printmsgerr("\n"); | 4454 | printmsgerr("\n"); |
4455 | } | 4455 | } |
4456 | DoBackup = false; | 4456 | DoBackup = false; |
4457 | if (Info.SyncMLSettings) { | 4457 | if (Info.SyncMLSettings) { |
4458 | printmsg("Checking SyncML settings\n"); | 4458 | printmsg("Checking SyncML settings\n"); |
4459 | SyncML.Location = 1; | 4459 | SyncML.Location = 1; |
4460 | error=Phone->GetSyncMLSettings(&s,&SyncML); | 4460 | error=Phone->GetSyncMLSettings(&s,&SyncML); |
4461 | if (error==ERR_NONE) { | 4461 | if (error==ERR_NONE) { |
4462 | if (answer_yes(" Backup SyncML settings")) DoBackup = true; | 4462 | if (answer_yes(" Backup SyncML settings")) DoBackup = true; |
4463 | } | 4463 | } |
4464 | } | 4464 | } |
4465 | if (DoBackup) { | 4465 | if (DoBackup) { |
4466 | used = 0; | 4466 | used = 0; |
4467 | printmsgerr(" Reading : "); | 4467 | printmsgerr(" Reading : "); |
4468 | while (error == ERR_NONE) { | 4468 | while (error == ERR_NONE) { |
4469 | if (used < GSM_BACKUP_MAX_SYNCMLSETTINGS) { | 4469 | if (used < GSM_BACKUP_MAX_SYNCMLSETTINGS) { |
4470 | Backup.SyncMLSettings[used] = malloc(sizeof(GSM_SyncMLSettings)); | 4470 | Backup.SyncMLSettings[used] = malloc(sizeof(GSM_SyncMLSettings)); |
4471 | if (Backup.SyncMLSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4471 | if (Backup.SyncMLSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4472 | Backup.SyncMLSettings[used+1] = NULL; | 4472 | Backup.SyncMLSettings[used+1] = NULL; |
4473 | } else { | 4473 | } else { |
4474 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SYNCMLSETTINGS"); | 4474 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SYNCMLSETTINGS"); |
4475 | GSM_Terminate(); | 4475 | GSM_Terminate(); |
4476 | exit(-1); | 4476 | exit(-1); |
4477 | } | 4477 | } |
4478 | *Backup.SyncMLSettings[used]=SyncML; | 4478 | *Backup.SyncMLSettings[used]=SyncML; |
4479 | used ++; | 4479 | used ++; |
4480 | SyncML.Location = used+1; | 4480 | SyncML.Location = used+1; |
4481 | error=Phone->GetSyncMLSettings(&s,&SyncML); | 4481 | error=Phone->GetSyncMLSettings(&s,&SyncML); |
4482 | printmsgerr("*"); | 4482 | printmsgerr("*"); |
4483 | if (gshutdown) { | 4483 | if (gshutdown) { |
4484 | GSM_Terminate(); | 4484 | GSM_Terminate(); |
4485 | exit(0); | 4485 | exit(0); |
4486 | } | 4486 | } |
4487 | } | 4487 | } |
4488 | printmsgerr("\n"); | 4488 | printmsgerr("\n"); |
4489 | } | 4489 | } |
4490 | DoBackup = false; | 4490 | DoBackup = false; |
4491 | if (Info.Ringtone) { | 4491 | if (Info.Ringtone) { |
4492 | printmsg("Checking user ringtones\n"); | 4492 | printmsg("Checking user ringtones\n"); |
4493 | Ringtone.Location = 1; | 4493 | Ringtone.Location = 1; |
4494 | Ringtone.Format = 0; | 4494 | Ringtone.Format = 0; |
4495 | error=Phone->GetRingtone(&s,&Ringtone,false); | 4495 | error=Phone->GetRingtone(&s,&Ringtone,false); |
4496 | if (error==ERR_EMPTY || error == ERR_NONE) { | 4496 | if (error==ERR_EMPTY || error == ERR_NONE) { |
4497 | if (answer_yes(" Backup user ringtones")) DoBackup = true; | 4497 | if (answer_yes(" Backup user ringtones")) DoBackup = true; |
4498 | } | 4498 | } |
4499 | } | 4499 | } |
4500 | if (DoBackup) { | 4500 | if (DoBackup) { |
4501 | used = 0; | 4501 | used = 0; |
4502 | i= 1; | 4502 | i= 1; |
4503 | printmsgerr(" Reading : "); | 4503 | printmsgerr(" Reading : "); |
4504 | while (error == ERR_NONE || error == ERR_EMPTY) { | 4504 | while (error == ERR_NONE || error == ERR_EMPTY) { |
4505 | if (error == ERR_NONE) { | 4505 | if (error == ERR_NONE) { |
4506 | if (used < GSM_BACKUP_MAX_RINGTONES) { | 4506 | if (used < GSM_BACKUP_MAX_RINGTONES) { |
4507 | Backup.Ringtone[used] = malloc(sizeof(GSM_Ringtone)); | 4507 | Backup.Ringtone[used] = malloc(sizeof(GSM_Ringtone)); |
4508 | if (Backup.Ringtone[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4508 | if (Backup.Ringtone[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4509 | Backup.Ringtone[used+1] = NULL; | 4509 | Backup.Ringtone[used+1] = NULL; |
4510 | } else { | 4510 | } else { |
4511 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_RINGTONES"); | 4511 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_RINGTONES"); |
4512 | GSM_Terminate(); | 4512 | GSM_Terminate(); |
4513 | exit(-1); | 4513 | exit(-1); |
4514 | } | 4514 | } |
4515 | *Backup.Ringtone[used]=Ringtone; | 4515 | *Backup.Ringtone[used]=Ringtone; |
4516 | used ++; | 4516 | used ++; |
4517 | } | 4517 | } |
4518 | i++; | 4518 | i++; |
4519 | Ringtone.Location = i; | 4519 | Ringtone.Location = i; |
4520 | Ringtone.Format = 0; | 4520 | Ringtone.Format = 0; |
4521 | error=Phone->GetRingtone(&s,&Ringtone,false); | 4521 | error=Phone->GetRingtone(&s,&Ringtone,false); |
4522 | printmsgerr("*"); | 4522 | printmsgerr("*"); |
4523 | if (gshutdown) { | 4523 | if (gshutdown) { |
4524 | GSM_Terminate(); | 4524 | GSM_Terminate(); |
4525 | exit(0); | 4525 | exit(0); |
4526 | } | 4526 | } |
4527 | } | 4527 | } |
4528 | printmsgerr("\n"); | 4528 | printmsgerr("\n"); |
4529 | } | 4529 | } |
4530 | DoBackup = false; | 4530 | DoBackup = false; |
4531 | if (Info.Profiles) { | 4531 | if (Info.Profiles) { |
4532 | printmsg("Checking phone profiles\n"); | 4532 | printmsg("Checking phone profiles\n"); |
4533 | Profile.Location = 1; | 4533 | Profile.Location = 1; |
4534 | error = Phone->GetProfile(&s,&Profile); | 4534 | error = Phone->GetProfile(&s,&Profile); |
4535 | if (error == ERR_NONE) { | 4535 | if (error == ERR_NONE) { |
4536 | if (answer_yes(" Backup phone profiles")) DoBackup = true; | 4536 | if (answer_yes(" Backup phone profiles")) DoBackup = true; |
4537 | } | 4537 | } |
4538 | } | 4538 | } |
4539 | if (DoBackup) { | 4539 | if (DoBackup) { |
4540 | used = 0; | 4540 | used = 0; |
4541 | printmsgerr(" Reading: "); | 4541 | printmsgerr(" Reading: "); |
4542 | while (true) { | 4542 | while (true) { |
4543 | Profile.Location = used + 1; | 4543 | Profile.Location = used + 1; |
4544 | error = Phone->GetProfile(&s,&Profile); | 4544 | error = Phone->GetProfile(&s,&Profile); |
4545 | if (error != ERR_NONE) break; | 4545 | if (error != ERR_NONE) break; |
4546 | if (used < GSM_BACKUP_MAX_PROFILES) { | 4546 | if (used < GSM_BACKUP_MAX_PROFILES) { |
4547 | Backup.Profiles[used] = malloc(sizeof(GSM_Profile)); | 4547 | Backup.Profiles[used] = malloc(sizeof(GSM_Profile)); |
4548 | if (Backup.Profiles[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4548 | if (Backup.Profiles[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4549 | Backup.Profiles[used + 1] = NULL; | 4549 | Backup.Profiles[used + 1] = NULL; |
4550 | } else { | 4550 | } else { |
4551 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_PROFILES"); | 4551 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_PROFILES"); |
4552 | GSM_Terminate(); | 4552 | GSM_Terminate(); |
4553 | exit(-1); | 4553 | exit(-1); |
4554 | } | 4554 | } |
4555 | *Backup.Profiles[used]=Profile; | 4555 | *Backup.Profiles[used]=Profile; |
4556 | used++; | 4556 | used++; |
4557 | printmsgerr("*"); | 4557 | printmsgerr("*"); |
4558 | } | 4558 | } |
4559 | printmsgerr("\n"); | 4559 | printmsgerr("\n"); |
4560 | } | 4560 | } |
4561 | DoBackup = false; | 4561 | DoBackup = false; |
4562 | if (Info.FMStation) { | 4562 | if (Info.FMStation) { |
4563 | printmsg("Checking FM stations\n"); | 4563 | printmsg("Checking FM stations\n"); |
4564 | FMStation.Location = 1; | 4564 | FMStation.Location = 1; |
4565 | error = Phone->GetFMStation(&s,&FMStation); | 4565 | error = Phone->GetFMStation(&s,&FMStation); |
4566 | if (error == ERR_NONE || error == ERR_EMPTY) { | 4566 | if (error == ERR_NONE || error == ERR_EMPTY) { |
4567 | if (answer_yes(" Backup phone FM stations")) DoBackup=true; | 4567 | if (answer_yes(" Backup phone FM stations")) DoBackup=true; |
4568 | } | 4568 | } |
4569 | } | 4569 | } |
4570 | if (DoBackup) { | 4570 | if (DoBackup) { |
4571 | used= 0; | 4571 | used= 0; |
4572 | i = 1; | 4572 | i = 1; |
4573 | printmsgerr(" Reading: "); | 4573 | printmsgerr(" Reading: "); |
4574 | while (error == ERR_NONE || error == ERR_EMPTY) { | 4574 | while (error == ERR_NONE || error == ERR_EMPTY) { |
4575 | error = Phone->GetFMStation(&s,&FMStation); | 4575 | error = Phone->GetFMStation(&s,&FMStation); |
4576 | if (error == ERR_NONE) { | 4576 | if (error == ERR_NONE) { |
4577 | if (used < GSM_BACKUP_MAX_FMSTATIONS) { | 4577 | if (used < GSM_BACKUP_MAX_FMSTATIONS) { |
4578 | Backup.FMStation[used] = malloc(sizeof(GSM_FMStation)); | 4578 | Backup.FMStation[used] = malloc(sizeof(GSM_FMStation)); |
4579 | if (Backup.FMStation[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4579 | if (Backup.FMStation[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4580 | Backup.FMStation[used + 1] = NULL; | 4580 | Backup.FMStation[used + 1] = NULL; |
4581 | } else { | 4581 | } else { |
4582 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_FMSTATIONS"); | 4582 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_FMSTATIONS"); |
4583 | GSM_Terminate(); | 4583 | GSM_Terminate(); |
4584 | exit(-1); | 4584 | exit(-1); |
4585 | } | 4585 | } |
4586 | *Backup.FMStation[used]=FMStation; | 4586 | *Backup.FMStation[used]=FMStation; |
4587 | used++; | 4587 | used++; |
4588 | } | 4588 | } |
4589 | i++; | 4589 | i++; |
4590 | FMStation.Location = i; | 4590 | FMStation.Location = i; |
4591 | printmsgerr("*"); | 4591 | printmsgerr("*"); |
4592 | } | 4592 | } |
4593 | printmsgerr("\n"); | 4593 | printmsgerr("\n"); |
4594 | } | 4594 | } |
4595 | DoBackup = false; | 4595 | DoBackup = false; |
4596 | if (Info.GPRSPoint) { | 4596 | if (Info.GPRSPoint) { |
4597 | printmsg("Checking GPRS access points\n"); | 4597 | printmsg("Checking GPRS access points\n"); |
4598 | GPRSPoint.Location = 1; | 4598 | GPRSPoint.Location = 1; |
4599 | error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint); | 4599 | error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint); |
4600 | if (error == ERR_NONE || error == ERR_EMPTY) { | 4600 | if (error == ERR_NONE || error == ERR_EMPTY) { |
4601 | if (answer_yes(" Backup GPRS access points")) DoBackup = true; | 4601 | if (answer_yes(" Backup GPRS access points")) DoBackup = true; |
4602 | } | 4602 | } |
4603 | } | 4603 | } |
4604 | if (DoBackup) { | 4604 | if (DoBackup) { |
4605 | used= 0; | 4605 | used= 0; |
4606 | i = 1; | 4606 | i = 1; |
4607 | printmsgerr(" Reading: "); | 4607 | printmsgerr(" Reading: "); |
4608 | while (error == ERR_NONE || error == ERR_EMPTY) { | 4608 | while (error == ERR_NONE || error == ERR_EMPTY) { |
4609 | error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint); | 4609 | error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint); |
4610 | if (error == ERR_NONE) { | 4610 | if (error == ERR_NONE) { |
4611 | if (used < GSM_BACKUP_MAX_GPRSPOINT) { | 4611 | if (used < GSM_BACKUP_MAX_GPRSPOINT) { |
4612 | Backup.GPRSPoint[used] = malloc(sizeof(GSM_GPRSAccessPoint)); | 4612 | Backup.GPRSPoint[used] = malloc(sizeof(GSM_GPRSAccessPoint)); |
4613 | if (Backup.GPRSPoint[used] == NULL) Print_Error(ERR_MOREMEMORY); | 4613 | if (Backup.GPRSPoint[used] == NULL) Print_Error(ERR_MOREMEMORY); |
4614 | Backup.GPRSPoint[used + 1] = NULL; | 4614 | Backup.GPRSPoint[used + 1] = NULL; |
4615 | } else { | 4615 | } else { |
4616 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_GPRSPOINT"); | 4616 | printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_GPRSPOINT"); |
4617 | GSM_Terminate(); | 4617 | GSM_Terminate(); |
4618 | exit(-1); | 4618 | exit(-1); |
4619 | } | 4619 | } |
4620 | *Backup.GPRSPoint[used]=GPRSPoint; | 4620 | *Backup.GPRSPoint[used]=GPRSPoint; |
4621 | used++; | 4621 | used++; |
4622 | } | 4622 | } |
4623 | i++; | 4623 | i++; |
4624 | GPRSPoint.Location = i; | 4624 | GPRSPoint.Location = i; |
4625 | printmsgerr("*"); | 4625 | printmsgerr("*"); |
4626 | } | 4626 | } |
4627 | printmsgerr("\n"); | 4627 | printmsgerr("\n"); |
4628 | } | 4628 | } |
4629 | 4629 | ||
4630 | GSM_Terminate(); | 4630 | GSM_Terminate(); |
4631 | 4631 | ||
4632 | GSM_SaveBackupFile(argv[2],&Backup, Info.UseUnicode); | 4632 | GSM_SaveBackupFile(argv[2],&Backup, Info.UseUnicode); |
4633 | GSM_FreeBackup(&Backup); | 4633 | GSM_FreeBackup(&Backup); |
4634 | } | 4634 | } |
4635 | 4635 | ||
4636 | static void Restore(int argc, char *argv[]) | 4636 | static void Restore(int argc, char *argv[]) |
4637 | { | 4637 | { |
4638 | GSM_Backup Backup; | 4638 | GSM_Backup Backup; |
4639 | GSM_FMStation FMStation; | 4639 | GSM_FMStation FMStation; |
4640 | GSM_DateTime date_time; | 4640 | GSM_DateTime date_time; |
4641 | GSM_CalendarEntryCalendar; | 4641 | GSM_CalendarEntryCalendar; |
4642 | GSM_Bitmap Bitmap; | 4642 | GSM_Bitmap Bitmap; |
4643 | GSM_Ringtone Ringtone; | 4643 | GSM_Ringtone Ringtone; |
4644 | GSM_MemoryEntry Pbk; | 4644 | GSM_MemoryEntry Pbk; |
4645 | GSM_MemoryStatusMemStatus; | 4645 | GSM_MemoryStatusMemStatus; |
4646 | GSM_ToDoEntry ToDo; | 4646 | GSM_ToDoEntry ToDo; |
4647 | GSM_ToDoStatus ToDoStatus; | 4647 | GSM_ToDoStatus ToDoStatus; |
4648 | GSM_Profile Profile; | 4648 | GSM_Profile Profile; |
4649 | GSM_MultiWAPSettingsSettings; | 4649 | GSM_MultiWAPSettingsSettings; |
4650 | GSM_GPRSAccessPointGPRSPoint; | 4650 | GSM_GPRSAccessPointGPRSPoint; |
4651 | GSM_WAPBookmark Bookmark; | 4651 | GSM_WAPBookmark Bookmark; |
4652 | int i, used, max = 0; | 4652 | int i, used, max = 0; |
4653 | bool Past = true; | 4653 | bool Past = true; |
4654 | bool Found, DoRestore; | 4654 | bool Found, DoRestore; |
4655 | 4655 | ||
4656 | error=GSM_ReadBackupFile(argv[2],&Backup); | 4656 | error=GSM_ReadBackupFile(argv[2],&Backup); |
4657 | if (error!=ERR_NOTIMPLEMENTED) { | 4657 | if (error!=ERR_NOTIMPLEMENTED) { |
4658 | Print_Error(error); | 4658 | Print_Error(error); |
4659 | } else { | 4659 | } else { |
4660 | printmsgerr("WARNING: Some data not read from file. It can be damaged or restoring some settings from this file format not implemented (maybe higher Gammu required ?)\n"); | 4660 | printmsgerr("WARNING: Some data not read from file. It can be damaged or restoring some settings from this file format not implemented (maybe higher Gammu required ?)\n"); |
4661 | } | 4661 | } |
4662 | 4662 | ||
4663 | signal(SIGINT, interrupt); | 4663 | signal(SIGINT, interrupt); |
4664 | printmsgerr("Press Ctrl+C to break...\n"); | 4664 | printmsgerr("Press Ctrl+C to break...\n"); |
4665 | 4665 | ||
4666 | if (Backup.DateTimeAvailable) printmsgerr("Time of backup : %s\n",OSDateTime(Backup.DateTime,false)); | 4666 | if (Backup.DateTimeAvailable) printmsgerr("Time of backup : %s\n",OSDateTime(Backup.DateTime,false)); |
4667 | if (Backup.Model[0]!=0) printmsgerr("Phone : %s\n",Backup.Model); | 4667 | if (Backup.Model[0]!=0) printmsgerr("Phone : %s\n",Backup.Model); |
4668 | if (Backup.IMEI[0]!=0) printmsgerr("IMEI : %s\n",Backup.IMEI); | 4668 | if (Backup.IMEI[0]!=0) printmsgerr("IMEI : %s\n",Backup.IMEI); |
4669 | if (Backup.Creator[0]!=0) printmsgerr("File created by : %s\n",Backup.Creator); | 4669 | if (Backup.Creator[0]!=0) printmsgerr("File created by : %s\n",Backup.Creator); |
4670 | 4670 | ||
4671 | if (Backup.MD5Calculated[0]!=0) { | 4671 | if (Backup.MD5Calculated[0]!=0) { |
4672 | dbgprintf("\"%s\"\n",Backup.MD5Original); | 4672 | dbgprintf("\"%s\"\n",Backup.MD5Original); |
4673 | dbgprintf("\"%s\"\n",Backup.MD5Calculated); | 4673 | dbgprintf("\"%s\"\n",Backup.MD5Calculated); |
4674 | if (strcmp(Backup.MD5Original,Backup.MD5Calculated)) { | 4674 | if (strcmp(Backup.MD5Original,Backup.MD5Calculated)) { |
4675 | if (!answer_yes("Checksum in backup file do not match. Continue")) return; | 4675 | if (!answer_yes("Checksum in backup file do not match. Continue")) return; |
4676 | } | 4676 | } |
4677 | } | 4677 | } |
4678 | 4678 | ||
4679 | GSM_Init(true); | 4679 | GSM_Init(true); |
4680 | 4680 | ||
4681 | DoRestore = false; | 4681 | DoRestore = false; |
4682 | if (Backup.PhonePhonebook[0] != NULL) { | 4682 | if (Backup.PhonePhonebook[0] != NULL) { |
4683 | MemStatus.MemoryType = MEM_ME; | 4683 | MemStatus.MemoryType = MEM_ME; |
4684 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 4684 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
4685 | if (error==ERR_NONE) { | 4685 | if (error==ERR_NONE) { |
4686 | max = 0; | 4686 | max = 0; |
4687 | while (Backup.PhonePhonebook[max]!=NULL) max++; | 4687 | while (Backup.PhonePhonebook[max]!=NULL) max++; |
4688 | printmsgerr("%i entries in backup file\n",max); | 4688 | printmsgerr("%i entries in backup file\n",max); |
4689 | if (answer_yes("Restore phone phonebook")) DoRestore = true; | 4689 | if (answer_yes("Restore phone phonebook")) DoRestore = true; |
4690 | } | 4690 | } |
4691 | } | 4691 | } |
4692 | if (DoRestore) { | 4692 | if (DoRestore) { |
4693 | used = 0; | 4693 | used = 0; |
4694 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { | 4694 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { |
4695 | Pbk.MemoryType = MEM_ME; | 4695 | Pbk.MemoryType = MEM_ME; |
4696 | Pbk.Location= i + 1; | 4696 | Pbk.Location= i + 1; |
4697 | Pbk.EntriesNum= 0; | 4697 | Pbk.EntriesNum= 0; |
4698 | if (used<max) { | 4698 | if (used<max) { |
4699 | if (Backup.PhonePhonebook[used]->Location == Pbk.Location) { | 4699 | if (Backup.PhonePhonebook[used]->Location == Pbk.Location) { |
4700 | Pbk = *Backup.PhonePhonebook[used]; | 4700 | Pbk = *Backup.PhonePhonebook[used]; |
4701 | used++; | 4701 | used++; |
4702 | dbgprintf("Location %i\n",Pbk.Location); | 4702 | dbgprintf("Location %i\n",Pbk.Location); |
4703 | if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk); | 4703 | if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk); |
4704 | } | 4704 | } |
4705 | } | 4705 | } |
4706 | if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk); | 4706 | if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk); |
4707 | Print_Error(error); | 4707 | Print_Error(error); |
4708 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); | 4708 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); |
4709 | if (gshutdown) { | 4709 | if (gshutdown) { |
4710 | GSM_Terminate(); | 4710 | GSM_Terminate(); |
4711 | exit(0); | 4711 | exit(0); |
4712 | } | 4712 | } |
4713 | } | 4713 | } |
4714 | printmsgerr("\n"); | 4714 | printmsgerr("\n"); |
4715 | } | 4715 | } |
4716 | 4716 | ||
4717 | DoRestore = false; | 4717 | DoRestore = false; |
4718 | if (Backup.SIMPhonebook[0] != NULL) { | 4718 | if (Backup.SIMPhonebook[0] != NULL) { |
4719 | MemStatus.MemoryType = MEM_SM; | 4719 | MemStatus.MemoryType = MEM_SM; |
4720 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 4720 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
4721 | if (error==ERR_NONE) { | 4721 | if (error==ERR_NONE) { |
4722 | max = 0; | 4722 | max = 0; |
4723 | while (Backup.SIMPhonebook[max]!=NULL) max++; | 4723 | while (Backup.SIMPhonebook[max]!=NULL) max++; |
4724 | printmsgerr("%i entries in backup file\n",max); | 4724 | printmsgerr("%i entries in backup file\n",max); |
4725 | if (answer_yes("Restore SIM phonebook")) DoRestore = true; | 4725 | if (answer_yes("Restore SIM phonebook")) DoRestore = true; |
4726 | } | 4726 | } |
4727 | } | 4727 | } |
4728 | if (DoRestore) { | 4728 | if (DoRestore) { |
4729 | used = 0; | 4729 | used = 0; |
4730 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { | 4730 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { |
4731 | Pbk.MemoryType = MEM_SM; | 4731 | Pbk.MemoryType = MEM_SM; |
4732 | Pbk.Location= i + 1; | 4732 | Pbk.Location= i + 1; |
4733 | Pbk.EntriesNum= 0; | 4733 | Pbk.EntriesNum= 0; |
4734 | if (used<max) { | 4734 | if (used<max) { |
4735 | if (Backup.SIMPhonebook[used]->Location == Pbk.Location) { | 4735 | if (Backup.SIMPhonebook[used]->Location == Pbk.Location) { |
4736 | Pbk = *Backup.SIMPhonebook[used]; | 4736 | Pbk = *Backup.SIMPhonebook[used]; |
4737 | used++; | 4737 | used++; |
4738 | dbgprintf("Location %i\n",Pbk.Location); | 4738 | dbgprintf("Location %i\n",Pbk.Location); |
4739 | if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk); | 4739 | if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk); |
4740 | } | 4740 | } |
4741 | } | 4741 | } |
4742 | if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk); | 4742 | if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk); |
4743 | Print_Error(error); | 4743 | Print_Error(error); |
4744 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); | 4744 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); |
4745 | if (gshutdown) { | 4745 | if (gshutdown) { |
4746 | GSM_Terminate(); | 4746 | GSM_Terminate(); |
4747 | exit(0); | 4747 | exit(0); |
4748 | } | 4748 | } |
4749 | } | 4749 | } |
4750 | printmsgerr("\n"); | 4750 | printmsgerr("\n"); |
4751 | } | 4751 | } |
4752 | 4752 | ||
4753 | DoRestore = false; | 4753 | DoRestore = false; |
4754 | if (Backup.CallerLogos[0] != NULL) { | 4754 | if (Backup.CallerLogos[0] != NULL) { |
4755 | Bitmap.Type = GSM_CallerGroupLogo; | 4755 | Bitmap.Type = GSM_CallerGroupLogo; |
4756 | Bitmap.Location = 1; | 4756 | Bitmap.Location = 1; |
4757 | error=Phone->GetBitmap(&s,&Bitmap); | 4757 | error=Phone->GetBitmap(&s,&Bitmap); |
4758 | if (error == ERR_NONE) { | 4758 | if (error == ERR_NONE) { |
4759 | if (answer_yes("Restore caller groups and logos")) DoRestore = true; | 4759 | if (answer_yes("Restore caller groups and logos")) DoRestore = true; |
4760 | } | 4760 | } |
4761 | } | 4761 | } |
4762 | if (DoRestore) { | 4762 | if (DoRestore) { |
4763 | max = 0; | 4763 | max = 0; |
4764 | while (Backup.CallerLogos[max]!=NULL) max++; | 4764 | while (Backup.CallerLogos[max]!=NULL) max++; |
4765 | for (i=0;i<max;i++) { | 4765 | for (i=0;i<max;i++) { |
4766 | error=Phone->SetBitmap(&s,Backup.CallerLogos[i]); | 4766 | error=Phone->SetBitmap(&s,Backup.CallerLogos[i]); |
4767 | Print_Error(error); | 4767 | Print_Error(error); |
4768 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4768 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4769 | if (gshutdown) { | 4769 | if (gshutdown) { |
4770 | GSM_Terminate(); | 4770 | GSM_Terminate(); |
4771 | exit(0); | 4771 | exit(0); |
4772 | } | 4772 | } |
4773 | } | 4773 | } |
4774 | printmsgerr("\n"); | 4774 | printmsgerr("\n"); |
4775 | } | 4775 | } |
4776 | 4776 | ||
4777 | if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { | 4777 | if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { |
4778 | if ( true /*LRanswer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/) { | 4778 | if ( true /*LRanswer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/) { |
4779 | GSM_GetCurrentDateTime(&date_time); | 4779 | GSM_GetCurrentDateTime(&date_time); |
4780 | 4780 | ||
4781 | error=Phone->SetDateTime(&s, &date_time); | 4781 | error=Phone->SetDateTime(&s, &date_time); |
4782 | Print_Error(error); | 4782 | Print_Error(error); |
4783 | } | 4783 | } |
4784 | } | 4784 | } |
4785 | DoRestore = false; | 4785 | DoRestore = false; |
4786 | if (Backup.Calendar[0] != NULL) { | 4786 | if (Backup.Calendar[0] != NULL) { |
4787 | /* N6110 doesn't support getting calendar status */ | 4787 | /* N6110 doesn't support getting calendar status */ |
4788 | error = Phone->GetNextCalendar(&s,&Calendar,true); | 4788 | error = Phone->GetNextCalendar(&s,&Calendar,true); |
4789 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { | 4789 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { |
4790 | max = 0; | 4790 | max = 0; |
4791 | while (Backup.Calendar[max] != NULL) max++; | 4791 | while (Backup.Calendar[max] != NULL) max++; |
4792 | printmsgerr("%i entries in backup file\n",max); | 4792 | printmsgerr("%i entries in backup file\n",max); |
4793 | // LR | 4793 | // LR |
4794 | //if (answer_yes("Restore calendar notes")) { | 4794 | //if (answer_yes("Restore calendar notes")) { |
4795 | //Past = answer_yes("Restore notes from the past"); | 4795 | //Past = answer_yes("Restore notes from the past"); |
4796 | DoRestore = true; | 4796 | DoRestore = true; |
4797 | //} | 4797 | //} |
4798 | } | 4798 | } |
4799 | } | 4799 | } |
4800 | if (DoRestore) { | 4800 | if (DoRestore) { |
4801 | printmsgerr("Deleting old notes: "); | 4801 | printmsgerr("Deleting old notes: "); |
4802 | error = Phone->DeleteAllCalendar(&s); | 4802 | error = Phone->DeleteAllCalendar(&s); |
4803 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { | 4803 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { |
4804 | while (1) { | 4804 | while (1) { |
4805 | error = Phone->GetNextCalendar(&s,&Calendar,true); | 4805 | error = Phone->GetNextCalendar(&s,&Calendar,true); |
4806 | if (error != ERR_NONE) break; | 4806 | if (error != ERR_NONE) break; |
4807 | error = Phone->DeleteCalendar(&s,&Calendar); | 4807 | error = Phone->DeleteCalendar(&s,&Calendar); |
4808 | Print_Error(error); | 4808 | Print_Error(error); |
4809 | printmsgerr("*"); | 4809 | printmsgerr("*"); |
4810 | } | 4810 | } |
4811 | printmsgerr("\n"); | 4811 | printmsgerr("\n"); |
4812 | } else { | 4812 | } else { |
4813 | printmsgerr("Done\n"); | 4813 | printmsgerr("Done\n"); |
4814 | Print_Error(error); | 4814 | Print_Error(error); |
4815 | } | 4815 | } |
4816 | 4816 | ||
4817 | for (i=0;i<max;i++) { | 4817 | for (i=0;i<max;i++) { |
4818 | if (!Past && IsCalendarNoteFromThePast(Backup.Calendar[i])) continue; | 4818 | if (!Past && IsCalendarNoteFromThePast(Backup.Calendar[i])) continue; |
4819 | 4819 | ||
4820 | Calendar = *Backup.Calendar[i]; | 4820 | Calendar = *Backup.Calendar[i]; |
4821 | error=Phone->AddCalendar(&s,&Calendar); | 4821 | error=Phone->AddCalendar(&s,&Calendar); |
4822 | Print_Error(error); | 4822 | Print_Error(error); |
4823 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4823 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4824 | if (gshutdown) { | 4824 | if (gshutdown) { |
4825 | GSM_Terminate(); | 4825 | GSM_Terminate(); |
4826 | exit(0); | 4826 | exit(0); |
4827 | } | 4827 | } |
4828 | } | 4828 | } |
4829 | printmsgerr("\n"); | 4829 | printmsgerr("\n"); |
4830 | } | 4830 | } |
4831 | 4831 | ||
4832 | DoRestore = false; | 4832 | DoRestore = false; |
4833 | if (Backup.ToDo[0] != NULL) { | 4833 | if (Backup.ToDo[0] != NULL) { |
4834 | error = Phone->GetToDoStatus(&s,&ToDoStatus); | 4834 | error = Phone->GetToDoStatus(&s,&ToDoStatus); |
4835 | if (error == ERR_NONE) { | 4835 | if (error == ERR_NONE) { |
4836 | max = 0; | 4836 | max = 0; |
4837 | while (Backup.ToDo[max]!=NULL) max++; | 4837 | while (Backup.ToDo[max]!=NULL) max++; |
4838 | printmsgerr("%i entries in backup file\n",max); | 4838 | printmsgerr("%i entries in backup file\n",max); |
4839 | 4839 | ||
4840 | //LR if (answer_yes("Restore ToDo")) | 4840 | //LR if (answer_yes("Restore ToDo")) |
4841 | DoRestore = true; | 4841 | DoRestore = true; |
4842 | } | 4842 | } |
4843 | } | 4843 | } |
4844 | if (DoRestore) { | 4844 | if (DoRestore) { |
4845 | ToDo = *Backup.ToDo[0]; | 4845 | ToDo = *Backup.ToDo[0]; |
4846 | error = Phone->SetToDo(&s,&ToDo); | 4846 | error = Phone->SetToDo(&s,&ToDo); |
4847 | } | 4847 | } |
4848 | if (DoRestore && (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED)) { | 4848 | if (DoRestore && (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED)) { |
4849 | printmsgerr("Deleting old ToDo: "); | 4849 | printmsgerr("Deleting old ToDo: "); |
4850 | error=Phone->DeleteAllToDo(&s); | 4850 | error=Phone->DeleteAllToDo(&s); |
4851 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { | 4851 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { |
4852 | while (1) { | 4852 | while (1) { |
4853 | error = Phone->GetNextToDo(&s,&ToDo,true); | 4853 | error = Phone->GetNextToDo(&s,&ToDo,true); |
4854 | if (error != ERR_NONE) break; | 4854 | if (error != ERR_NONE) break; |
4855 | error = Phone->DeleteToDo(&s,&ToDo); | 4855 | error = Phone->DeleteToDo(&s,&ToDo); |
4856 | Print_Error(error); | 4856 | Print_Error(error); |
4857 | printmsgerr("*"); | 4857 | printmsgerr("*"); |
4858 | } | 4858 | } |
4859 | printmsgerr("\n"); | 4859 | printmsgerr("\n"); |
4860 | } else { | 4860 | } else { |
4861 | printmsgerr("Done\n"); | 4861 | printmsgerr("Done\n"); |
4862 | Print_Error(error); | 4862 | Print_Error(error); |
4863 | } | 4863 | } |
4864 | 4864 | ||
4865 | for (i=0;i<max;i++) { | 4865 | for (i=0;i<max;i++) { |
4866 | ToDo = *Backup.ToDo[i]; | 4866 | ToDo = *Backup.ToDo[i]; |
4867 | ToDo.Location = 0; | 4867 | ToDo.Location = 0; |
4868 | error=Phone->AddToDo(&s,&ToDo); | 4868 | error=Phone->AddToDo(&s,&ToDo); |
4869 | Print_Error(error); | 4869 | Print_Error(error); |
4870 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4870 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4871 | if (gshutdown) { | 4871 | if (gshutdown) { |
4872 | GSM_Terminate(); | 4872 | GSM_Terminate(); |
4873 | exit(0); | 4873 | exit(0); |
4874 | } | 4874 | } |
4875 | } | 4875 | } |
4876 | printmsgerr("\n"); | 4876 | printmsgerr("\n"); |
4877 | } else if (DoRestore) { | 4877 | } else if (DoRestore) { |
4878 | /* At first delete entries, that were deleted */ | 4878 | /* At first delete entries, that were deleted */ |
4879 | used = 0; | 4879 | used = 0; |
4880 | error = Phone->GetNextToDo(&s,&ToDo,true); | 4880 | error = Phone->GetNextToDo(&s,&ToDo,true); |
4881 | while (error == ERR_NONE) { | 4881 | while (error == ERR_NONE) { |
4882 | used++; | 4882 | used++; |
4883 | Found = false; | 4883 | Found = false; |
4884 | for (i=0;i<max;i++) { | 4884 | for (i=0;i<max;i++) { |
4885 | if (Backup.ToDo[i]->Location == ToDo.Location) { | 4885 | if (Backup.ToDo[i]->Location == ToDo.Location) { |
4886 | Found = true; | 4886 | Found = true; |
4887 | break; | 4887 | break; |
4888 | } | 4888 | } |
4889 | } | 4889 | } |
4890 | if (!Found) { | 4890 | if (!Found) { |
4891 | error=Phone->DeleteToDo(&s,&ToDo); | 4891 | error=Phone->DeleteToDo(&s,&ToDo); |
4892 | Print_Error(error); | 4892 | Print_Error(error); |
4893 | } | 4893 | } |
4894 | error = Phone->GetNextToDo(&s,&ToDo,false); | 4894 | error = Phone->GetNextToDo(&s,&ToDo,false); |
4895 | printmsgerr("%cCleaning: %i percent",13,used*100/ToDoStatus.Used); | 4895 | printmsgerr("%cCleaning: %i percent",13,used*100/ToDoStatus.Used); |
4896 | if (gshutdown) { | 4896 | if (gshutdown) { |
4897 | GSM_Terminate(); | 4897 | GSM_Terminate(); |
4898 | exit(0); | 4898 | exit(0); |
4899 | } | 4899 | } |
4900 | } | 4900 | } |
4901 | printmsgerr("\n"); | 4901 | printmsgerr("\n"); |
4902 | 4902 | ||
4903 | /* Now write modified/new entries */ | 4903 | /* Now write modified/new entries */ |
4904 | for (i=0;i<max;i++) { | 4904 | for (i=0;i<max;i++) { |
4905 | ToDo = *Backup.ToDo[i]; | 4905 | ToDo = *Backup.ToDo[i]; |
4906 | error = Phone->SetToDo(&s,&ToDo); | 4906 | error = Phone->SetToDo(&s,&ToDo); |
4907 | Print_Error(error); | 4907 | Print_Error(error); |
4908 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4908 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4909 | if (gshutdown) { | 4909 | if (gshutdown) { |
4910 | GSM_Terminate(); | 4910 | GSM_Terminate(); |
4911 | exit(0); | 4911 | exit(0); |
4912 | } | 4912 | } |
4913 | } | 4913 | } |
4914 | printmsgerr("\n"); | 4914 | printmsgerr("\n"); |
4915 | } | 4915 | } |
4916 | 4916 | ||
4917 | if (Backup.SMSC[0] != NULL && answer_yes("Restore SMSC profiles")) { | 4917 | if (Backup.SMSC[0] != NULL && answer_yes("Restore SMSC profiles")) { |
4918 | max = 0; | 4918 | max = 0; |
4919 | while (Backup.SMSC[max]!=NULL) max++; | 4919 | while (Backup.SMSC[max]!=NULL) max++; |
4920 | for (i=0;i<max;i++) { | 4920 | for (i=0;i<max;i++) { |
4921 | error=Phone->SetSMSC(&s,Backup.SMSC[i]); | 4921 | error=Phone->SetSMSC(&s,Backup.SMSC[i]); |
4922 | Print_Error(error); | 4922 | Print_Error(error); |
4923 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4923 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4924 | if (gshutdown) { | 4924 | if (gshutdown) { |
4925 | GSM_Terminate(); | 4925 | GSM_Terminate(); |
4926 | exit(0); | 4926 | exit(0); |
4927 | } | 4927 | } |
4928 | } | 4928 | } |
4929 | printmsgerr("\n"); | 4929 | printmsgerr("\n"); |
4930 | } | 4930 | } |
4931 | if (Backup.StartupLogo != NULL && answer_yes("Restore startup logo/text")) { | 4931 | if (Backup.StartupLogo != NULL && answer_yes("Restore startup logo/text")) { |
4932 | error=Phone->SetBitmap(&s,Backup.StartupLogo); | 4932 | error=Phone->SetBitmap(&s,Backup.StartupLogo); |
4933 | Print_Error(error); | 4933 | Print_Error(error); |
4934 | } | 4934 | } |
4935 | if (Backup.OperatorLogo != NULL && answer_yes("Restore operator logo")) { | 4935 | if (Backup.OperatorLogo != NULL && answer_yes("Restore operator logo")) { |
4936 | error=Phone->SetBitmap(&s,Backup.OperatorLogo); | 4936 | error=Phone->SetBitmap(&s,Backup.OperatorLogo); |
4937 | Print_Error(error); | 4937 | Print_Error(error); |
4938 | } | 4938 | } |
4939 | DoRestore = false; | 4939 | DoRestore = false; |
4940 | if (Backup.WAPBookmark[0] != NULL) { | 4940 | if (Backup.WAPBookmark[0] != NULL) { |
4941 | Bookmark.Location = 1; | 4941 | Bookmark.Location = 1; |
4942 | error = Phone->GetWAPBookmark(&s,&Bookmark); | 4942 | error = Phone->GetWAPBookmark(&s,&Bookmark); |
4943 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION) { | 4943 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION) { |
4944 | if (answer_yes("Restore WAP bookmarks")) DoRestore = true; | 4944 | if (answer_yes("Restore WAP bookmarks")) DoRestore = true; |
4945 | } | 4945 | } |
4946 | } | 4946 | } |
4947 | if (DoRestore) { | 4947 | if (DoRestore) { |
4948 | printmsgerr("Deleting old bookmarks: "); | 4948 | printmsgerr("Deleting old bookmarks: "); |
4949 | /* One thing to explain: DCT4 phones seems to have bug here. | 4949 | /* One thing to explain: DCT4 phones seems to have bug here. |
4950 | * When delete for example first bookmark, phone change | 4950 | * When delete for example first bookmark, phone change |
4951 | * numeration for getting frame, not for deleting. So, we try to | 4951 | * numeration for getting frame, not for deleting. So, we try to |
4952 | * get 1'st bookmark. Inside frame is "correct" location. We use | 4952 | * get 1'st bookmark. Inside frame is "correct" location. We use |
4953 | * it later | 4953 | * it later |
4954 | */ | 4954 | */ |
4955 | while (error==ERR_NONE) { | 4955 | while (error==ERR_NONE) { |
4956 | error = Phone->DeleteWAPBookmark(&s,&Bookmark); | 4956 | error = Phone->DeleteWAPBookmark(&s,&Bookmark); |
4957 | Bookmark.Location = 1; | 4957 | Bookmark.Location = 1; |
4958 | error = Phone->GetWAPBookmark(&s,&Bookmark); | 4958 | error = Phone->GetWAPBookmark(&s,&Bookmark); |
4959 | printmsgerr("*"); | 4959 | printmsgerr("*"); |
4960 | } | 4960 | } |
4961 | printmsgerr("\n"); | 4961 | printmsgerr("\n"); |
4962 | max = 0; | 4962 | max = 0; |
4963 | while (Backup.WAPBookmark[max]!=NULL) max++; | 4963 | while (Backup.WAPBookmark[max]!=NULL) max++; |
4964 | for (i=0;i<max;i++) { | 4964 | for (i=0;i<max;i++) { |
4965 | Bookmark = *Backup.WAPBookmark[i]; | 4965 | Bookmark = *Backup.WAPBookmark[i]; |
4966 | Bookmark.Location = 0; | 4966 | Bookmark.Location = 0; |
4967 | error=Phone->SetWAPBookmark(&s,&Bookmark); | 4967 | error=Phone->SetWAPBookmark(&s,&Bookmark); |
4968 | Print_Error(error); | 4968 | Print_Error(error); |
4969 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4969 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4970 | if (gshutdown) { | 4970 | if (gshutdown) { |
4971 | GSM_Terminate(); | 4971 | GSM_Terminate(); |
4972 | exit(0); | 4972 | exit(0); |
4973 | } | 4973 | } |
4974 | } | 4974 | } |
4975 | printmsgerr("\n"); | 4975 | printmsgerr("\n"); |
4976 | } | 4976 | } |
4977 | DoRestore = false; | 4977 | DoRestore = false; |
4978 | if (Backup.WAPSettings[0] != NULL) { | 4978 | if (Backup.WAPSettings[0] != NULL) { |
4979 | Settings.Location = 1; | 4979 | Settings.Location = 1; |
4980 | error = Phone->GetWAPSettings(&s,&Settings); | 4980 | error = Phone->GetWAPSettings(&s,&Settings); |
4981 | if (error == ERR_NONE) { | 4981 | if (error == ERR_NONE) { |
4982 | if (answer_yes("Restore WAP settings")) DoRestore = true; | 4982 | if (answer_yes("Restore WAP settings")) DoRestore = true; |
4983 | } | 4983 | } |
4984 | } | 4984 | } |
4985 | if (DoRestore) { | 4985 | if (DoRestore) { |
4986 | max = 0; | 4986 | max = 0; |
4987 | while (Backup.WAPSettings[max]!=NULL) max++; | 4987 | while (Backup.WAPSettings[max]!=NULL) max++; |
4988 | for (i=0;i<max;i++) { | 4988 | for (i=0;i<max;i++) { |
4989 | error=Phone->SetWAPSettings(&s,Backup.WAPSettings[i]); | 4989 | error=Phone->SetWAPSettings(&s,Backup.WAPSettings[i]); |
4990 | Print_Error(error); | 4990 | Print_Error(error); |
4991 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 4991 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
4992 | if (gshutdown) { | 4992 | if (gshutdown) { |
4993 | GSM_Terminate(); | 4993 | GSM_Terminate(); |
4994 | exit(0); | 4994 | exit(0); |
4995 | } | 4995 | } |
4996 | } | 4996 | } |
4997 | printmsgerr("\n"); | 4997 | printmsgerr("\n"); |
4998 | } | 4998 | } |
4999 | DoRestore = false; | 4999 | DoRestore = false; |
5000 | if (Backup.MMSSettings[0] != NULL) { | 5000 | if (Backup.MMSSettings[0] != NULL) { |
5001 | Settings.Location = 1; | 5001 | Settings.Location = 1; |
5002 | error = Phone->GetMMSSettings(&s,&Settings); | 5002 | error = Phone->GetMMSSettings(&s,&Settings); |
5003 | if (error == ERR_NONE) { | 5003 | if (error == ERR_NONE) { |
5004 | if (answer_yes("Restore MMS settings")) DoRestore = true; | 5004 | if (answer_yes("Restore MMS settings")) DoRestore = true; |
5005 | } | 5005 | } |
5006 | } | 5006 | } |
5007 | if (DoRestore) { | 5007 | if (DoRestore) { |
5008 | max = 0; | 5008 | max = 0; |
5009 | while (Backup.MMSSettings[max]!=NULL) max++; | 5009 | while (Backup.MMSSettings[max]!=NULL) max++; |
5010 | for (i=0;i<max;i++) { | 5010 | for (i=0;i<max;i++) { |
5011 | error=Phone->SetMMSSettings(&s,Backup.MMSSettings[i]); | 5011 | error=Phone->SetMMSSettings(&s,Backup.MMSSettings[i]); |
5012 | Print_Error(error); | 5012 | Print_Error(error); |
5013 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5013 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5014 | if (gshutdown) { | 5014 | if (gshutdown) { |
5015 | GSM_Terminate(); | 5015 | GSM_Terminate(); |
5016 | exit(0); | 5016 | exit(0); |
5017 | } | 5017 | } |
5018 | } | 5018 | } |
5019 | printmsgerr("\n"); | 5019 | printmsgerr("\n"); |
5020 | } | 5020 | } |
5021 | DoRestore = false; | 5021 | DoRestore = false; |
5022 | if (Backup.Ringtone[0] != NULL) { | 5022 | if (Backup.Ringtone[0] != NULL) { |
5023 | Ringtone.Location = 1; | 5023 | Ringtone.Location = 1; |
5024 | Ringtone.Format = 0; | 5024 | Ringtone.Format = 0; |
5025 | error = Phone->GetRingtone(&s,&Ringtone,false); | 5025 | error = Phone->GetRingtone(&s,&Ringtone,false); |
5026 | if (error == ERR_NONE || error ==ERR_EMPTY) { | 5026 | if (error == ERR_NONE || error ==ERR_EMPTY) { |
5027 | if (Phone->DeleteUserRingtones != NOTSUPPORTED) { | 5027 | if (Phone->DeleteUserRingtones != NOTSUPPORTED) { |
5028 | if (answer_yes("Delete all user ringtones")) DoRestore = true; | 5028 | if (answer_yes("Delete all user ringtones")) DoRestore = true; |
5029 | } | 5029 | } |
5030 | } | 5030 | } |
5031 | } | 5031 | } |
5032 | if (DoRestore) { | 5032 | if (DoRestore) { |
5033 | printmsgerr("Deleting: "); | 5033 | printmsgerr("Deleting: "); |
5034 | error=Phone->DeleteUserRingtones(&s); | 5034 | error=Phone->DeleteUserRingtones(&s); |
5035 | Print_Error(error); | 5035 | Print_Error(error); |
5036 | printmsgerr("Done\n"); | 5036 | printmsgerr("Done\n"); |
5037 | DoRestore = false; | 5037 | DoRestore = false; |
5038 | if (answer_yes("Restore user ringtones")) DoRestore = true; | 5038 | if (answer_yes("Restore user ringtones")) DoRestore = true; |
5039 | } | 5039 | } |
5040 | if (DoRestore) { | 5040 | if (DoRestore) { |
5041 | max = 0; | 5041 | max = 0; |
5042 | while (Backup.Ringtone[max]!=NULL) max++; | 5042 | while (Backup.Ringtone[max]!=NULL) max++; |
5043 | for (i=0;i<max;i++) { | 5043 | for (i=0;i<max;i++) { |
5044 | error=GSM_RingtoneConvert(&Ringtone, Backup.Ringtone[i], Ringtone.Format); | 5044 | error=GSM_RingtoneConvert(&Ringtone, Backup.Ringtone[i], Ringtone.Format); |
5045 | Print_Error(error); | 5045 | Print_Error(error); |
5046 | error=Phone->SetRingtone(&s,&Ringtone,&i); | 5046 | error=Phone->SetRingtone(&s,&Ringtone,&i); |
5047 | Print_Error(error); | 5047 | Print_Error(error); |
5048 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5048 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5049 | if (gshutdown) { | 5049 | if (gshutdown) { |
5050 | GSM_Terminate(); | 5050 | GSM_Terminate(); |
5051 | exit(0); | 5051 | exit(0); |
5052 | } | 5052 | } |
5053 | } | 5053 | } |
5054 | printmsgerr("\n"); | 5054 | printmsgerr("\n"); |
5055 | } | 5055 | } |
5056 | DoRestore = false; | 5056 | DoRestore = false; |
5057 | if (Backup.Profiles[0] != NULL) { | 5057 | if (Backup.Profiles[0] != NULL) { |
5058 | Profile.Location = 1; | 5058 | Profile.Location = 1; |
5059 | error = Phone->GetProfile(&s,&Profile); | 5059 | error = Phone->GetProfile(&s,&Profile); |
5060 | if (error == ERR_NONE) { | 5060 | if (error == ERR_NONE) { |
5061 | if (answer_yes("Restore profiles")) DoRestore = true; | 5061 | if (answer_yes("Restore profiles")) DoRestore = true; |
5062 | } | 5062 | } |
5063 | } | 5063 | } |
5064 | if (DoRestore) { | 5064 | if (DoRestore) { |
5065 | Profile.Location= 0; | 5065 | Profile.Location= 0; |
5066 | max = 0; | 5066 | max = 0; |
5067 | while (Backup.Profiles[max]!=NULL) max++; | 5067 | while (Backup.Profiles[max]!=NULL) max++; |
5068 | for (i=0;i<max;i++) { | 5068 | for (i=0;i<max;i++) { |
5069 | Profile= *Backup.Profiles[i]; | 5069 | Profile= *Backup.Profiles[i]; |
5070 | error=Phone->SetProfile(&s,&Profile); | 5070 | error=Phone->SetProfile(&s,&Profile); |
5071 | Print_Error(error); | 5071 | Print_Error(error); |
5072 | if (gshutdown) { | 5072 | if (gshutdown) { |
5073 | GSM_Terminate(); | 5073 | GSM_Terminate(); |
5074 | exit(0); | 5074 | exit(0); |
5075 | } | 5075 | } |
5076 | } | 5076 | } |
5077 | printmsgerr("\n"); | 5077 | printmsgerr("\n"); |
5078 | } | 5078 | } |
5079 | DoRestore = false; | 5079 | DoRestore = false; |
5080 | if (Backup.FMStation[0] != NULL) { | 5080 | if (Backup.FMStation[0] != NULL) { |
5081 | FMStation.Location = 1; | 5081 | FMStation.Location = 1; |
5082 | error = Phone->GetFMStation(&s,&FMStation); | 5082 | error = Phone->GetFMStation(&s,&FMStation); |
5083 | if (error == ERR_NONE || error == ERR_EMPTY) { | 5083 | if (error == ERR_NONE || error == ERR_EMPTY) { |
5084 | if (answer_yes("Restore FM stations")) DoRestore = true; | 5084 | if (answer_yes("Restore FM stations")) DoRestore = true; |
5085 | } | 5085 | } |
5086 | } | 5086 | } |
5087 | if (DoRestore) { | 5087 | if (DoRestore) { |
5088 | printmsgerr("Deleting old FM stations: "); | 5088 | printmsgerr("Deleting old FM stations: "); |
5089 | error=Phone->ClearFMStations(&s); | 5089 | error=Phone->ClearFMStations(&s); |
5090 | Print_Error(error); | 5090 | Print_Error(error); |
5091 | printmsgerr("Done\n"); | 5091 | printmsgerr("Done\n"); |
5092 | max = 0; | 5092 | max = 0; |
5093 | while (Backup.FMStation[max]!=NULL) max++; | 5093 | while (Backup.FMStation[max]!=NULL) max++; |
5094 | for (i=0;i<max;i++) { | 5094 | for (i=0;i<max;i++) { |
5095 | FMStation = *Backup.FMStation[i]; | 5095 | FMStation = *Backup.FMStation[i]; |
5096 | error=Phone->SetFMStation(&s,&FMStation); | 5096 | error=Phone->SetFMStation(&s,&FMStation); |
5097 | Print_Error(error); | 5097 | Print_Error(error); |
5098 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5098 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5099 | if (gshutdown) { | 5099 | if (gshutdown) { |
5100 | GSM_Terminate(); | 5100 | GSM_Terminate(); |
5101 | exit(0); | 5101 | exit(0); |
5102 | } | 5102 | } |
5103 | } | 5103 | } |
5104 | printmsgerr("\n"); | 5104 | printmsgerr("\n"); |
5105 | } | 5105 | } |
5106 | DoRestore = false; | 5106 | DoRestore = false; |
5107 | if (Backup.GPRSPoint[0] != NULL) { | 5107 | if (Backup.GPRSPoint[0] != NULL) { |
5108 | GPRSPoint.Location = 1; | 5108 | GPRSPoint.Location = 1; |
5109 | error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint); | 5109 | error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint); |
5110 | if (error == ERR_NONE || error == ERR_EMPTY) { | 5110 | if (error == ERR_NONE || error == ERR_EMPTY) { |
5111 | if (answer_yes("Restore GPRS Points")) DoRestore = true; | 5111 | if (answer_yes("Restore GPRS Points")) DoRestore = true; |
5112 | } | 5112 | } |
5113 | } | 5113 | } |
5114 | if (DoRestore) { | 5114 | if (DoRestore) { |
5115 | max = 0; | 5115 | max = 0; |
5116 | while (Backup.GPRSPoint[max]!=NULL) max++; | 5116 | while (Backup.GPRSPoint[max]!=NULL) max++; |
5117 | for (i=0;i<max;i++) { | 5117 | for (i=0;i<max;i++) { |
5118 | error=Phone->SetGPRSAccessPoint(&s,Backup.GPRSPoint[i]); | 5118 | error=Phone->SetGPRSAccessPoint(&s,Backup.GPRSPoint[i]); |
5119 | Print_Error(error); | 5119 | Print_Error(error); |
5120 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5120 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5121 | if (gshutdown) { | 5121 | if (gshutdown) { |
5122 | GSM_Terminate(); | 5122 | GSM_Terminate(); |
5123 | exit(0); | 5123 | exit(0); |
5124 | } | 5124 | } |
5125 | } | 5125 | } |
5126 | printmsgerr("\n"); | 5126 | printmsgerr("\n"); |
5127 | } | 5127 | } |
5128 | 5128 | ||
5129 | GSM_Terminate(); | 5129 | GSM_Terminate(); |
5130 | } | 5130 | } |
5131 | 5131 | ||
5132 | static void AddNew(int argc, char *argv[]) | 5132 | static void AddNew(int argc, char *argv[]) |
5133 | { | 5133 | { |
5134 | GSM_Backup Backup; | 5134 | GSM_Backup Backup; |
5135 | GSM_DateTime date_time; | 5135 | GSM_DateTime date_time; |
5136 | GSM_MemoryEntry Pbk; | 5136 | GSM_MemoryEntry Pbk; |
5137 | GSM_MemoryStatusMemStatus; | 5137 | GSM_MemoryStatusMemStatus; |
5138 | GSM_ToDoEntry ToDo; | 5138 | GSM_ToDoEntry ToDo; |
5139 | GSM_ToDoStatus ToDoStatus; | 5139 | GSM_ToDoStatus ToDoStatus; |
5140 | GSM_CalendarEntryCalendar; | 5140 | GSM_CalendarEntryCalendar; |
5141 | GSM_WAPBookmark Bookmark; | 5141 | GSM_WAPBookmark Bookmark; |
5142 | int i, max, j; | 5142 | int i, max, j; |
5143 | 5143 | ||
5144 | error=GSM_ReadBackupFile(argv[2],&Backup); | 5144 | error=GSM_ReadBackupFile(argv[2],&Backup); |
5145 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); | 5145 | if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); |
5146 | 5146 | ||
5147 | signal(SIGINT, interrupt); | 5147 | signal(SIGINT, interrupt); |
5148 | printmsgerr("Press Ctrl+C to break...\n"); | 5148 | printmsgerr("Press Ctrl+C to break...\n"); |
5149 | 5149 | ||
5150 | if (Backup.DateTimeAvailable) printmsgerr("Time of backup : %s\n",OSDateTime(Backup.DateTime,false)); | 5150 | if (Backup.DateTimeAvailable) printmsgerr("Time of backup : %s\n",OSDateTime(Backup.DateTime,false)); |
5151 | if (Backup.Model[0]!=0) printmsgerr("Phone : %s\n",Backup.Model); | 5151 | if (Backup.Model[0]!=0) printmsgerr("Phone : %s\n",Backup.Model); |
5152 | if (Backup.IMEI[0]!=0) printmsgerr("IMEI : %s\n",Backup.IMEI); | 5152 | if (Backup.IMEI[0]!=0) printmsgerr("IMEI : %s\n",Backup.IMEI); |
5153 | 5153 | ||
5154 | GSM_Init(true); | 5154 | GSM_Init(true); |
5155 | 5155 | ||
5156 | if (Backup.PhonePhonebook[0] != NULL) { | 5156 | if (Backup.PhonePhonebook[0] != NULL) { |
5157 | MemStatus.MemoryType = MEM_ME; | 5157 | MemStatus.MemoryType = MEM_ME; |
5158 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 5158 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
5159 | if (error==ERR_NONE) { | 5159 | if (error==ERR_NONE) { |
5160 | max = 0; | 5160 | max = 0; |
5161 | while (Backup.PhonePhonebook[max]!=NULL) max++; | 5161 | while (Backup.PhonePhonebook[max]!=NULL) max++; |
5162 | printmsgerr("%i entries in backup file\n",max); | 5162 | printmsgerr("%i entries in backup file\n",max); |
5163 | if (MemStatus.MemoryFree < max) { | 5163 | if (MemStatus.MemoryFree < max) { |
5164 | printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree); | 5164 | printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree); |
5165 | } else if (answer_yes("Add phone phonebook entries")) { | 5165 | } else if (answer_yes("Add phone phonebook entries")) { |
5166 | for (i=0;i<max;i++) { | 5166 | for (i=0;i<max;i++) { |
5167 | Pbk = *Backup.PhonePhonebook[i]; | 5167 | Pbk = *Backup.PhonePhonebook[i]; |
5168 | Pbk.MemoryType = MEM_ME; | 5168 | Pbk.MemoryType = MEM_ME; |
5169 | error=Phone->AddMemory(&s, &Pbk); | 5169 | error=Phone->AddMemory(&s, &Pbk); |
5170 | Print_Error(error); | 5170 | Print_Error(error); |
5171 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5171 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5172 | if (gshutdown) { | 5172 | if (gshutdown) { |
5173 | GSM_Terminate(); | 5173 | GSM_Terminate(); |
5174 | exit(0); | 5174 | exit(0); |
5175 | } | 5175 | } |
5176 | } | 5176 | } |
5177 | printmsgerr("\n"); | 5177 | printmsgerr("\n"); |
5178 | } | 5178 | } |
5179 | } | 5179 | } |
5180 | } | 5180 | } |
5181 | if (Backup.SIMPhonebook[0] != NULL) { | 5181 | if (Backup.SIMPhonebook[0] != NULL) { |
5182 | MemStatus.MemoryType = MEM_SM; | 5182 | MemStatus.MemoryType = MEM_SM; |
5183 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 5183 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
5184 | if (error==ERR_NONE) { | 5184 | if (error==ERR_NONE) { |
5185 | max = 0; | 5185 | max = 0; |
5186 | while (Backup.SIMPhonebook[max]!=NULL) max++; | 5186 | while (Backup.SIMPhonebook[max]!=NULL) max++; |
5187 | printmsgerr("%i entries in backup file\n",max); | 5187 | printmsgerr("%i entries in backup file\n",max); |
5188 | if (MemStatus.MemoryFree < max) { | 5188 | if (MemStatus.MemoryFree < max) { |
5189 | printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree); | 5189 | printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree); |
5190 | } else if (answer_yes("Add SIM phonebook entries")) { | 5190 | } else if (answer_yes("Add SIM phonebook entries")) { |
5191 | j = 1; | 5191 | j = 1; |
5192 | for (i=0;i<max;i++) { | 5192 | for (i=0;i<max;i++) { |
5193 | Pbk = *Backup.SIMPhonebook[i]; | 5193 | Pbk = *Backup.SIMPhonebook[i]; |
5194 | Pbk.MemoryType = MEM_SM; | 5194 | Pbk.MemoryType = MEM_SM; |
5195 | error=Phone->AddMemory(&s, &Pbk); | 5195 | error=Phone->AddMemory(&s, &Pbk); |
5196 | Print_Error(error); | 5196 | Print_Error(error); |
5197 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5197 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5198 | if (gshutdown) { | 5198 | if (gshutdown) { |
5199 | GSM_Terminate(); | 5199 | GSM_Terminate(); |
5200 | exit(0); | 5200 | exit(0); |
5201 | } | 5201 | } |
5202 | } | 5202 | } |
5203 | printmsgerr("\n"); | 5203 | printmsgerr("\n"); |
5204 | } | 5204 | } |
5205 | } | 5205 | } |
5206 | } | 5206 | } |
5207 | 5207 | ||
5208 | if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { | 5208 | if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { |
5209 | if (true /*LRanswer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/) { | 5209 | if (true /*LRanswer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/) { |
5210 | GSM_GetCurrentDateTime(&date_time); | 5210 | GSM_GetCurrentDateTime(&date_time); |
5211 | 5211 | ||
5212 | error=Phone->SetDateTime(&s, &date_time); | 5212 | error=Phone->SetDateTime(&s, &date_time); |
5213 | Print_Error(error); | 5213 | Print_Error(error); |
5214 | } | 5214 | } |
5215 | } | 5215 | } |
5216 | if (Backup.Calendar[0] != NULL) { | 5216 | if (Backup.Calendar[0] != NULL) { |
5217 | error = Phone->GetNextCalendar(&s,&Calendar,true); | 5217 | error = Phone->GetNextCalendar(&s,&Calendar,true); |
5218 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { | 5218 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { |
5219 | if (answer_yes("Add calendar notes")) { | 5219 | if (answer_yes("Add calendar notes")) { |
5220 | max = 0; | 5220 | max = 0; |
5221 | while (Backup.Calendar[max]!=NULL) max++; | 5221 | while (Backup.Calendar[max]!=NULL) max++; |
5222 | for (i=0;i<max;i++) { | 5222 | for (i=0;i<max;i++) { |
5223 | Calendar = *Backup.Calendar[i]; | 5223 | Calendar = *Backup.Calendar[i]; |
5224 | error=Phone->AddCalendar(&s,&Calendar); | 5224 | error=Phone->AddCalendar(&s,&Calendar); |
5225 | Print_Error(error); | 5225 | Print_Error(error); |
5226 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5226 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5227 | if (gshutdown) { | 5227 | if (gshutdown) { |
5228 | GSM_Terminate(); | 5228 | GSM_Terminate(); |
5229 | exit(0); | 5229 | exit(0); |
5230 | } | 5230 | } |
5231 | } | 5231 | } |
5232 | printmsgerr("\n"); | 5232 | printmsgerr("\n"); |
5233 | } | 5233 | } |
5234 | } | 5234 | } |
5235 | } | 5235 | } |
5236 | if (Backup.ToDo[0] != NULL) { | 5236 | if (Backup.ToDo[0] != NULL) { |
5237 | ToDo.Location = 1; | 5237 | ToDo.Location = 1; |
5238 | error=Phone->GetToDoStatus(&s,&ToDoStatus); | 5238 | error=Phone->GetToDoStatus(&s,&ToDoStatus); |
5239 | if (error == ERR_NONE) { | 5239 | if (error == ERR_NONE) { |
5240 | if (answer_yes("Add ToDo")) { | 5240 | if (answer_yes("Add ToDo")) { |
5241 | max = 0; | 5241 | max = 0; |
5242 | while (Backup.ToDo[max]!=NULL) max++; | 5242 | while (Backup.ToDo[max]!=NULL) max++; |
5243 | for (i=0;i<max;i++) { | 5243 | for (i=0;i<max;i++) { |
5244 | ToDo = *Backup.ToDo[i]; | 5244 | ToDo = *Backup.ToDo[i]; |
5245 | error = Phone->AddToDo(&s,&ToDo); | 5245 | error = Phone->AddToDo(&s,&ToDo); |
5246 | Print_Error(error); | 5246 | Print_Error(error); |
5247 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5247 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5248 | if (gshutdown) { | 5248 | if (gshutdown) { |
5249 | GSM_Terminate(); | 5249 | GSM_Terminate(); |
5250 | exit(0); | 5250 | exit(0); |
5251 | } | 5251 | } |
5252 | } | 5252 | } |
5253 | printmsgerr("\n"); | 5253 | printmsgerr("\n"); |
5254 | } | 5254 | } |
5255 | } | 5255 | } |
5256 | } | 5256 | } |
5257 | if (Backup.WAPBookmark[0] != NULL) { | 5257 | if (Backup.WAPBookmark[0] != NULL) { |
5258 | Bookmark.Location = 1; | 5258 | Bookmark.Location = 1; |
5259 | error = Phone->GetWAPBookmark(&s,&Bookmark); | 5259 | error = Phone->GetWAPBookmark(&s,&Bookmark); |
5260 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION) { | 5260 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION) { |
5261 | if (answer_yes("Add WAP bookmarks")) { | 5261 | if (answer_yes("Add WAP bookmarks")) { |
5262 | max = 0; | 5262 | max = 0; |
5263 | while (Backup.WAPBookmark[max]!=NULL) max++; | 5263 | while (Backup.WAPBookmark[max]!=NULL) max++; |
5264 | for (i=0;i<max;i++) { | 5264 | for (i=0;i<max;i++) { |
5265 | Bookmark = *Backup.WAPBookmark[i]; | 5265 | Bookmark = *Backup.WAPBookmark[i]; |
5266 | Bookmark.Location = 0; | 5266 | Bookmark.Location = 0; |
5267 | error=Phone->SetWAPBookmark(&s,&Bookmark); | 5267 | error=Phone->SetWAPBookmark(&s,&Bookmark); |
5268 | Print_Error(error); | 5268 | Print_Error(error); |
5269 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); | 5269 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); |
5270 | if (gshutdown) { | 5270 | if (gshutdown) { |
5271 | GSM_Terminate(); | 5271 | GSM_Terminate(); |
5272 | exit(0); | 5272 | exit(0); |
5273 | } | 5273 | } |
5274 | } | 5274 | } |
5275 | printmsgerr("\n"); | 5275 | printmsgerr("\n"); |
5276 | } | 5276 | } |
5277 | } | 5277 | } |
5278 | } | 5278 | } |
5279 | 5279 | ||
5280 | GSM_Terminate(); | 5280 | GSM_Terminate(); |
5281 | } | 5281 | } |
5282 | #endif | 5282 | #endif |
5283 | 5283 | ||
5284 | static void ClearAll(int argc, char *argv[]) | 5284 | static void ClearAll(int argc, char *argv[]) |
5285 | { | 5285 | { |
5286 | GSM_MemoryStatusMemStatus; | 5286 | GSM_MemoryStatusMemStatus; |
5287 | GSM_ToDoStatus ToDoStatus; | 5287 | GSM_ToDoStatus ToDoStatus; |
5288 | GSM_CalendarEntryCalendar; | 5288 | GSM_CalendarEntryCalendar; |
5289 | GSM_ToDoEntry ToDo; | 5289 | GSM_ToDoEntry ToDo; |
5290 | GSM_WAPBookmark Bookmark; | 5290 | GSM_WAPBookmark Bookmark; |
5291 | GSM_FMStation Station; | 5291 | GSM_FMStation Station; |
5292 | GSM_MemoryEntry Pbk; | 5292 | GSM_MemoryEntry Pbk; |
5293 | bool DoClear; | 5293 | bool DoClear; |
5294 | 5294 | ||
5295 | GSM_Init(true); | 5295 | GSM_Init(true); |
5296 | 5296 | ||
5297 | DoClear = false; | 5297 | DoClear = false; |
5298 | MemStatus.MemoryType = MEM_ME; | 5298 | MemStatus.MemoryType = MEM_ME; |
5299 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 5299 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
5300 | if (error==ERR_NONE && MemStatus.MemoryUsed !=0) { | 5300 | if (error==ERR_NONE && MemStatus.MemoryUsed !=0) { |
5301 | if (answer_yes("Delete phone phonebook")) DoClear = true; | 5301 | if (answer_yes("Delete phone phonebook")) DoClear = true; |
5302 | } | 5302 | } |
5303 | if (DoClear) { | 5303 | if (DoClear) { |
5304 | error = Phone->DeleteAllMemory(&s,MEM_ME); | 5304 | error = Phone->DeleteAllMemory(&s,MEM_ME); |
5305 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { | 5305 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { |
5306 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { | 5306 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { |
5307 | Pbk.MemoryType = MEM_ME; | 5307 | Pbk.MemoryType = MEM_ME; |
5308 | Pbk.Location= i + 1; | 5308 | Pbk.Location= i + 1; |
5309 | Pbk.EntriesNum= 0; | 5309 | Pbk.EntriesNum= 0; |
5310 | error=Phone->DeleteMemory(&s, &Pbk); | 5310 | error=Phone->DeleteMemory(&s, &Pbk); |
5311 | Print_Error(error); | 5311 | Print_Error(error); |
5312 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); | 5312 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); |
5313 | if (gshutdown) { | 5313 | if (gshutdown) { |
5314 | GSM_Terminate(); | 5314 | GSM_Terminate(); |
5315 | exit(0); | 5315 | exit(0); |
5316 | } | 5316 | } |
5317 | } | 5317 | } |
5318 | printmsgerr("\n"); | 5318 | printmsgerr("\n"); |
5319 | } else { | 5319 | } else { |
5320 | printmsgerr("Done\n"); | 5320 | printmsgerr("Done\n"); |
5321 | Print_Error(error); | 5321 | Print_Error(error); |
5322 | } | 5322 | } |
5323 | } | 5323 | } |
5324 | 5324 | ||
5325 | DoClear = false; | 5325 | DoClear = false; |
5326 | MemStatus.MemoryType = MEM_SM; | 5326 | MemStatus.MemoryType = MEM_SM; |
5327 | error=Phone->GetMemoryStatus(&s, &MemStatus); | 5327 | error=Phone->GetMemoryStatus(&s, &MemStatus); |
5328 | if (error==ERR_NONE && MemStatus.MemoryUsed !=0) { | 5328 | if (error==ERR_NONE && MemStatus.MemoryUsed !=0) { |
5329 | if (answer_yes("Delete SIM phonebook")) DoClear = true; | 5329 | if (answer_yes("Delete SIM phonebook")) DoClear = true; |
5330 | } | 5330 | } |
5331 | if (DoClear) { | 5331 | if (DoClear) { |
5332 | error = Phone->DeleteAllMemory(&s,MEM_SM); | 5332 | error = Phone->DeleteAllMemory(&s,MEM_SM); |
5333 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { | 5333 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { |
5334 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { | 5334 | for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { |
5335 | Pbk.MemoryType = MEM_SM; | 5335 | Pbk.MemoryType = MEM_SM; |
5336 | Pbk.Location= i + 1; | 5336 | Pbk.Location= i + 1; |
5337 | Pbk.EntriesNum= 0; | 5337 | Pbk.EntriesNum= 0; |
5338 | error=Phone->DeleteMemory(&s, &Pbk); | 5338 | error=Phone->DeleteMemory(&s, &Pbk); |
5339 | Print_Error(error); | 5339 | Print_Error(error); |
5340 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); | 5340 | printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); |
5341 | if (gshutdown) { | 5341 | if (gshutdown) { |
5342 | GSM_Terminate(); | 5342 | GSM_Terminate(); |
5343 | exit(0); | 5343 | exit(0); |
5344 | } | 5344 | } |
5345 | } | 5345 | } |
5346 | printmsgerr("\n"); | 5346 | printmsgerr("\n"); |
5347 | } else { | 5347 | } else { |
5348 | printmsgerr("Done\n"); | 5348 | printmsgerr("Done\n"); |
5349 | Print_Error(error); | 5349 | Print_Error(error); |
5350 | } | 5350 | } |
5351 | } | 5351 | } |
5352 | 5352 | ||
5353 | DoClear = false; | 5353 | DoClear = false; |
5354 | error = Phone->GetNextCalendar(&s,&Calendar,true); | 5354 | error = Phone->GetNextCalendar(&s,&Calendar,true); |
5355 | if (error == ERR_NONE) { | 5355 | if (error == ERR_NONE) { |
5356 | if (answer_yes("Delete calendar notes")) DoClear = true; | 5356 | if (answer_yes("Delete calendar notes")) DoClear = true; |
5357 | } | 5357 | } |
5358 | if (DoClear) { | 5358 | if (DoClear) { |
5359 | printmsgerr("Deleting: "); | 5359 | printmsgerr("Deleting: "); |
5360 | error=Phone->DeleteAllCalendar(&s); | 5360 | error=Phone->DeleteAllCalendar(&s); |
5361 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { | 5361 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { |
5362 | while (1) { | 5362 | while (1) { |
5363 | error = Phone->GetNextCalendar(&s,&Calendar,true); | 5363 | error = Phone->GetNextCalendar(&s,&Calendar,true); |
5364 | if (error != ERR_NONE) break; | 5364 | if (error != ERR_NONE) break; |
5365 | error = Phone->DeleteCalendar(&s,&Calendar); | 5365 | error = Phone->DeleteCalendar(&s,&Calendar); |
5366 | Print_Error(error); | 5366 | Print_Error(error); |
5367 | printmsgerr("*"); | 5367 | printmsgerr("*"); |
5368 | } | 5368 | } |
5369 | printmsgerr("\n"); | 5369 | printmsgerr("\n"); |
5370 | } else { | 5370 | } else { |
5371 | printmsgerr("Done\n"); | 5371 | printmsgerr("Done\n"); |
5372 | Print_Error(error); | 5372 | Print_Error(error); |
5373 | } | 5373 | } |
5374 | } | 5374 | } |
5375 | 5375 | ||
5376 | DoClear = false; | 5376 | DoClear = false; |
5377 | error = Phone->GetToDoStatus(&s,&ToDoStatus); | 5377 | error = Phone->GetToDoStatus(&s,&ToDoStatus); |
5378 | if (error == ERR_NONE && ToDoStatus.Used != 0) { | 5378 | if (error == ERR_NONE && ToDoStatus.Used != 0) { |
5379 | if (answer_yes("Delete ToDo")) DoClear = true; | 5379 | if (answer_yes("Delete ToDo")) DoClear = true; |
5380 | } | 5380 | } |
5381 | if (DoClear) { | 5381 | if (DoClear) { |
5382 | printmsgerr("Deleting: "); | 5382 | printmsgerr("Deleting: "); |
5383 | error=Phone->DeleteAllToDo(&s); | 5383 | error=Phone->DeleteAllToDo(&s); |
5384 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { | 5384 | if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { |
5385 | while (1) { | 5385 | while (1) { |
5386 | error = Phone->GetNextToDo(&s,&ToDo,true); | 5386 | error = Phone->GetNextToDo(&s,&ToDo,true); |
5387 | if (error != ERR_NONE) break; | 5387 | if (error != ERR_NONE) break; |
5388 | error = Phone->DeleteToDo(&s,&ToDo); | 5388 | error = Phone->DeleteToDo(&s,&ToDo); |
5389 | Print_Error(error); | 5389 | Print_Error(error); |
5390 | printmsgerr("*"); | 5390 | printmsgerr("*"); |
5391 | } | 5391 | } |
5392 | printmsgerr("\n"); | 5392 | printmsgerr("\n"); |
5393 | } else { | 5393 | } else { |
5394 | printmsgerr("Done\n"); | 5394 | printmsgerr("Done\n"); |
5395 | Print_Error(error); | 5395 | Print_Error(error); |
5396 | } | 5396 | } |
5397 | } | 5397 | } |
5398 | 5398 | ||
5399 | Bookmark.Location = 1; | 5399 | Bookmark.Location = 1; |
5400 | error = Phone->GetWAPBookmark(&s,&Bookmark); | 5400 | error = Phone->GetWAPBookmark(&s,&Bookmark); |
5401 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION) { | 5401 | if (error == ERR_NONE || error == ERR_INVALIDLOCATION) { |
5402 | if (answer_yes("Delete WAP bookmarks")) { | 5402 | if (answer_yes("Delete WAP bookmarks")) { |
5403 | printmsgerr("Deleting: "); | 5403 | printmsgerr("Deleting: "); |
5404 | /* One thing to explain: DCT4 phones seems to have bug here. | 5404 | /* One thing to explain: DCT4 phones seems to have bug here. |
5405 | * When delete for example first bookmark, phone change | 5405 | * When delete for example first bookmark, phone change |
5406 | * numeration for getting frame, not for deleting. So, we try to | 5406 | * numeration for getting frame, not for deleting. So, we try to |
5407 | * get 1'st bookmark. Inside frame is "correct" location. We use | 5407 | * get 1'st bookmark. Inside frame is "correct" location. We use |
5408 | * it later | 5408 | * it later |
5409 | */ | 5409 | */ |
5410 | while (error==ERR_NONE) { | 5410 | while (error==ERR_NONE) { |
5411 | error = Phone->DeleteWAPBookmark(&s,&Bookmark); | 5411 | error = Phone->DeleteWAPBookmark(&s,&Bookmark); |
5412 | Bookmark.Location = 1; | 5412 | Bookmark.Location = 1; |
5413 | error = Phone->GetWAPBookmark(&s,&Bookmark); | 5413 | error = Phone->GetWAPBookmark(&s,&Bookmark); |
5414 | printmsgerr("*"); | 5414 | printmsgerr("*"); |
5415 | } | 5415 | } |
5416 | printmsgerr("\n"); | 5416 | printmsgerr("\n"); |
5417 | } | 5417 | } |
5418 | } | 5418 | } |
5419 | if (Phone->DeleteUserRingtones != NOTSUPPORTED) { | 5419 | if (Phone->DeleteUserRingtones != NOTSUPPORTED) { |
5420 | if (answer_yes("Delete all user ringtones")) { | 5420 | if (answer_yes("Delete all user ringtones")) { |
5421 | printmsgerr("Deleting: "); | 5421 | printmsgerr("Deleting: "); |
5422 | error=Phone->DeleteUserRingtones(&s); | 5422 | error=Phone->DeleteUserRingtones(&s); |
5423 | Print_Error(error); | 5423 | Print_Error(error); |
5424 | printmsgerr("Done\n"); | 5424 | printmsgerr("Done\n"); |
5425 | } | 5425 | } |
5426 | } | 5426 | } |
5427 | Station.Location=i; | 5427 | Station.Location=i; |
5428 | error=Phone->GetFMStation(&s,&Station); | 5428 | error=Phone->GetFMStation(&s,&Station); |
5429 | if (error == ERR_NONE || error == ERR_EMPTY) { | 5429 | if (error == ERR_NONE || error == ERR_EMPTY) { |
5430 | if (answer_yes("Delete all FM station")) { | 5430 | if (answer_yes("Delete all FM station")) { |
5431 | error=Phone->ClearFMStations(&s); | 5431 | error=Phone->ClearFMStations(&s); |
5432 | Print_Error(error); | 5432 | Print_Error(error); |
5433 | } | 5433 | } |
5434 | } | 5434 | } |
5435 | 5435 | ||
5436 | GSM_Terminate(); | 5436 | GSM_Terminate(); |
5437 | } | 5437 | } |
5438 | 5438 | ||
5439 | static void DisplayConnectionSettings(GSM_MultiWAPSettings *settings,int j) | 5439 | static void DisplayConnectionSettings(GSM_MultiWAPSettings *settings,int j) |
5440 | { | 5440 | { |
5441 | if (settings->Settings[j].IsContinuous) { | 5441 | if (settings->Settings[j].IsContinuous) { |
5442 | printmsg("Connection type : Continuous\n"); | 5442 | printmsg("Connection type : Continuous\n"); |
5443 | } else { | 5443 | } else { |
5444 | printmsg("Connection type : Temporary\n"); | 5444 | printmsg("Connection type : Temporary\n"); |
5445 | } | 5445 | } |
5446 | if (settings->Settings[j].IsSecurity) { | 5446 | if (settings->Settings[j].IsSecurity) { |
5447 | printmsg("Connection security : On\n"); | 5447 | printmsg("Connection security : On\n"); |
5448 | } else { | 5448 | } else { |
5449 | printmsg("Connection security : Off\n"); | 5449 | printmsg("Connection security : Off\n"); |
5450 | } | 5450 | } |
5451 | printmsg("Proxy : address \"%s\", port %i\n",DecodeUnicodeConsole(settings->Proxy),settings->ProxyPort); | 5451 | printmsg("Proxy : address \"%s\", port %i\n",DecodeUnicodeConsole(settings->Proxy),settings->ProxyPort); |
5452 | printmsg("2'nd proxy : address \"%s\", port %i\n",DecodeUnicodeConsole(settings->Proxy2),settings->Proxy2Port); | 5452 | printmsg("2'nd proxy : address \"%s\", port %i\n",DecodeUnicodeConsole(settings->Proxy2),settings->Proxy2Port); |
5453 | switch (settings->Settings[j].Bearer) { | 5453 | switch (settings->Settings[j].Bearer) { |
5454 | case WAPSETTINGS_BEARER_SMS: | 5454 | case WAPSETTINGS_BEARER_SMS: |
5455 | printmsg("Bearer : SMS"); | 5455 | printmsg("Bearer : SMS"); |
5456 | if (settings->ActiveBearer == WAPSETTINGS_BEARER_SMS) printf(" (active)"); | 5456 | if (settings->ActiveBearer == WAPSETTINGS_BEARER_SMS) printf(" (active)"); |
5457 | printmsg("\nServer number : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Server)); | 5457 | printmsg("\nServer number : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Server)); |
5458 | printmsg("Service number : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Service)); | 5458 | printmsg("Service number : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Service)); |
5459 | break; | 5459 | break; |
5460 | case WAPSETTINGS_BEARER_DATA: | 5460 | case WAPSETTINGS_BEARER_DATA: |
5461 | printmsg("Bearer : Data (CSD)"); | 5461 | printmsg("Bearer : Data (CSD)"); |
5462 | if (settings->ActiveBearer == WAPSETTINGS_BEARER_DATA) printf(" (active)"); | 5462 | if (settings->ActiveBearer == WAPSETTINGS_BEARER_DATA) printf(" (active)"); |
5463 | printmsg("\nDial-up number : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].DialUp)); | 5463 | printmsg("\nDial-up number : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].DialUp)); |
5464 | printmsg("IP address : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].IPAddress)); | 5464 | printmsg("IP address : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].IPAddress)); |
5465 | if (settings->Settings[j].ManualLogin) { | 5465 | if (settings->Settings[j].ManualLogin) { |
5466 | printmsg("Login Type : Manual\n"); | 5466 | printmsg("Login Type : Manual\n"); |
5467 | } else { | 5467 | } else { |
5468 | printmsg("Login Type : Automatic\n"); | 5468 | printmsg("Login Type : Automatic\n"); |
5469 | } | 5469 | } |
5470 | if (settings->Settings[j].IsNormalAuthentication) { | 5470 | if (settings->Settings[j].IsNormalAuthentication) { |
5471 | printmsg("Authentication type : Normal\n"); | 5471 | printmsg("Authentication type : Normal\n"); |
5472 | } else { | 5472 | } else { |
5473 | printmsg("Authentication type : Secure\n"); | 5473 | printmsg("Authentication type : Secure\n"); |
5474 | } | 5474 | } |
5475 | if (settings->Settings[j].IsISDNCall) { | 5475 | if (settings->Settings[j].IsISDNCall) { |
5476 | printmsg("Data call type : ISDN\n"); | 5476 | printmsg("Data call type : ISDN\n"); |
5477 | } else { | 5477 | } else { |
5478 | printmsg("Data call type : Analogue\n"); | 5478 | printmsg("Data call type : Analogue\n"); |
5479 | } | 5479 | } |
5480 | switch (settings->Settings[j].Speed) { | 5480 | switch (settings->Settings[j].Speed) { |
5481 | case WAPSETTINGS_SPEED_9600 : printmsg("Data call speed : 9600\n"); break; | 5481 | case WAPSETTINGS_SPEED_9600 : printmsg("Data call speed : 9600\n"); break; |
5482 | case WAPSETTINGS_SPEED_14400 : printmsg("Data call speed : 14400\n"); break; | 5482 | case WAPSETTINGS_SPEED_14400 : printmsg("Data call speed : 14400\n"); break; |
5483 | case WAPSETTINGS_SPEED_AUTO : printmsg("Data call speed : Auto\n"); break; | 5483 | case WAPSETTINGS_SPEED_AUTO : printmsg("Data call speed : Auto\n"); break; |
5484 | } | 5484 | } |
5485 | printmsg("User name : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].User)); | 5485 | printmsg("User name : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].User)); |
5486 | printmsg("Password : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Password)); | 5486 | printmsg("Password : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Password)); |
5487 | break; | 5487 | break; |
5488 | case WAPSETTINGS_BEARER_USSD: | 5488 | case WAPSETTINGS_BEARER_USSD: |
5489 | printmsg("Bearer : USSD"); | 5489 | printmsg("Bearer : USSD"); |
5490 | if (settings->ActiveBearer == WAPSETTINGS_BEARER_USSD) printf(" (active)"); | 5490 | if (settings->ActiveBearer == WAPSETTINGS_BEARER_USSD) printf(" (active)"); |
5491 | printmsg("\nService code : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Code)); | 5491 | printmsg("\nService code : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Code)); |
5492 | if (settings->Settings[j].IsIP) { | 5492 | if (settings->Settings[j].IsIP) { |
5493 | printmsg("Address type : IP address\nIPaddress : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Service)); | 5493 | printmsg("Address type : IP address\nIPaddress : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Service)); |
5494 | } else { | 5494 | } else { |
5495 | printmsg("Address type : Service number\nService number : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Service)); | 5495 | printmsg("Address type : Service number\nService number : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Service)); |
5496 | } | 5496 | } |
5497 | break; | 5497 | break; |
5498 | case WAPSETTINGS_BEARER_GPRS: | 5498 | case WAPSETTINGS_BEARER_GPRS: |
5499 | printmsg("Bearer : GPRS"); | 5499 | printmsg("Bearer : GPRS"); |
5500 | if (settings->ActiveBearer == WAPSETTINGS_BEARER_GPRS) printf(" (active)"); | 5500 | if (settings->ActiveBearer == WAPSETTINGS_BEARER_GPRS) printf(" (active)"); |
5501 | if (settings->Settings[j].ManualLogin) { | 5501 | if (settings->Settings[j].ManualLogin) { |
5502 | printmsg("\nLogin Type : Manual\n"); | 5502 | printmsg("\nLogin Type : Manual\n"); |
5503 | } else { | 5503 | } else { |
5504 | printmsg("\nLogin Type : Automatic\n"); | 5504 | printmsg("\nLogin Type : Automatic\n"); |
5505 | } | 5505 | } |
5506 | if (settings->Settings[j].IsNormalAuthentication) { | 5506 | if (settings->Settings[j].IsNormalAuthentication) { |
5507 | printmsg("Authentication type : Normal\n"); | 5507 | printmsg("Authentication type : Normal\n"); |
5508 | } else { | 5508 | } else { |
5509 | printmsg("Authentication type : Secure\n"); | 5509 | printmsg("Authentication type : Secure\n"); |
5510 | } | 5510 | } |
5511 | printmsg("Access point : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].DialUp)); | 5511 | printmsg("Access point : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].DialUp)); |
5512 | printmsg("IP address : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].IPAddress)); | 5512 | printmsg("IP address : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].IPAddress)); |
5513 | printmsg("User name : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].User)); | 5513 | printmsg("User name : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].User)); |
5514 | printmsg("Password : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Password)); | 5514 | printmsg("Password : \"%s\"\n",DecodeUnicodeConsole(settings->Settings[j].Password)); |
5515 | } | 5515 | } |
5516 | } | 5516 | } |
5517 | 5517 | ||
5518 | static void GetSyncMLSettings(int argc, char *argv[]) | 5518 | static void GetSyncMLSettings(int argc, char *argv[]) |
5519 | { | 5519 | { |
5520 | GSM_SyncMLSettingssettings; | 5520 | GSM_SyncMLSettingssettings; |
5521 | int start,stop,j; | 5521 | int start,stop,j; |
5522 | 5522 | ||
5523 | GetStartStop(&start, &stop, 2, argc, argv); | 5523 | GetStartStop(&start, &stop, 2, argc, argv); |
5524 | 5524 | ||
5525 | GSM_Init(true); | 5525 | GSM_Init(true); |
5526 | 5526 | ||
5527 | for (i=start;i<=stop;i++) { | 5527 | for (i=start;i<=stop;i++) { |
5528 | settings.Location=i; | 5528 | settings.Location=i; |
5529 | error=Phone->GetSyncMLSettings(&s,&settings); | 5529 | error=Phone->GetSyncMLSettings(&s,&settings); |
5530 | Print_Error(error); | 5530 | Print_Error(error); |
5531 | printmsg("%i. ",i); | 5531 | printmsg("%i. ",i); |
5532 | if (settings.Name[0]==0 && settings.Name[1]==0) { | 5532 | if (settings.Name[0]==0 && settings.Name[1]==0) { |
5533 | printmsg("Set %i",i); | 5533 | printmsg("Set %i",i); |
5534 | } else { | 5534 | } else { |
5535 | printmsg("%s",DecodeUnicodeConsole(settings.Name)); | 5535 | printmsg("%s",DecodeUnicodeConsole(settings.Name)); |
5536 | } | 5536 | } |
5537 | if (settings.Active) printmsg(" (active)"); | 5537 | if (settings.Active) printmsg(" (active)"); |
5538 | // if (settings.ReadOnly) printmsg("\nRead only : yes"); | 5538 | // if (settings.ReadOnly) printmsg("\nRead only : yes"); |
5539 | printmsg("\n"); | 5539 | printmsg("\n"); |
5540 | printmsg("User : \"%s\"\n",DecodeUnicodeConsole(settings.User)); | 5540 | printmsg("User : \"%s\"\n",DecodeUnicodeConsole(settings.User)); |
5541 | printmsg("Password : \"%s\"\n",DecodeUnicodeConsole(settings.Password)); | 5541 | printmsg("Password : \"%s\"\n",DecodeUnicodeConsole(settings.Password)); |
5542 | printmsg("Phonebook database : \"%s\"\n",DecodeUnicodeConsole(settings.PhonebookDataBase)); | 5542 | printmsg("Phonebook database : \"%s\"\n",DecodeUnicodeConsole(settings.PhonebookDataBase)); |
5543 | printmsg("Calendar database : \"%s\"\n",DecodeUnicodeConsole(settings.CalendarDataBase)); | 5543 | printmsg("Calendar database : \"%s\"\n",DecodeUnicodeConsole(settings.CalendarDataBase)); |
5544 | printmsg("Server : \"%s\"\n",DecodeUnicodeConsole(settings.Server)); | 5544 | printmsg("Server : \"%s\"\n",DecodeUnicodeConsole(settings.Server)); |
5545 | printmsg("Sync. phonebook : "); | 5545 | printmsg("Sync. phonebook : "); |
5546 | if (settings.SyncPhonebook) printmsg("yes\n"); | 5546 | if (settings.SyncPhonebook) printmsg("yes\n"); |
5547 | if (!settings.SyncPhonebook) printmsg("no\n"); | 5547 | if (!settings.SyncPhonebook) printmsg("no\n"); |
5548 | printmsg("Sync. calendar : "); | 5548 | printmsg("Sync. calendar : "); |
5549 | if (settings.SyncCalendar) printmsg("yes\n"); | 5549 | if (settings.SyncCalendar) printmsg("yes\n"); |
5550 | if (!settings.SyncCalendar) printmsg("no\n"); | 5550 | if (!settings.SyncCalendar) printmsg("no\n"); |
5551 | printmsg("\n"); | 5551 | printmsg("\n"); |
5552 | for (j=0;j<settings.Connection.Number;j++) { | 5552 | for (j=0;j<settings.Connection.Number;j++) { |
5553 | if (settings.Connection.Settings[j].Title[0]==0 && settings.Connection.Settings[j].Title[1]==0) { | 5553 | if (settings.Connection.Settings[j].Title[0]==0 && settings.Connection.Settings[j].Title[1]==0) { |
5554 | printmsg("Connection set name : Set %i\n",i); | 5554 | printmsg("Connection set name : Set %i\n",i); |
5555 | } else { | 5555 | } else { |
5556 | printmsg("Connection set name : %s\n",DecodeUnicodeConsole(settings.Connection.Settings[j].Title)); | 5556 | printmsg("Connection set name : %s\n",DecodeUnicodeConsole(settings.Connection.Settings[j].Title)); |
5557 | } | 5557 | } |
5558 | DisplayConnectionSettings(&settings.Connection,j); | 5558 | DisplayConnectionSettings(&settings.Connection,j); |
5559 | printf("\n"); | 5559 | printf("\n"); |
5560 | } | 5560 | } |
5561 | } | 5561 | } |
5562 | GSM_Terminate(); | 5562 | GSM_Terminate(); |
5563 | } | 5563 | } |
5564 | 5564 | ||
5565 | static void GetChatSettings(int argc, char *argv[]) | 5565 | static void GetChatSettings(int argc, char *argv[]) |
5566 | { | 5566 | { |
5567 | GSM_ChatSettingssettings; | 5567 | GSM_ChatSettingssettings; |
5568 | int start,stop,j; | 5568 | int start,stop,j; |
5569 | 5569 | ||
5570 | GetStartStop(&start, &stop, 2, argc, argv); | 5570 | GetStartStop(&start, &stop, 2, argc, argv); |
5571 | 5571 | ||
5572 | GSM_Init(true); | 5572 | GSM_Init(true); |
5573 | 5573 | ||
5574 | for (i=start;i<=stop;i++) { | 5574 | for (i=start;i<=stop;i++) { |
5575 | settings.Location=i; | 5575 | settings.Location=i; |
5576 | error=Phone->GetChatSettings(&s,&settings); | 5576 | error=Phone->GetChatSettings(&s,&settings); |
5577 | Print_Error(error); | 5577 | Print_Error(error); |
5578 | printmsg("%i. ",i); | 5578 | printmsg("%i. ",i); |
5579 | if (settings.Name[0]==0 && settings.Name[1]==0) { | 5579 | if (settings.Name[0]==0 && settings.Name[1]==0) { |
5580 | printmsg("Set %i",i); | 5580 | printmsg("Set %i",i); |
5581 | } else { | 5581 | } else { |
5582 | printmsg("%s",DecodeUnicodeConsole(settings.Name)); | 5582 | printmsg("%s",DecodeUnicodeConsole(settings.Name)); |
5583 | } | 5583 | } |
5584 | if (settings.Active) printmsg(" (active)"); | 5584 | if (settings.Active) printmsg(" (active)"); |
5585 | // if (settings.ReadOnly) printmsg("\nRead only : yes"); | 5585 | // if (settings.ReadOnly) printmsg("\nRead only : yes"); |
5586 | printmsg("\n"); | 5586 | printmsg("\n"); |
5587 | printmsg("Homepage : \"%s\"\n",DecodeUnicodeConsole(settings.HomePage)); | 5587 | printmsg("Homepage : \"%s\"\n",DecodeUnicodeConsole(settings.HomePage)); |
5588 | printmsg("User : \"%s\"\n",DecodeUnicodeConsole(settings.User)); | 5588 | printmsg("User : \"%s\"\n",DecodeUnicodeConsole(settings.User)); |
5589 | printmsg("Password : \"%s\"\n",DecodeUnicodeConsole(settings.Password)); | 5589 | printmsg("Password : \"%s\"\n",DecodeUnicodeConsole(settings.Password)); |
5590 | printmsg("\n"); | 5590 | printmsg("\n"); |
diff --git a/kammu.control b/phoneaccess.control index 07559e7..07559e7 100644 --- a/kammu.control +++ b/phoneaccess.control | |||