-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 @@ export KDEPIMDIR = $(shell pwd) export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) ifeq ($(PLATFORM) , zaurus) BUILD_NO_LDAP_PLUGIN=1 endif ifneq ($(PLATFORM) , zaurus) BUILD_NO_SHARP_PLUGIN=1 endif SUBDIRS_MICROKDE = \ libical/src/libical \ libical/src/libicalss \ qtcompat \ microkde \ libkcal \ libkdepim \ kabc \ kabc/formats/binary \ kabc/plugins/file \ kabc/plugins/dir \ korganizer \ kalarmd \ kaddressbook SUBDIRS_QTOPIA_PLUGIN = \ kabc/plugins/qtopia SUBDIRS_OPIE_PLUGIN = \ kabc/plugins/opie SUBDIRS_SHARP_PLUGIN = \ kabc/plugins/sharpdtm SUBDIRS_LDAP_PLUGIN = \ kabc/plugins/ldap SUBDIRS_MICROMAIL = \ kmicromail/libetpan \ kmicromail/libmailwrapper \ kmicromail SUBDIRS_GAMMU = \ gammu/emb/common \ gammu/emb/gammu SUBDIRS_PWMANAGER = \ pwmanager/pwmanager SUBDIRS = \ $(SUBDIRS_MICROKDE) \ $(SUBDIRS_QTOPIA_PLUGIN) \ $(SUBDIRS_OPIE_PLUGIN) \ $(SUBDIRS_SHARP_PLUGIN) \ $(SUBDIRS_LDAP_PLUGIN) \ $(SUBDIRS_MICROMAIL) \ $(SUBDIRS_GAMMU) \ $(SUBDIRS_PWMANAGER) + all: build_microkde \ build_qtopia_plugin \ build_opie_plugin \ build_sharp_plugin \ build_ldap_plugin \ build_micromail \ build_gammu \ build_pwmanager build_microkde: variable_test tmake for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done build_qtopia_plugin: build_microkde for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done build_opie_plugin: build_microkde ifdef BUILD_NO_OPIE_PLUGIN @echo == opie plugin not build. else for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_sharp_plugin: build_microkde ifdef BUILD_NO_SHARP_PLUGIN @echo == ldap plugin not build. else for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_ldap_plugin: build_microkde ifdef BUILD_NO_LDAP_PLUGIN @echo == ldap plugin not build. else for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_micromail: build_microkde ifdef BUILD_NO_MICROMAIL @echo == kmicromail not build. else for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_gammu: variable_test tmake ifdef BUILD_NO_GAMMU @echo == gammu not build. else for i in $(SUBDIRS_GAMMU); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_pwmanager: build_microkde ifdef BUILD_NO_PWMANAGER @echo == pwmanager not build. else for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif variable_info: @echo -------------------------------------- @echo KDEPIM buildsystem, variableinfo... @echo KDEPIMDIR=$(KDEPIMDIR) @echo QTDIR=$(QTDIR) @echo QPEDIR=$(QPEDIR) @echo OPIEDIR=$(OPIEDIR) @echo PLATFORM=$(PLATFORM) @echo RELEASE_DEBUG=$(RELEASE_DEBUG) @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) ifndef BUILD_NO_SHARP_PLUGIN @echo SHARPDTMSDK=$(SHARPDTMSDK) endif @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) @echo -------------------------------------- variable_test: variable_info @echo KDEPIM buildsystem, variablecheck... ifndef KDEPIMDIR @echo KDEPIMDIR is not defined. $(error KDEPIMDIR is not defined) endif ifndef PLATFORM @echo PLATFORM is not defined. $(error PLATFORM is not defined) endif ifdef BUILD_NO_LDAP_PLUGIN @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) endif ifdef BUILD_NO_OPIE_PLUGIN @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) endif ifdef BUILD_NO_MICROMAIL @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) endif ifdef BUILD_NO_SHARP_PLUGIN @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) else ifndef SHARPDTMSDK @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) $(error SHARPDTMSDK is not defined) endif endif ifdef BUILD_NO_GAMMU @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) endif ifdef BUILD_NO_PWMANAGER @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) endif @echo -------------------------------------- objects: for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done mkdir -p libical/lib/$(PLATFORM) clean: rm -rf libical/lib/$(PLATFORM)/*; for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ done + install: - + cd bin/kdepim; make install cp -r Pim $(QPEDIR)/apps cp db2file/db2file $(QPEDIR)/bin/db2file cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop -dist: +dist: @echo Dont forget to do "make install" before "make dist" rm -f *arm.ipk rm -f *~ cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim ./mkipks kmicrokdelibs.control ./mkipks korganizer.control ./mkipks kaddressbook.control ifndef BUILD_NO_MICROMAIL ./mkipks kopiemail.control endif ./mkipks korganizer-alarm.control ifndef BUILD_NO_GAMMU - ./mkipks kammu.control + ./mkipks phoneaccess.control endif ifndef BUILD_NO_PWMANAGER ./mkipks pwmanager.control endif ./mkipks pim_TAB_icon.control tmake: objects \ qtcompat/Makefile$(PLATFORM) \ microkde/Makefile$(PLATFORM) \ libkcal/Makefile$(PLATFORM) \ libkdepim/Makefile$(PLATFORM) \ korganizer/Makefile$(PLATFORM) \ kalarmd/Makefile$(PLATFORM) \ libical/src/libical/Makefile$(PLATFORM) \ libical/src/libicalss/Makefile$(PLATFORM) \ kabc/Makefile$(PLATFORM) \ kabc/formats/binary/Makefile$(PLATFORM) \ kabc/plugins/file/Makefile$(PLATFORM) \ kabc/plugins/dir/Makefile$(PLATFORM) \ kabc/plugins/ldap/Makefile$(PLATFORM) \ kabc/plugins/opie/Makefile$(PLATFORM) \ kabc/plugins/qtopia/Makefile$(PLATFORM) \ kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ kaddressbook/Makefile$(PLATFORM) \ kmicromail/Makefile$(PLATFORM) \ kmicromail/libetpan/Makefile$(PLATFORM) \ kmicromail/libmailwrapper/Makefile$(PLATFORM) \ gammu/emb/common/Makefile$(PLATFORM) \ gammu/emb/gammu/Makefile$(PLATFORM) \ pwmanager/pwmanager/Makefile$(PLATFORM) \ - - qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) microkde/Makefile$(PLATFORM): microkde/microkdeE.pro cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) kabc/Makefile$(PLATFORM): kabc/kabcE.pro cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) + diff --git a/Makefile.Embedded b/Makefile.Embedded index 2e1651c..0b8997e 100644 --- a/Makefile.Embedded +++ b/Makefile.Embedded @@ -1,330 +1,330 @@ export KDEPIMDIR = $(shell pwd) export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) ifeq ($(PLATFORM) , zaurus) BUILD_NO_LDAP_PLUGIN=1 endif ifneq ($(PLATFORM) , zaurus) BUILD_NO_SHARP_PLUGIN=1 endif SUBDIRS_MICROKDE = \ libical/src/libical \ libical/src/libicalss \ qtcompat \ microkde \ libkcal \ libkdepim \ kabc \ kabc/formats/binary \ kabc/plugins/file \ kabc/plugins/dir \ korganizer \ kalarmd \ kaddressbook SUBDIRS_QTOPIA_PLUGIN = \ kabc/plugins/qtopia SUBDIRS_OPIE_PLUGIN = \ kabc/plugins/opie SUBDIRS_SHARP_PLUGIN = \ kabc/plugins/sharpdtm SUBDIRS_LDAP_PLUGIN = \ kabc/plugins/ldap SUBDIRS_MICROMAIL = \ kmicromail/libetpan \ kmicromail/libmailwrapper \ kmicromail SUBDIRS_GAMMU = \ gammu/emb/common \ gammu/emb/gammu SUBDIRS_PWMANAGER = \ pwmanager/pwmanager SUBDIRS = \ $(SUBDIRS_MICROKDE) \ $(SUBDIRS_QTOPIA_PLUGIN) \ $(SUBDIRS_OPIE_PLUGIN) \ $(SUBDIRS_SHARP_PLUGIN) \ $(SUBDIRS_LDAP_PLUGIN) \ $(SUBDIRS_MICROMAIL) \ $(SUBDIRS_GAMMU) \ $(SUBDIRS_PWMANAGER) all: build_microkde \ build_qtopia_plugin \ build_opie_plugin \ build_sharp_plugin \ build_ldap_plugin \ build_micromail \ build_gammu \ build_pwmanager build_microkde: variable_test tmake for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done build_qtopia_plugin: build_microkde for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done build_opie_plugin: build_microkde ifdef BUILD_NO_OPIE_PLUGIN @echo == opie plugin not build. else for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_sharp_plugin: build_microkde ifdef BUILD_NO_SHARP_PLUGIN @echo == ldap plugin not build. else for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_ldap_plugin: build_microkde ifdef BUILD_NO_LDAP_PLUGIN @echo == ldap plugin not build. else for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_micromail: build_microkde ifdef BUILD_NO_MICROMAIL @echo == kmicromail not build. else for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_gammu: variable_test tmake ifdef BUILD_NO_GAMMU @echo == gammu not build. else for i in $(SUBDIRS_GAMMU); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif build_pwmanager: build_microkde ifdef BUILD_NO_PWMANAGER @echo == pwmanager not build. else for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ make -f Makefile$(PLATFORM) || exit 1; popd; \ done endif variable_info: @echo -------------------------------------- @echo KDEPIM buildsystem, variableinfo... @echo KDEPIMDIR=$(KDEPIMDIR) @echo QTDIR=$(QTDIR) @echo QPEDIR=$(QPEDIR) @echo OPIEDIR=$(OPIEDIR) @echo PLATFORM=$(PLATFORM) @echo RELEASE_DEBUG=$(RELEASE_DEBUG) @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) ifndef BUILD_NO_SHARP_PLUGIN @echo SHARPDTMSDK=$(SHARPDTMSDK) endif @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) @echo -------------------------------------- variable_test: variable_info @echo KDEPIM buildsystem, variablecheck... ifndef KDEPIMDIR @echo KDEPIMDIR is not defined. $(error KDEPIMDIR is not defined) endif ifndef PLATFORM @echo PLATFORM is not defined. $(error PLATFORM is not defined) endif ifdef BUILD_NO_LDAP_PLUGIN @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) endif ifdef BUILD_NO_OPIE_PLUGIN @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) endif ifdef BUILD_NO_MICROMAIL @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) endif ifdef BUILD_NO_SHARP_PLUGIN @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) else ifndef SHARPDTMSDK @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) $(error SHARPDTMSDK is not defined) endif endif ifdef BUILD_NO_GAMMU @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) endif ifdef BUILD_NO_PWMANAGER @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) endif @echo -------------------------------------- objects: for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done mkdir -p libical/lib/$(PLATFORM) clean: rm -rf libical/lib/$(PLATFORM)/*; for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ done install: cd bin/kdepim; make install cp -r Pim $(QPEDIR)/apps cp db2file/db2file $(QPEDIR)/bin/db2file cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop dist: @echo Dont forget to do "make install" before "make dist" rm -f *arm.ipk rm -f *~ cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim ./mkipks kmicrokdelibs.control ./mkipks korganizer.control ./mkipks kaddressbook.control ifndef BUILD_NO_MICROMAIL ./mkipks kopiemail.control endif ./mkipks korganizer-alarm.control ifndef BUILD_NO_GAMMU - ./mkipks kammu.control + ./mkipks phoneaccess.control endif ifndef BUILD_NO_PWMANAGER ./mkipks pwmanager.control endif ./mkipks pim_TAB_icon.control tmake: objects \ qtcompat/Makefile$(PLATFORM) \ microkde/Makefile$(PLATFORM) \ libkcal/Makefile$(PLATFORM) \ libkdepim/Makefile$(PLATFORM) \ korganizer/Makefile$(PLATFORM) \ kalarmd/Makefile$(PLATFORM) \ libical/src/libical/Makefile$(PLATFORM) \ libical/src/libicalss/Makefile$(PLATFORM) \ kabc/Makefile$(PLATFORM) \ kabc/formats/binary/Makefile$(PLATFORM) \ kabc/plugins/file/Makefile$(PLATFORM) \ kabc/plugins/dir/Makefile$(PLATFORM) \ kabc/plugins/ldap/Makefile$(PLATFORM) \ kabc/plugins/opie/Makefile$(PLATFORM) \ kabc/plugins/qtopia/Makefile$(PLATFORM) \ kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ kaddressbook/Makefile$(PLATFORM) \ kmicromail/Makefile$(PLATFORM) \ kmicromail/libetpan/Makefile$(PLATFORM) \ kmicromail/libmailwrapper/Makefile$(PLATFORM) \ gammu/emb/common/Makefile$(PLATFORM) \ gammu/emb/gammu/Makefile$(PLATFORM) \ pwmanager/pwmanager/Makefile$(PLATFORM) \ qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) microkde/Makefile$(PLATFORM): microkde/microkdeE.pro cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) kabc/Makefile$(PLATFORM): kabc/kabcE.pro cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) 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 @@ WARNING: YOU MAY GET UNEXSPECTED (I.E. WRONG) SYNCHRONIZATION RESULTS, IF YOU CHANGE AN EVENT ON THE FIRST DEVICE AND SYNC IMMEDIATELY FROM THE OTHER DEVICE WITH THIS DEVICE, IF THE CLOCKS OF THE TWO DEVICES HAVE TOO MUCH DIFFERENCE. In other words: Please make shure, that the clocks of the devices you want to sync have only a difference of some seconds! CONTENT: 0) How syncing works 1) Qick overview of settings 2) Sync settings in sync dialog 3) Syncing background 4) Sync preferences 5) Details about sync profile kinds ************************************************************************* 0) How syncing works ************************************************************************* Note: The recommended and easiest way to syncronize two devices where KO/Pi or KA/Pi is installed, is the profile kind "Pi-Sync". Details about that in 5) b). In KDE-Pim/Pi you can synchronize ( sync ) your calendar/addressbook with another calendar/addressbook , by syncing your (local) calendar/addressbook with a (remote) file. This remote file may on your local filesystem or on another (remote) device. If you want to sync with another remote device, you have two create a sync profile. You have two choices for choosing the profil kind: I) You have to choose profile kind "Remote file" and to specify a command line download/upload command ( like scp, ftp, ...) to a) download the remote file to your local machine to a temp file b) sync with this temp file c) upload the synced file to the remote device II) If you want to sync with a device, where KO/Pi( or KA/Pi ) is installed, you can easily get the remote file via network with the build in file transfer feature: Choose profile kind "Pi-Sync" and a) Start KO/Pi or KA/Pi on remote device and enable "Pi-Sync" on remote device with password and port. b) Specify password, port and IP address in your profile. You can sync with your mobile phone as well. Everything is explained in more details below. NOTE: If you do not use profile kind "Pi-Sync", it is recommended to close a running KO/Pi ( or KA/Pi) on the remote device. (Note: KO/Pi( or KA/Pi) running on Zaurus with FastLoad enabled will never be closed!) After syncing with a running KO/Pi on the remote device, a "save" on the remote device will tell you that it needs to merge (sync). After merging (just a syncing with the changed file) you will get the new data showing in remote KO/Pi. ************************************************************************* 1) Qick overview of settings ************************************************************************* a) Open sync settings dialog (Menu Synchronize - Configure...) b) Give your device a unique name. (unique in the set of all devices you want to sync with). If you have already configured another devive and created there a sync profile to sync with this device, give your device the same name as this sync profile! The same name is important, because it makes it possible to sync first A->B (A local device, that performs the sync, B remote device) and then B->A. Such that the B->A sync knows about the already performed A->B sync. That means: It is unimportant if you sync A->B or B->A, the devices A and B will be synced properly. c) Create a new sync profile and give it a unique name. (unique in the set of all sync profiles on this device). If you want to sync with a device, where KO/Pi is already installed and which has a given unique device name, use this device name as your profile name ( refer to b) ). d) Coose the profile kind of your syncing method: (i) Local file or (ii) Pi-Sync or (iii) Remote file or (iiii) Mobile Phone. Detailed explanation in 5) e) Choose the other profile options. Detailed explanation in 2) f) Close sync dialog with OK. g) Sync. NOTE: AFTER SYNCING THERE ARE "SYNC EVENTS" CREATED (OR UPDATED, IF IT ALREADY EXITS) FOR EACH SYNC PROFILE. YOU MAY NOT DELETE OR CHANGE THESE EVENTS. ************************************************************************* 2) Sync settings in sync dialog ************************************************************************* a) Local device name: -> 1) b) b) Profile: -> 1) c) c) Include in multiple sync: In the Synchronize menu, there is a multiple sync menu entry. If you choose this menu entry, all user defined profiles with this 'Include in multiple sync' option enabled will be synced one after another. And this twice. This will take some time. After that sync, on all devices should be the same data. d) Ask for preferences before sync: Check this to be asked for sync preferences settings before each sync. If the profile kind is "Pi-Sync" you will be asked to confirm the "Pi-Sync" specific settings (Password,IP address, port number) as well. That makes it possible to use that profile for a device that is connected via DHCP to the network and gets different IP addresses when connection to the network. e) Sync preferences: Choose here your sync preferences. Details -> 4) f) Show summary after sync: Check this to get a small summary dialog after sync about number of added/changed/deleted events on local/remote. g) Write back synced data: Uncheck this to update the local calendar only. I.e. your local calendar is synced with the remote calendar but nothing on the remote calendar is changed. If you uncheck "Write back synced data", the settings under h) and i) are ignored, of course. h) --Write back (on remote) existing entries only: Check this to update the remote data only. I.e. no data from yor local calendar/addressbook is added to the remote device. You may use this option to sync against some kind of "public calendar/addressbook" without writing back your personal data. i) --Write back (calendar) entries in future only: Check this to write back only calendar entries in future. (Useful when syncing with mobile phones.) You can specify the date range in weeks with ---- Max. weeks in future. Note: The date range starts always 7 days before the actual date! I.e. the calendar events of the last week are written back always. j) Profile kind: Details -> 5) ************************************************************************* 3) Syncing background ************************************************************************* The same mentioned for calendars is valid for addressbooks as well. Synchronizing calendars ( i.e. files ) means, to merge two calendars in a useful way. If the two calendars are completely different, there is no problem, the resulting calendar contains all data from the local and from the remote calendar. Problems will occur, if you have edited items from the local calendar on the remote machine. Then it could be, that items are in conflict. Two items are "in conflict", if they have the same unique ID (which get an item at time of creation and owns it until it is deleted ) and they both are modified after the last synchronization. At first sync of two calendars there is no item deleted. If the calendars are synced before and there is an item, which is not edited after the last sync and is only available in one calendar, then this item is deleted in this calendar. But when was the last synchronization between two calendars? To know that, KO/Pi creates at first syncing of two files an unique event "<profile name> - sync Event" on the remote and the local calendar. After syncing, the start time of this event is set to the time of syncing. The event is read only and the user may not change it. If two such files are synced, that both have an event "<profile name> - sync Event" and the events have the same start time, then deleted items on the one calendar are deleted on the other as well. ************************************************************************* 4) Sync preferences ************************************************************************* Two items are "in conflict", if they have the same unique ID and they both are modified after the last synchronization. (Details -> 3) ). If an item is not modified after the last sync and it is not found in the other calendar, it is deleted. On the first sync, there is no item deleted. SYNC PREFERENCES: -Take local entry on conflict: Takes the local entry on conflict. If it is the first sync, "Ask for every entry" is chosen automatically, if this is selected. -Take remote entry on conflict: Takes the remote entry on conflict. If it is the first sync, "Ask for every entry" is chosen automatically, if this is selected. -Take newest entry on conflict: This takes the newest entry on conflict. May be the most useful syncing mode. -Ask for every entry on conflict: Pops up an event viewer dialog and shows the two conflicting entries there. The user can chose, which entry he would like to take. The button for the newest entry is automatically set as default button. The color for the newest entry is green. -Force: Take local entry always: Even if the calendars are already synced there is no item deleted on local. -Force: Take remote entry always: Analogous to "Force: Take local entry always" ************************************************************************* 5) Details about sync profile kinds ************************************************************************* a) Local file Please specify a local file you want to sync with. b) Pi-Sync (direct Kx/Pi to Kx/Pi sync) We mention here only KO/Pi, but the same is valid for KA/Pi. If you want to sync with a device, where KO/Pi is installed, you can easily get the remote file via network with the build in file transfer feature "Pi-Sync": You have first to enable file transfer on the remote device: - Start KO/Pi on the remote device. - Choose Menu Synchronize-Enable Pi-Sync. - Choose a port number, where KO/Pi should listen for file sending requests. Valid port numbers are numbers between 1 and 65565. Do not specify port numbers, that are used by other applications. A port number between 9000 and 9999 is most likely not used by another application. The default port number is 9197 for KO/Pi. If you specify a port number, which is already in use, you will get an error message when closing this dialog. - Choose a password. - Click OK. Now KO/Pi will send the calendar data via the network, if some other device is sending a "please send calendar" request on the given port using the given password. If you want to be sure, nobody can access your calendar data, simply disable the file transfer feature on the remote device after the syncing is done by choosing: Menu Synchronize-Disable Pi-Sync. Note: If you want to sync with a remote device that gets different IPaddresses each time connected to the network (this may be the case, if you use DHCP for connection of the remote device to the network) simply enable "Ask for preferences before sync". Then you will be asked to confirm the "Pi-Sync" specific settings (Password,IP address, port number) and you can easily change the IP address before each sync. On your local device, create a new profile and choose profile kind "Pi-Sync". Fill in the needed values: - Password for remote access: The password you specified on the remote device. - Remote IP address: The IP address of the remote device. - Remote port number: The port number you specified on the remote device. Now you can syncronize your local device easily with your remote device. This works well for all platforms KO/Pi is running on, e.g. syncing a KO/Pi on Zaurus with KO/Pi on Windows is now very easy. c) Remote file Syncing with the profile kind "Remote file" is performed in three steps: i) download the remote file to your local machine to a temp file ii) sync with this temp file iii) upload the synced file to the remote device The down-/uploading if i) and iii) is done via a command line command. Please specify the download/upload command ( like scp, ftp, ...) and the file name of the temp file in the corresponding fields. d) Mobile device (cell phone) - Note: On the Zaurus you have to install the kammu_xxx_arm.ipk package + Note: On the Zaurus you have to install the phoneaccess_xxx_arm.ipk package to be able to access mobile phones. We mention here only KO/Pi, but the same is valid for KA/Pi. Note: It is only possible to sync a mobile phone with one particular device running KO/Pi. If you want to be able to write data of more than one device to the mobile phone (e.g. from your Zaurus and from your Windows Laptop) do not sync with the mobile phone at all, but use the "Export to phone" functionality from the different devices. Using "Export to phone" makes it not possible to get back data from the phone, if it was changed there, of course. If you sync with the phone, do not use "Export to phone" from any device. (And do not sync, as mentioned above, from any other device with that phone). It would delete the needed information for syncing with that phone! We are using Gammu (Version: 0.98.9) ( http://freshmeat.net/projects/gammu/ ) for accessing the phones. Note: You cannot use the original Gammu for syncing KDE-Pim/Pi, because we have modified the original version to make it useable for syncing! Gammu allows access to many phones in many ways (Irda, Bluetooth, serial,...). The recommended phone access using Gammu with KDE-Pim/Pi is Irda (infrared). Bluetooth access is disabled on the Zaurus, but may work on Windows. Please look at the Gammu homepage and documentation about more details configuring Gammu how to access your phone. If you have problems accessing your phone, start KO/Pi from the konsole and you will get a more detailed output what went wrong. About Gammu from the Gammu homepage: Gammu (formerly known as MyGnokii2) is a cellular manager for various mobile phones/modems. It supports the Nokia 2100, 3100, 32xx, 33xx, 3410, 35xx, 51xx, 5210, 5510, 61xx, 62xx, 63xx, 6510, 6610, 6800, 71xx, 7210, 7250, 7250i, 82xx, 83xx, 8910, 9110, 9210 and compatible and AT devices (Siemens, Alcatel, Falcom, WaveCom, IPAQ, Samsung, SE, and others) over cables/infrared/BlueTooth. Here is an example what to specify to access a Nokia 6310i via infrared: On Linux (Zaurus): I/O device: /dev/ircomm Connection: irda Model: <leave empty> On Windows: I/O device: <ignored - i.e. leave empty> Connection: irda Model: <leave empty> Here is the overview from the Gammu documentation, how to specify the connection settings for I/O device: Connection: Model: Note: The documentation uses the term "port", where we use the term "I/O device". Note: You do not have to create/change the gammurc configuration file. That will do KO/Pi for you. Note: For a known model, leave "Model:" always empty, such that Gammu can auto detect the model. # This is a sample ~/.gammurc file. # In Unix/Linux copy it into your home directory and name it .gammurc # or into /etc and name it gammurc # In Win32 copy it into directory with Gammu.exe and name gammurc # More about parameters later # ----------------------------------------------------------------------------- [gammu] port = com8: #model = 6110 connection = fbusblue #synchronizetime = yes #logfile = gammulog #logformat = textall #use_locking = yes #gammuloc = locfile #startinfo = yes #gammucoding = utf8 [gammu1] port = com8: #model = 6110 connection = fbusblue #synchronizetime = yes #logfile = gammulog #logformat = textall #use_locking = yes #gammuloc = locfile #startinfo = yes #gammucoding = utf8 # ----------------------------------------------------------------------------- # Now info about "Connection" parameter and connected with it port type # (more about port types later) # ----------------------------------------------------------------------------- # "Connection" parameter | Port type | More details # -----------------------|-----------|----------------------------------------- # "fbus" | serial | Nokia FBUS2 # "fbusirda"/"infrared" | serial | Nokia FBUS2 over direct infrared device # "fbusdlr3"/"dlr3" | serial | Nokia FBUS2 with DLR3 cable # "fbusdku5" | dku5 | Nokia FBUS2 with DKU5 cable. WIN32 ONLY # "fbuspl2303" | usb | Nokia FBUS2 with USB cable based on # | | PL2303 chip. # "fbusblue" | serial | Nokia FBUS2 over Bluetooth serial device # "phonetblue" | serial | Nokia PHONET FBUS over Bluetooth serial # | | device # "mrouterblue" | serial | # "mbus" | serial | Nokia MBUS2 # "at19200"/"at115200"/..| serial | AT commands.8 bits, None parity, 1 stop # | | bit, no flow control # -----------------------|-----------|----------------------------------------- # "irdaphonet"/"irda" | irda | Nokia PHONET FBUS over socket infrared # "irdaat" | irda | AT commands with socket infrared # "irdaobex" | irda | OBEX over socket infrared. MODEL "obex" # -----------------------|-----------|----------------------------------------- # "bluephonet" | BT | Nokia PHONET FBUS with Bluetooth stack # "bluefbus"/"dlr3blue" | BT | Nokia FBUS2 with Bluetooth stack # "blueat"/"atblue" | BT | AT commands with Bluetooth stack # "blueobex" | BT | OBEX with Bluetooth. MODEL "obex" # # Now more about port types and connected with it "Port" parameter # ----------------------------------------------------------------------------- # Port type | "Port" parameter in Windows/DOS | "Port" parameter in Linux/Unix # ----------|---------------------------------|-------------------------------- # serial | "com*:" | "/dev/ttyS*" # | (example "com1:") | (example "/dev/ttyS1") # | | or "/dev/tts/**" (with DevFS) # ----------|---------------------------------|-------------------------------- # irda | ignored (can be empty) | "/dev/ircomm*" # ----------|---------------------------------|-------------------------------- # BT | Bluetooth device address # | (example "") # ----------|---------------------------------|-------------------------------- # dku5 | ignored (can be empty) | connection with it not possible # ----------|---------------------------------|-------------------------------- # usb | connection with it not possible | "/dev/ttyUSB*" # # Other config parameters # ----------------------------------------------------------------------------- # Parameter name | Description # ----------------|------------------------------------------------------------ # Model | use only, when Gammu doesn't recognize your phone model. # | Put it here. Example values: "6110", "6150", "6210", "8210" # SynchronizeTime | if you want to set time from computer to phone during # | starting connection. Do not rather use this option when # | when to reset phone during connection (in some phones need # | to set time again after restart) # GammuLoc | name of localisation file # StartInfo | this option allow to set, that you want (setting "yes") # | to see message on the phone screen or phone should enable # | light for a moment during starting connection. Phone # | WON'T beep during starting connection with this option. # GammuCoding | forces using specified codepage (in win32 - for example # | "1250" will force CP1250) or UTF8 (in Linux - "utf8") # ----------------|------------------------------------------------------------ # Logfile | Use, when want to have logfile from communication. # Logformat | What debug info and format should be used: # | "nothing" - no debug level (default) # | "text" - transmission dump in text format # | "textall" - all possible info in text format # | "errors" - errors in text format # | "binary" - transmission dump in binary format # ----------------|------------------------------------------------------------ # Use_Locking | under Unix/Linux use "yes", if want to lock used device # | to prevent using it by other applications. In win32 ignored
\ 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 @@ -3286,1537 +3286,1537 @@ static void SendSaveDisplaySMS(int argc, char *argv[]) } if (mystrncasecmp(argv[i],"-tone10long",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound10Long; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } nextlong = 14; break; } if (mystrncasecmp(argv[i],"-tone12",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } nextlong = 14; break; } if (mystrncasecmp(argv[i],"-tone12long",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSound12Long; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } nextlong = 14; break; } if (mystrncasecmp(argv[i],"-toneSE",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSound; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } nextlong = 14; break; } if (mystrncasecmp(argv[i],"-toneSElong",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSSonyEricssonSoundLong; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } nextlong = 14; break; } if (mystrncasecmp(argv[i],"-fixedbitmap",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSFixedBitmap; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } nextlong = 15; break; } if (mystrncasecmp(argv[i],"-variablebitmap",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmap; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } nextlong = 15; break; } if (mystrncasecmp(argv[i],"-variablebitmaplong",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSVariableBitmapLong; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } nextlong = 15; break; } if (mystrncasecmp(argv[i],"-animation",0)) { SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_EMSAnimation; if (Protected != 0) { SMSInfo.Entries[SMSInfo.EntriesNum].Protected = true; Protected --; } bitmap[SMSInfo.EntriesNum].Number = 0; nextlong = 16; break; } } if (mystrncasecmp(argv[2],"OPERATOR",0)) { if (mystrncasecmp(argv[i],"-netcode",0)) { nextlong = 7; break; } if (mystrncasecmp(argv[i],"-biglogo",0)) { SMSInfo.Entries[0].ID = SMS_NokiaOperatorLogoLong; break; } break; } printmsg("Unknown parameter (\"%s\")\n",argv[i]); exit(-1); break; case 1: /* SMS folder - only during saving SMS */ Folder = atoi(argv[i]); nextlong = 0; break; case 2: /* Sender number - only during saving SMS */ EncodeUnicode(Sender,argv[i],strlen(argv[i])); nextlong = 0; break; case 3: /* SMSC set number */ SMSCSet = atoi(argv[i]); nextlong = 0; break; case 4: /* Number of SMSC */ EncodeUnicode(SMSC,argv[i],strlen(argv[i])); SMSCSet = 0; nextlong = 0; break; case 5: /* Length of text SMS */ if (atoi(argv[i])<chars_read) { Buffer[0][atoi(argv[i])*2] = 0x00; Buffer[0][atoi(argv[i])*2+1] = 0x00; } SMSInfo.Entries[0].ID = SMS_ConcatenatedTextLong; if (mystrncasecmp(argv[i-1],"-autolen",0)) SMSInfo.Entries[0].ID = SMS_ConcatenatedAutoTextLong; nextlong = 0; break; case 6: /* Picture Images - text */ EncodeUnicode(bitmap[0].Bitmap[0].Text,argv[i],strlen(argv[i])); nextlong = 0; break; case 7: /* Operator Logo - network code */ strncpy(bitmap[0].Bitmap[0].NetworkCode,argv[i],7); if (!strcmp(DecodeUnicodeConsole(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)),"unknown")) { printmsg("Unknown GSM network code (\"%s\")\n",argv[i]); exit(-1); } if (mystrncasecmp(argv[1],"--savesms",0)) { EncodeUnicode(Sender, "OpLogo",6); EncodeUnicode(Sender+6*2,bitmap[0].Bitmap[0].NetworkCode,3); EncodeUnicode(Sender+6*2+3*2,bitmap[0].Bitmap[0].NetworkCode+4,2); if (UnicodeLength(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode))<GSM_MAX_SMS_NAME_LENGTH-7) { EncodeUnicode(Name,"OpLogo ",7); CopyUnicodeString(Name+7*2,GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)); } else { CopyUnicodeString(Name,Sender); } } nextlong = 0; break; case 8:/* Reject duplicates ID */ SMSInfo.ReplaceMessage = atoi(argv[i]); if (SMSInfo.ReplaceMessage < 1 || SMSInfo.ReplaceMessage > 7) { printmsg("You have to give number between 1 and 7 (\"%s\")\n",argv[i]); exit(-1); } nextlong = 0; break; case 9:/* Replace file for text SMS */ ReplaceFile = fopen(argv[i], "rb"); if (ReplaceFile == NULL) Print_Error(ERR_CANTOPENFILE); memset(ReplaceBuffer,0,sizeof(ReplaceBuffer)); fread(ReplaceBuffer,1,sizeof(ReplaceBuffer),ReplaceFile); fclose(ReplaceFile); ReadUnicodeFile(ReplaceBuffer2,ReplaceBuffer); for(j=0;j<(int)(UnicodeLength(Buffer[0]));j++) { for (z=0;z<(int)(UnicodeLength(ReplaceBuffer2)/2);z++) { if (ReplaceBuffer2[z*4] == Buffer[0][j] && ReplaceBuffer2[z*4+1] == Buffer[0][j+1]) { Buffer[0][j] = ReplaceBuffer2[z*4+2]; Buffer[0][j+1] = ReplaceBuffer2[z*4+3]; break; } } } nextlong = 0; break; case 10: Validity.Format = SMS_Validity_RelativeFormat; if (mystrncasecmp(argv[i],"HOUR",0)) Validity.Relative = SMS_VALID_1_Hour; else if (mystrncasecmp(argv[i],"6HOURS",0)) Validity.Relative = SMS_VALID_6_Hours; else if (mystrncasecmp(argv[i],"DAY",0)) Validity.Relative = SMS_VALID_1_Day; else if (mystrncasecmp(argv[i],"3DAYS",0)) Validity.Relative = SMS_VALID_3_Days; else if (mystrncasecmp(argv[i],"WEEK",0)) Validity.Relative = SMS_VALID_1_Week; else if (mystrncasecmp(argv[i],"MAX",0)) Validity.Relative = SMS_VALID_Max_Time; else { printmsg("Unknown validity string (\"%s\")\n",argv[i]); exit(-1); } nextlong = 0; break; case 11:/* EMS text from parameter */ EncodeUnicode(Buffer[SMSInfo.EntriesNum],argv[i],strlen(argv[i])); dbgprintf("buffer is \"%s\"\n",DecodeUnicodeConsole(Buffer[SMSInfo.EntriesNum])); SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_ConcatenatedTextLong; SMSInfo.Entries[SMSInfo.EntriesNum].Buffer = Buffer[SMSInfo.EntriesNum]; SMSInfo.EntriesNum++; nextlong = 0; break; case 12:/* EMS predefined sound/animation number */ SMSInfo.Entries[SMSInfo.EntriesNum].Number = atoi(argv[i]); SMSInfo.EntriesNum++; nextlong = 0; break; case 14: /* EMS ringtone - IMelody */ ringtone[SMSInfo.EntriesNum].Format=RING_NOTETONE; error=GSM_ReadRingtoneFile(argv[i],&ringtone[SMSInfo.EntriesNum]); Print_Error(error); SMSInfo.Entries[SMSInfo.EntriesNum].Ringtone = &ringtone[SMSInfo.EntriesNum]; SMSInfo.EntriesNum++; nextlong = 0; break; case 15:/* EMS bitmap file */ bitmap[SMSInfo.EntriesNum].Bitmap[0].Type=GSM_StartupLogo; error=GSM_ReadBitmapFile(argv[i],&bitmap[SMSInfo.EntriesNum]); Print_Error(error); SMSInfo.Entries[SMSInfo.EntriesNum].Bitmap = &bitmap[SMSInfo.EntriesNum]; SMSInfo.EntriesNum++; nextlong = 0; break; case 16:/* Number of frames for EMS animation */ FramesNum = atoi(argv[i]); if (FramesNum < 1 || FramesNum > 4) { printmsg("You have to give number of EMS frames between 1 and 4 (\"%s\")\n",argv[i]); exit(-1); } bitmap[SMSInfo.EntriesNum].Number = 0; nextlong = 17; break; case 17:/*File for EMS animation */ bitmap2.Bitmap[0].Type=GSM_StartupLogo; error=GSM_ReadBitmapFile(argv[i],&bitmap2); for (j=0;j<bitmap2.Number;j++) { if (bitmap[SMSInfo.EntriesNum].Number == FramesNum) break; memcpy(&bitmap[SMSInfo.EntriesNum].Bitmap[bitmap[SMSInfo.EntriesNum].Number],&bitmap2.Bitmap[j],sizeof(GSM_Bitmap)); bitmap[SMSInfo.EntriesNum].Number++; } if (bitmap[SMSInfo.EntriesNum].Number == FramesNum) { SMSInfo.Entries[SMSInfo.EntriesNum].Bitmap = &bitmap[SMSInfo.EntriesNum]; SMSInfo.EntriesNum++; nextlong = 0; } break; case 18:/* EMS text from Unicode file */ f = fopen(argv[i],"rb"); if (f == NULL) { printmsg("Can't open file \"%s\"\n",argv[i]); exit(-1); } z=fread(InputBuffer,1,2000,f); InputBuffer[z] = 0; InputBuffer[z+1] = 0; fclose(f); ReadUnicodeFile(Buffer[SMSInfo.EntriesNum],InputBuffer); dbgprintf("buffer is \"%s\"\n",DecodeUnicodeConsole(Buffer[SMSInfo.EntriesNum])); SMSInfo.Entries[SMSInfo.EntriesNum].ID = SMS_ConcatenatedTextLong; SMSInfo.Entries[SMSInfo.EntriesNum].Buffer = Buffer[SMSInfo.EntriesNum]; SMSInfo.EntriesNum++; nextlong = 0; break; case 19:/* Number of protected items */ Protected = atoi(argv[i]); nextlong = 0; break; case 20:/* Formatting text for EMS */ if (SMSInfo.Entries[SMSInfo.EntriesNum-1].ID == SMS_ConcatenatedTextLong) { for(j=0;j<(int)strlen(argv[i]);j++) { switch(argv[i][j]) { case 'l': case 'L': SMSInfo.Entries[SMSInfo.EntriesNum-1].Left = true; break; case 'c': case 'C': SMSInfo.Entries[SMSInfo.EntriesNum-1].Center = true; break; case 'r': case 'R': SMSInfo.Entries[SMSInfo.EntriesNum-1].Right = true; break; case 'a': case 'A': SMSInfo.Entries[SMSInfo.EntriesNum-1].Large = true; break; case 's': case 'S': SMSInfo.Entries[SMSInfo.EntriesNum-1].Small = true; break; case 'b': case 'B': SMSInfo.Entries[SMSInfo.EntriesNum-1].Bold = true; break; case 'i': case 'I': SMSInfo.Entries[SMSInfo.EntriesNum-1].Italic = true; break; case 'u': case 'U': SMSInfo.Entries[SMSInfo.EntriesNum-1].Underlined = true; break; case 't': case 'T': SMSInfo.Entries[SMSInfo.EntriesNum-1].Strikethrough = true; break; default: printmsg("Unknown parameter \"%c\"\n",argv[i][j]); exit(-1); } } } else { printmsg("Last parameter wasn't text\n"); exit(-1); } nextlong = 0; break; case 21:/*MaxSMS*/ MaxSMS = atoi(argv[i]); nextlong = 0; break; case 22:/* profile name */ EncodeUnicode(Buffer[0],argv[i],strlen(argv[i])); SMSInfo.Entries[0].Buffer = Buffer[0]; nextlong = 0; break; case 23:/* profile ringtone */ ringtone[0].Format = RING_NOTETONE; error=GSM_ReadRingtoneFile(argv[i],&ringtone[0]); Print_Error(error); SMSInfo.Entries[0].Ringtone = &ringtone[0]; nextlong = 0; break; case 24:/* profile bitmap */ bitmap[0].Bitmap[0].Type = GSM_PictureImage; error=GSM_ReadBitmapFile(argv[i],&bitmap[0]); Print_Error(error); bitmap[0].Bitmap[0].Text[0] = 0; bitmap[0].Bitmap[0].Text[1] = 0; SMSInfo.Entries[0].Bitmap = &bitmap[0]; nextlong = 0; break; } } if (nextlong!=0) { printmsg("Parameter missed...\n"); exit(-1); } if (mystrncasecmp(argv[2],"EMS",0) && EMS16Bit) { for (i=0;i<SMSInfo.EntriesNum;i++) { switch (SMSInfo.Entries[i].ID) { case SMS_ConcatenatedTextLong: SMSInfo.Entries[i].ID = SMS_ConcatenatedTextLong16bit; default: break; } } } if (mystrncasecmp(argv[2],"TEXT",0)) { chars_read = UnicodeLength(Buffer[0]); if (chars_read != 0) { /* Trim \n at the end of string */ if (Buffer[0][chars_read*2-1] == '\n' && Buffer[0][chars_read*2-2] == 0) { Buffer[0][chars_read*2-1] = 0; } } } if (mystrncasecmp(argv[1],"--displaysms",0) || mystrncasecmp(argv[1],"--sendsmsdsms",0)) { if (mystrncasecmp(argv[2],"OPERATOR",0)) { if (bitmap[0].Bitmap[0].Type==GSM_OperatorLogo && strcmp(bitmap[0].Bitmap[0].NetworkCode,"000 00")==0) { printmsg("No network code\n"); exit(-1); } } } else { GSM_Init(true); if (mystrncasecmp(argv[2],"OPERATOR",0)) { if (bitmap[0].Bitmap[0].Type==GSM_OperatorLogo && strcmp(bitmap[0].Bitmap[0].NetworkCode,"000 00")==0) { error=Phone->GetNetworkInfo(&s,&NetInfo); Print_Error(error); strcpy(bitmap[0].Bitmap[0].NetworkCode,NetInfo.NetworkCode); if (mystrncasecmp(argv[1],"--savesms",0)) { EncodeUnicode(Sender, "OpLogo",6); EncodeUnicode(Sender+6*2,bitmap[0].Bitmap[0].NetworkCode,3); EncodeUnicode(Sender+6*2+3*2,bitmap[0].Bitmap[0].NetworkCode+4,2); if (UnicodeLength(GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode))<GSM_MAX_SMS_NAME_LENGTH-7) { EncodeUnicode(Name,"OpLogo ",7); CopyUnicodeString(Name+7*2,GSM_GetNetworkName(bitmap[0].Bitmap[0].NetworkCode)); } else { CopyUnicodeString(Name,Sender); } } } } } error=GSM_EncodeMultiPartSMS(&SMSInfo,&sms); Print_Error(error); for (i=0;i<SMSInfo.EntriesNum;i++) { switch (SMSInfo.Entries[i].ID) { case SMS_NokiaRingtone: case SMS_NokiaRingtoneLong: case SMS_NokiaProfileLong: case SMS_EMSSound10: case SMS_EMSSound12: case SMS_EMSSonyEricssonSound: case SMS_EMSSound10Long: case SMS_EMSSound12Long: case SMS_EMSSonyEricssonSoundLong: if (SMSInfo.Entries[i].RingtoneNotes!=SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands) { printmsg("Warning: ringtone too long. %i percent part cut\n", (SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands-SMSInfo.Entries[i].RingtoneNotes)*100/SMSInfo.Entries[i].Ringtone->NoteTone.NrCommands); } default: break; } } if (MaxSMS != -1 && sms.Number > MaxSMS) { printmsg("There is %i SMS packed and %i limit. Exiting\n",sms.Number,MaxSMS); if (!mystrncasecmp(argv[1],"--displaysms",0) && !mystrncasecmp(argv[1],"--sendsmsdsms",0)) GSM_Terminate(); exit(-1); } if (mystrncasecmp(argv[1],"--displaysms",0)) { if (SMSCSet != 0) { printmsg("Use -smscnumber option to give SMSC number\n"); exit(-1); } for (i=0;i<sms.Number;i++) { sms.SMS[i].Location = 0; sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; sms.SMS[i].SMSC.Location = 0; sms.SMS[i].PDU = SMS_Submit; if (DeliveryReport) sms.SMS[i].PDU = SMS_Status_Report; CopyUnicodeString(sms.SMS[i].Number, Sender); CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); DisplaySMSFrame(&sms.SMS[i]); } printmsg("\nNumber of SMS: %i\n",sms.Number); exit(sms.Number); } if (mystrncasecmp(argv[1],"--sendsmsdsms",0)) { if (SMSCSet != 0) { printmsg("Use -smscnumber option to give SMSC number\n"); exit(-1); } for (i=0;i<sms.Number;i++) { sms.SMS[i].Location = 0; sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; sms.SMS[i].SMSC.Location = 0; sms.SMS[i].PDU = SMS_Submit; if (DeliveryReport) sms.SMS[i].PDU = SMS_Status_Report; CopyUnicodeString(sms.SMS[i].Number, Sender); CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); } SMSDaemonSendSMS(argv[4],argv[5],&sms); exit(0); } if (mystrncasecmp(argv[1],"--savesms",0) || SendSaved) { error=Phone->GetSMSFolders(&s, &folders); Print_Error(error); if (SendSaved) { if (Validity.Format != 0 && SMSCSet != 0) { PhoneSMSC.Location = SMSCSet; error=Phone->GetSMSC(&s,&PhoneSMSC); Print_Error(error); CopyUnicodeString(SMSC,PhoneSMSC.Number); SMSCSet = 0; } s.User.SendSMSStatus = SendSMSStatus; signal(SIGINT, interrupt); printmsgerr("If you want break, press Ctrl+C...\n"); } for (i=0;i<sms.Number;i++) { printmsg("Saving SMS %i/%i\n",i+1,sms.Number); // sms.SMS[i].Location = 0; sms.SMS[i].Folder = Folder; sms.SMS[i].State = State; sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; sms.SMS[i].SMSC.Location = SMSCSet; if (SendSaved) { sms.SMS[i].PDU = SMS_Submit; if (DeliveryReport) sms.SMS[i].PDU = SMS_Status_Report; if (Validity.Format != 0) sms.SMS[i].SMSC.Validity = Validity; } else { sms.SMS[i].PDU = SMS_Deliver; } CopyUnicodeString(sms.SMS[i].Number, Sender); CopyUnicodeString(sms.SMS[i].Name, Name); if (SMSCSet==0) CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); error=Phone->AddSMS(&s, &sms.SMS[i]); Print_Error(error); printmsg("Saved in folder \"%s\", location %i\n", DecodeUnicodeConsole(folders.Folder[sms.SMS[i].Folder-1].Name),sms.SMS[i].Location); if (SendSaved) { printmsg("Sending sms from folder \"%s\", location %i\n", DecodeUnicodeString(folders.Folder[sms.SMS[i].Folder-1].Name),sms.SMS[i].Location); SMSStatus = ERR_TIMEOUT; error=Phone->SendSavedSMS(&s, 0, sms.SMS[i].Location); Print_Error(error); printmsg("....waiting for network answer"); while (!gshutdown) { GSM_ReadDevice(&s,true); if (SMSStatus == ERR_UNKNOWN) { GSM_Terminate(); exit(-1); } if (SMSStatus == ERR_NONE) break; } } } } else { if (Validity.Format != 0 && SMSCSet != 0) { PhoneSMSC.Location = SMSCSet; error=Phone->GetSMSC(&s,&PhoneSMSC); Print_Error(error); CopyUnicodeString(SMSC,PhoneSMSC.Number); SMSCSet = 0; } signal(SIGINT, interrupt); printmsgerr("If you want break, press Ctrl+C...\n"); s.User.SendSMSStatus = SendSMSStatus; for (i=0;i<sms.Number;i++) { printmsg("Sending SMS %i/%i",i+1,sms.Number); sms.SMS[i].Location = 0; sms.SMS[i].ReplyViaSameSMSC = ReplyViaSameSMSC; sms.SMS[i].SMSC.Location = SMSCSet; sms.SMS[i].PDU = SMS_Submit; if (DeliveryReport) sms.SMS[i].PDU = SMS_Status_Report; CopyUnicodeString(sms.SMS[i].Number, Sender); if (SMSCSet==0) CopyUnicodeString(sms.SMS[i].SMSC.Number, SMSC); if (Validity.Format != 0) memcpy(&sms.SMS[i].SMSC.Validity,&Validity,sizeof(GSM_SMSValidity)); SMSStatus = ERR_TIMEOUT; error=Phone->SendSMS(&s, &sms.SMS[i]); Print_Error(error); printmsg("....waiting for network answer"); while (!gshutdown) { GSM_ReadDevice(&s,true); if (SMSStatus == ERR_UNKNOWN) { GSM_Terminate(); exit(-1); } if (SMSStatus == ERR_NONE) break; } } } GSM_Terminate(); } #ifdef GSM_ENABLE_BACKUP static void SaveFile(int argc, char *argv[]) { GSM_Backup Backup; int i,j; FILE *file; unsigned char Buffer[10000]; GSM_MemoryEntry *pbk; if (mystrncasecmp(argv[2],"CALENDAR",0)) { if (argc<5) { printmsg("Where is backup filename and location ?\n"); exit(-1); } error=GSM_ReadBackupFile(argv[4],&Backup); if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); i = 0; while (Backup.Calendar[i]!=NULL) { if (i == atoi(argv[5])-1) break; i++; } if (i != atoi(argv[5])-1) { printmsg("Calendar note not found in file\n"); exit(-1); } j = 0; GSM_EncodeVCALENDAR(Buffer, &j, Backup.Calendar[i],true,Nokia_VCalendar); } else if (mystrncasecmp(argv[2],"BOOKMARK",0)) { if (argc<5) { printmsg("Where is backup filename and location ?\n"); exit(-1); } error=GSM_ReadBackupFile(argv[4],&Backup); if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); i = 0; while (Backup.WAPBookmark[i]!=NULL) { if (i == atoi(argv[5])-1) break; i++; } if (i != atoi(argv[5])-1) { printmsg("WAP bookmark not found in file\n"); exit(-1); } j = 0; GSM_EncodeURLFile(Buffer, &j, Backup.WAPBookmark[i]); } else if (mystrncasecmp(argv[2],"NOTE",0)) { if (argc<5) { printmsg("Where is backup filename and location ?\n"); exit(-1); } error=GSM_ReadBackupFile(argv[4],&Backup); if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); i = 0; while (Backup.Note[i]!=NULL) { if (i == atoi(argv[5])-1) break; i++; } if (i != atoi(argv[5])-1) { printmsg("Note not found in file\n"); exit(-1); } j = 0; GSM_EncodeVNTFile(Buffer, &j, Backup.Note[i]); } else if (mystrncasecmp(argv[2],"TODO",0)) { if (argc<5) { printmsg("Where is backup filename and location ?\n"); exit(-1); } error=GSM_ReadBackupFile(argv[4],&Backup); if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); i = 0; while (Backup.ToDo[i]!=NULL) { if (i == atoi(argv[5])-1) break; i++; } if (i != atoi(argv[5])-1) { printmsg("ToDo note not found in file\n"); exit(-1); } j = 0; GSM_EncodeVTODO(Buffer, &j, Backup.ToDo[i], true, Nokia_VToDo); } else if (mystrncasecmp(argv[2],"VCARD10",0) || mystrncasecmp(argv[2],"VCARD21",0)) { if (argc<6) { printmsg("Where is backup filename and location and memory type ?\n"); exit(-1); } error=GSM_ReadBackupFile(argv[4],&Backup); if (error!=ERR_NOTIMPLEMENTED) Print_Error(error); i = 0; if (mystrncasecmp(argv[5],"SM",0)) { while (Backup.SIMPhonebook[i]!=NULL) { if (i == atoi(argv[6])-1) break; i++; } if (i != atoi(argv[6])-1) { printmsg("Phonebook entry not found in file\n"); exit(-1); } pbk = Backup.SIMPhonebook[i]; } else if (mystrncasecmp(argv[5],"ME",0)) { while (Backup.PhonePhonebook[i]!=NULL) { if (i == atoi(argv[6])-1) break; i++; } if (i != atoi(argv[6])-1) { printmsg("Phonebook entry not found in file\n"); exit(-1); } pbk = Backup.PhonePhonebook[i]; } else { printmsg("Unknown memory type: \"%s\"\n",argv[5]); exit(-1); } j = 0; if (mystrncasecmp(argv[2],"VCARD10",0)) { GSM_EncodeVCARD(Buffer,&j,pbk,true,Nokia_VCard10); } else { GSM_EncodeVCARD(Buffer,&j,pbk,true,Nokia_VCard21); } } else { printmsg("What format of file (\"%s\") ?\n",argv[2]); exit(-1); } file = fopen(argv[3],"wb"); fwrite(Buffer,1,j,file); fclose(file); } static void Backup(int argc, char *argv[]) { int i, used; GSM_MemoryStatus MemStatus; GSM_ToDoEntry ToDo; GSM_ToDoStatus ToDoStatus; GSM_MemoryEntry Pbk; GSM_CalendarEntry Calendar; GSM_Bitmap Bitmap; GSM_WAPBookmark Bookmark; GSM_Profile Profile; GSM_MultiWAPSettings Settings; GSM_SyncMLSettings SyncML; GSM_ChatSettings Chat; GSM_Ringtone Ringtone; GSM_SMSC SMSC; GSM_Backup Backup; GSM_NoteEntry Note; GSM_Backup_Info Info; GSM_FMStation FMStation; GSM_GPRSAccessPoint GPRSPoint; bool DoBackup; if (argc == 4 && mystrncasecmp(argv[3],"-yes",0)) always_answer_yes = true; GSM_ClearBackup(&Backup); GSM_GetBackupFormatFeatures(argv[2],&Info); sprintf(Backup.Creator,"Gammu %s",VERSION); if (strlen(GetOS()) != 0) { strcat(Backup.Creator+strlen(Backup.Creator),", "); strcat(Backup.Creator+strlen(Backup.Creator),GetOS()); } if (strlen(GetCompiler()) != 0) { strcat(Backup.Creator+strlen(Backup.Creator),", "); strcat(Backup.Creator+strlen(Backup.Creator),GetCompiler()); } signal(SIGINT, interrupt); printmsgerr("Press Ctrl+C to break...\n"); GSM_Init(true); if (Info.UseUnicode) { Info.UseUnicode=answer_yes("Use Unicode subformat of backup file"); } if (Info.DateTime) { GSM_GetCurrentDateTime (&Backup.DateTime); Backup.DateTimeAvailable=true; } if (Info.Model) { error=Phone->GetManufacturer(&s); Print_Error(error); sprintf(Backup.Model,"%s ",s.Phone.Data.Manufacturer); if (s.Phone.Data.ModelInfo->model[0]!=0) { strcat(Backup.Model,s.Phone.Data.ModelInfo->model); } else { strcat(Backup.Model,s.Phone.Data.Model); } strcat(Backup.Model," "); strcat(Backup.Model,s.Phone.Data.Version); } if (Info.IMEI) { error=Phone->GetIMEI(&s); if (error != ERR_NOTSUPPORTED) { strcpy(Backup.IMEI, s.Phone.Data.IMEI); Print_Error(error); } else { Backup.IMEI[0] = 0; } } printf("\n"); DoBackup = false; if (Info.PhonePhonebook) { printmsg("Checking phone phonebook\n"); MemStatus.MemoryType = MEM_ME; error=Phone->GetMemoryStatus(&s, &MemStatus); if (error==ERR_NONE && MemStatus.MemoryUsed != 0) { - if (answer_yes(" Backup phone phonebook")) DoBackup = true; + /*LRif (answer_yes(" Backup phone phonebook")) */DoBackup = true; } } if (DoBackup) { Pbk.MemoryType = MEM_ME; i = 1; used = 0; while (used != MemStatus.MemoryUsed) { Pbk.Location = i; error=Phone->GetMemory(&s, &Pbk); if (error != ERR_EMPTY) { Print_Error(error); if (used < GSM_BACKUP_MAX_PHONEPHONEBOOK) { Backup.PhonePhonebook[used] = malloc(sizeof(GSM_MemoryEntry)); if (Backup.PhonePhonebook[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.PhonePhonebook[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_PHONEPHONEBOOK"); GSM_Terminate(); exit(-1); } *Backup.PhonePhonebook[used]=Pbk; used++; } printmsgerr("%c Reading: %i percent",13,used*100/MemStatus.MemoryUsed); i++; if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.SIMPhonebook) { printmsg("Checking SIM phonebook\n"); MemStatus.MemoryType = MEM_SM; error=Phone->GetMemoryStatus(&s, &MemStatus); if (error==ERR_NONE && MemStatus.MemoryUsed != 0) { if (answer_yes(" Backup SIM phonebook")) DoBackup=true; } } if (DoBackup) { Pbk.MemoryType = MEM_SM; i = 1; used = 0; while (used != MemStatus.MemoryUsed) { Pbk.Location = i; error=Phone->GetMemory(&s, &Pbk); if (error != ERR_EMPTY) { Print_Error(error); if (used < GSM_BACKUP_MAX_SIMPHONEBOOK) { Backup.SIMPhonebook[used] = malloc(sizeof(GSM_MemoryEntry)); if (Backup.SIMPhonebook[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.SIMPhonebook[used + 1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SIMPHONEBOOK"); GSM_Terminate(); exit(-1); } *Backup.SIMPhonebook[used]=Pbk; used++; } printmsgerr("%c Reading: %i percent",13,used*100/MemStatus.MemoryUsed); i++; if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.Calendar) { printmsg("Checking calendar\n"); error=Phone->GetNextCalendar(&s,&Calendar,true); if (error==ERR_NONE) { if (answer_yes(" Backup calendar notes")) DoBackup = true; } } if (DoBackup) { used = 0; printmsgerr(" Reading : "); while (error == ERR_NONE) { if (used < GSM_MAXCALENDARTODONOTES) { Backup.Calendar[used] = malloc(sizeof(GSM_CalendarEntry)); if (Backup.Calendar[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.Calendar[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_MAXCALENDARTODONOTES"); GSM_Terminate(); exit(-1); } *Backup.Calendar[used]=Calendar; used ++; error=Phone->GetNextCalendar(&s,&Calendar,false); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.ToDo) { printmsg("Checking ToDo\n"); error=Phone->GetToDoStatus(&s,&ToDoStatus); if (error == ERR_NONE && ToDoStatus.Used != 0) { if (answer_yes(" Backup ToDo")) DoBackup = true; } } if (DoBackup) { used = 0; error=Phone->GetNextToDo(&s,&ToDo,true); while (error == ERR_NONE) { if (used < GSM_MAXCALENDARTODONOTES) { Backup.ToDo[used] = malloc(sizeof(GSM_ToDoEntry)); if (Backup.ToDo[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.ToDo[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_MAXCALENDARTODONOTES"); GSM_Terminate(); exit(-1); } *Backup.ToDo[used]=ToDo; used ++; error=Phone->GetNextToDo(&s,&ToDo,false); printmsgerr("%c Reading: %i percent",13,used*100/ToDoStatus.Used); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.Note) { printmsg("Checking notes\n"); error=Phone->GetNextNote(&s,&Note,true); if (error==ERR_NONE) { if (answer_yes(" Backup notes")) DoBackup = true; } } if (DoBackup) { used = 0; printmsgerr(" Reading : "); while (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_NOTE) { Backup.Note[used] = malloc(sizeof(GSM_NoteEntry)); if (Backup.Note[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.Note[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_NOTE"); GSM_Terminate(); exit(-1); } *Backup.Note[used]=Note; used ++; error=Phone->GetNextNote(&s,&Note,false); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.CallerLogos) { printmsg("Checking caller logos\n"); Bitmap.Type = GSM_CallerGroupLogo; Bitmap.Location = 1; error=Phone->GetBitmap(&s,&Bitmap); if (error == ERR_NONE) { if (answer_yes(" Backup caller groups and logos")) DoBackup = true; } } if (DoBackup) { printmsgerr(" Reading : "); error = ERR_NONE; used = 0; while (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_CALLER) { Backup.CallerLogos[used] = malloc(sizeof(GSM_Bitmap)); if (Backup.CallerLogos[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.CallerLogos[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_CALLER"); GSM_Terminate(); exit(-1); } *Backup.CallerLogos[used] = Bitmap; used ++; Bitmap.Location = used + 1; error=Phone->GetBitmap(&s,&Bitmap); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.SMSC) { printmsg("Checking SMS profiles\n"); if (answer_yes(" Backup SMS profiles")) DoBackup = true; } if (DoBackup) { used = 0; printmsgerr(" Reading: "); while (true) { SMSC.Location = used + 1; error = Phone->GetSMSC(&s,&SMSC); if (error != ERR_NONE) break; if (used < GSM_BACKUP_MAX_SMSC) { Backup.SMSC[used] = malloc(sizeof(GSM_SMSC)); if (Backup.SMSC[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.SMSC[used + 1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SMSC"); GSM_Terminate(); exit(-1); } *Backup.SMSC[used]=SMSC; used++; printmsgerr("*"); } printmsgerr("\n"); } DoBackup = false; if (Info.StartupLogo) { printmsg("Checking startup text\n"); Bitmap.Type = GSM_WelcomeNote_Text; error = Phone->GetBitmap(&s,&Bitmap); if (error == ERR_NONE) { if (answer_yes(" Backup startup logo/text")) DoBackup = true; } } if (DoBackup) { Backup.StartupLogo = malloc(sizeof(GSM_Bitmap)); if (Backup.StartupLogo == NULL) Print_Error(ERR_MOREMEMORY); *Backup.StartupLogo = Bitmap; if (Bitmap.Text[0]==0 && Bitmap.Text[1]==0) { Bitmap.Type = GSM_StartupLogo; error = Phone->GetBitmap(&s,&Bitmap); if (error == ERR_NONE) *Backup.StartupLogo = Bitmap; } } DoBackup = false; if (Info.OperatorLogo) { printmsg("Checking operator logo\n"); Bitmap.Type = GSM_OperatorLogo; error=Phone->GetBitmap(&s,&Bitmap); if (error == ERR_NONE) { if (strcmp(Bitmap.NetworkCode,"000 00")!=0) { if (answer_yes(" Backup operator logo")) DoBackup = true; } } } if (DoBackup) { Backup.OperatorLogo = malloc(sizeof(GSM_Bitmap)); if (Backup.OperatorLogo == NULL) Print_Error(ERR_MOREMEMORY); *Backup.OperatorLogo = Bitmap; } DoBackup = false; if (Info.WAPBookmark) { printmsg("Checking WAP bookmarks\n"); Bookmark.Location = 1; error=Phone->GetWAPBookmark(&s,&Bookmark); if (error==ERR_NONE) { if (answer_yes(" Backup WAP bookmarks")) DoBackup = true; } } if (DoBackup) { used = 0; printmsgerr(" Reading : "); while (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_WAPBOOKMARK) { Backup.WAPBookmark[used] = malloc(sizeof(GSM_WAPBookmark)); if (Backup.WAPBookmark[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.WAPBookmark[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_WAPBOOKMARK"); GSM_Terminate(); exit(-1); } *Backup.WAPBookmark[used]=Bookmark; used ++; Bookmark.Location = used+1; error=Phone->GetWAPBookmark(&s,&Bookmark); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.WAPSettings) { printmsg("Checking WAP settings\n"); Settings.Location = 1; error=Phone->GetWAPSettings(&s,&Settings); if (error==ERR_NONE) { if (answer_yes(" Backup WAP settings")) DoBackup = true; } } if (DoBackup) { used = 0; printmsgerr(" Reading : "); while (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_WAPSETTINGS) { Backup.WAPSettings[used] = malloc(sizeof(GSM_MultiWAPSettings)); if (Backup.WAPSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.WAPSettings[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_WAPSETTINGS"); GSM_Terminate(); exit(-1); } *Backup.WAPSettings[used]=Settings; used ++; Settings.Location = used+1; error=Phone->GetWAPSettings(&s,&Settings); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.MMSSettings) { printmsg("Checking MMS settings\n"); Settings.Location = 1; error=Phone->GetMMSSettings(&s,&Settings); if (error==ERR_NONE) { if (answer_yes(" Backup MMS settings")) DoBackup = true; } } if (DoBackup) { used = 0; printmsgerr(" Reading : "); while (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_MMSSETTINGS) { Backup.MMSSettings[used] = malloc(sizeof(GSM_MultiWAPSettings)); if (Backup.MMSSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.MMSSettings[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_MMSSETTINGS"); GSM_Terminate(); exit(-1); } *Backup.MMSSettings[used]=Settings; used ++; Settings.Location = used+1; error=Phone->GetMMSSettings(&s,&Settings); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.ChatSettings) { printmsg("Checking Chat settings\n"); Chat.Location = 1; error=Phone->GetChatSettings(&s,&Chat); if (error==ERR_NONE) { if (answer_yes(" Backup Chat settings")) DoBackup = true; } } if (DoBackup) { used = 0; printmsgerr(" Reading : "); while (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_CHATSETTINGS) { Backup.ChatSettings[used] = malloc(sizeof(GSM_ChatSettings)); if (Backup.ChatSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.ChatSettings[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_CHATSETTINGS"); GSM_Terminate(); exit(-1); } *Backup.ChatSettings[used]=Chat; used ++; Chat.Location = used+1; error=Phone->GetChatSettings(&s,&Chat); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.SyncMLSettings) { printmsg("Checking SyncML settings\n"); SyncML.Location = 1; error=Phone->GetSyncMLSettings(&s,&SyncML); if (error==ERR_NONE) { if (answer_yes(" Backup SyncML settings")) DoBackup = true; } } if (DoBackup) { used = 0; printmsgerr(" Reading : "); while (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_SYNCMLSETTINGS) { Backup.SyncMLSettings[used] = malloc(sizeof(GSM_SyncMLSettings)); if (Backup.SyncMLSettings[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.SyncMLSettings[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_SYNCMLSETTINGS"); GSM_Terminate(); exit(-1); } *Backup.SyncMLSettings[used]=SyncML; used ++; SyncML.Location = used+1; error=Phone->GetSyncMLSettings(&s,&SyncML); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.Ringtone) { printmsg("Checking user ringtones\n"); Ringtone.Location = 1; Ringtone.Format = 0; error=Phone->GetRingtone(&s,&Ringtone,false); if (error==ERR_EMPTY || error == ERR_NONE) { if (answer_yes(" Backup user ringtones")) DoBackup = true; } } if (DoBackup) { used = 0; i = 1; printmsgerr(" Reading : "); while (error == ERR_NONE || error == ERR_EMPTY) { if (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_RINGTONES) { Backup.Ringtone[used] = malloc(sizeof(GSM_Ringtone)); if (Backup.Ringtone[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.Ringtone[used+1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_RINGTONES"); GSM_Terminate(); exit(-1); } *Backup.Ringtone[used]=Ringtone; used ++; } i++; Ringtone.Location = i; Ringtone.Format = 0; error=Phone->GetRingtone(&s,&Ringtone,false); printmsgerr("*"); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoBackup = false; if (Info.Profiles) { printmsg("Checking phone profiles\n"); Profile.Location = 1; error = Phone->GetProfile(&s,&Profile); if (error == ERR_NONE) { if (answer_yes(" Backup phone profiles")) DoBackup = true; } } if (DoBackup) { used = 0; printmsgerr(" Reading: "); while (true) { Profile.Location = used + 1; error = Phone->GetProfile(&s,&Profile); if (error != ERR_NONE) break; if (used < GSM_BACKUP_MAX_PROFILES) { Backup.Profiles[used] = malloc(sizeof(GSM_Profile)); if (Backup.Profiles[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.Profiles[used + 1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_PROFILES"); GSM_Terminate(); exit(-1); } *Backup.Profiles[used]=Profile; used++; printmsgerr("*"); } printmsgerr("\n"); } DoBackup = false; if (Info.FMStation) { printmsg("Checking FM stations\n"); FMStation.Location = 1; error = Phone->GetFMStation(&s,&FMStation); if (error == ERR_NONE || error == ERR_EMPTY) { if (answer_yes(" Backup phone FM stations")) DoBackup=true; } } if (DoBackup) { used = 0; i = 1; printmsgerr(" Reading: "); while (error == ERR_NONE || error == ERR_EMPTY) { error = Phone->GetFMStation(&s,&FMStation); if (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_FMSTATIONS) { Backup.FMStation[used] = malloc(sizeof(GSM_FMStation)); if (Backup.FMStation[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.FMStation[used + 1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_FMSTATIONS"); GSM_Terminate(); exit(-1); } *Backup.FMStation[used]=FMStation; used++; } i++; FMStation.Location = i; printmsgerr("*"); } printmsgerr("\n"); } DoBackup = false; if (Info.GPRSPoint) { printmsg("Checking GPRS access points\n"); GPRSPoint.Location = 1; error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint); if (error == ERR_NONE || error == ERR_EMPTY) { if (answer_yes(" Backup GPRS access points")) DoBackup = true; } } if (DoBackup) { used = 0; i = 1; printmsgerr(" Reading: "); while (error == ERR_NONE || error == ERR_EMPTY) { error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint); if (error == ERR_NONE) { if (used < GSM_BACKUP_MAX_GPRSPOINT) { Backup.GPRSPoint[used] = malloc(sizeof(GSM_GPRSAccessPoint)); if (Backup.GPRSPoint[used] == NULL) Print_Error(ERR_MOREMEMORY); Backup.GPRSPoint[used + 1] = NULL; } else { printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_GPRSPOINT"); GSM_Terminate(); exit(-1); } *Backup.GPRSPoint[used]=GPRSPoint; used++; } i++; GPRSPoint.Location = i; printmsgerr("*"); } printmsgerr("\n"); } GSM_Terminate(); GSM_SaveBackupFile(argv[2],&Backup, Info.UseUnicode); GSM_FreeBackup(&Backup); } static void Restore(int argc, char *argv[]) { GSM_Backup Backup; GSM_FMStation FMStation; GSM_DateTime date_time; GSM_CalendarEntry Calendar; GSM_Bitmap Bitmap; GSM_Ringtone Ringtone; GSM_MemoryEntry Pbk; GSM_MemoryStatus MemStatus; GSM_ToDoEntry ToDo; GSM_ToDoStatus ToDoStatus; GSM_Profile Profile; GSM_MultiWAPSettings Settings; GSM_GPRSAccessPoint GPRSPoint; GSM_WAPBookmark Bookmark; int i, used, max = 0; bool Past = true; bool Found, DoRestore; error=GSM_ReadBackupFile(argv[2],&Backup); if (error!=ERR_NOTIMPLEMENTED) { Print_Error(error); } else { 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"); } signal(SIGINT, interrupt); printmsgerr("Press Ctrl+C to break...\n"); if (Backup.DateTimeAvailable) printmsgerr("Time of backup : %s\n",OSDateTime(Backup.DateTime,false)); if (Backup.Model[0]!=0) printmsgerr("Phone : %s\n",Backup.Model); if (Backup.IMEI[0]!=0) printmsgerr("IMEI : %s\n",Backup.IMEI); if (Backup.Creator[0]!=0) printmsgerr("File created by : %s\n",Backup.Creator); if (Backup.MD5Calculated[0]!=0) { dbgprintf("\"%s\"\n",Backup.MD5Original); dbgprintf("\"%s\"\n",Backup.MD5Calculated); if (strcmp(Backup.MD5Original,Backup.MD5Calculated)) { if (!answer_yes("Checksum in backup file do not match. Continue")) return; } } GSM_Init(true); DoRestore = false; if (Backup.PhonePhonebook[0] != NULL) { MemStatus.MemoryType = MEM_ME; error=Phone->GetMemoryStatus(&s, &MemStatus); if (error==ERR_NONE) { max = 0; while (Backup.PhonePhonebook[max]!=NULL) max++; printmsgerr("%i entries in backup file\n",max); if (answer_yes("Restore phone phonebook")) DoRestore = true; } } if (DoRestore) { used = 0; for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { Pbk.MemoryType = MEM_ME; Pbk.Location = i + 1; Pbk.EntriesNum = 0; if (used<max) { if (Backup.PhonePhonebook[used]->Location == Pbk.Location) { Pbk = *Backup.PhonePhonebook[used]; used++; dbgprintf("Location %i\n",Pbk.Location); if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk); } } if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk); Print_Error(error); printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoRestore = false; if (Backup.SIMPhonebook[0] != NULL) { MemStatus.MemoryType = MEM_SM; error=Phone->GetMemoryStatus(&s, &MemStatus); if (error==ERR_NONE) { max = 0; while (Backup.SIMPhonebook[max]!=NULL) max++; printmsgerr("%i entries in backup file\n",max); if (answer_yes("Restore SIM phonebook")) DoRestore = true; } } if (DoRestore) { used = 0; for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) { Pbk.MemoryType = MEM_SM; Pbk.Location = i + 1; Pbk.EntriesNum = 0; if (used<max) { if (Backup.SIMPhonebook[used]->Location == Pbk.Location) { Pbk = *Backup.SIMPhonebook[used]; used++; dbgprintf("Location %i\n",Pbk.Location); if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk); } } if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk); Print_Error(error); printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree)); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } DoRestore = false; if (Backup.CallerLogos[0] != NULL) { Bitmap.Type = GSM_CallerGroupLogo; Bitmap.Location = 1; error=Phone->GetBitmap(&s,&Bitmap); if (error == ERR_NONE) { if (answer_yes("Restore caller groups and logos")) DoRestore = true; } } if (DoRestore) { max = 0; while (Backup.CallerLogos[max]!=NULL) max++; for (i=0;i<max;i++) { error=Phone->SetBitmap(&s,Backup.CallerLogos[i]); Print_Error(error); printmsgerr("%cWriting: %i percent",13,(i+1)*100/max); if (gshutdown) { GSM_Terminate(); exit(0); } } printmsgerr("\n"); } if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) { 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)")*/) { GSM_GetCurrentDateTime(&date_time); error=Phone->SetDateTime(&s, &date_time); Print_Error(error); } } DoRestore = false; if (Backup.Calendar[0] != NULL) { /* N6110 doesn't support getting calendar status */ error = Phone->GetNextCalendar(&s,&Calendar,true); if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { max = 0; while (Backup.Calendar[max] != NULL) max++; printmsgerr("%i entries in backup file\n",max); // LR //if (answer_yes("Restore calendar notes")) { //Past = answer_yes("Restore notes from the past"); DoRestore = true; //} } } if (DoRestore) { printmsgerr("Deleting old notes: "); error = Phone->DeleteAllCalendar(&s); if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { while (1) { error = Phone->GetNextCalendar(&s,&Calendar,true); if (error != ERR_NONE) break; error = Phone->DeleteCalendar(&s,&Calendar); Print_Error(error); printmsgerr("*"); } printmsgerr("\n"); } else { printmsgerr("Done\n"); Print_Error(error); } for (i=0;i<max;i++) { if (!Past && IsCalendarNoteFromThePast(Backup.Calendar[i])) continue; Calendar = *Backup.Calendar[i]; error=Phone->AddCalendar(&s,&Calendar); Print_Error(error); diff --git a/kammu.control b/phoneaccess.control index 07559e7..07559e7 100644 --- a/kammu.control +++ b/phoneaccess.control |