From: short <> Date: Mon, 25 Feb 2002 14:00:47 +0000 (+0000) Subject: Further updates after 5110 testing X-Git-Tag: uc_works1~37 X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=commitdiff_plain;h=75fee3944a3fa77dae48012152a9d70f2145f148 Further updates after 5110 testing --- diff --git a/common/Makefile b/common/Makefile index 570b19a..bffab22 100644 --- a/common/Makefile +++ b/common/Makefile @@ -29,16 +29,16 @@ DIRS = protocol \ # newmodules/n7110.o # newmodules/sniff/sniff.o \ # newmodules/newat.o \ +# gsm-phonebook.o \ +# gsm-coding.o \ +# gsm-sms.o \ +# gsm-networks.o \ OBJS = devices/device.o \ data/rlp-common.o \ data/rlp-crc24.o \ gsm-datetime.o \ gsm-api.o \ - gsm-sms.o \ - gsm-coding.o \ - gsm-phonebook.o \ - gsm-networks.o \ files/cfgreader.o \ misc.o \ protocol/fbus.o \ diff --git a/common/gsm-api.c b/common/gsm-api.c index 4546e14..0765c22 100644 --- a/common/gsm-api.c +++ b/common/gsm-api.c @@ -87,10 +87,8 @@ GSM_Protocol *Protocol; GSM_PhonebookEntry *CurrentPhonebookEntry; GSM_Error CurrentPhonebookError; -#ifndef UCLINUX GSM_SpeedDial *CurrentSpeedDialEntry; GSM_Error CurrentSpeedDialError; -#endif /* UCLINUX */ unsigned char Current_IMEI[GSM_MAX_IMEI_LENGTH]; unsigned char Current_Revision[GSM_MAX_REVISION_LENGTH]; diff --git a/common/gsm-networks.c b/common/gsm-networks.c index f0379f5..97ebb1c 100644 --- a/common/gsm-networks.c +++ b/common/gsm-networks.c @@ -18,8 +18,6 @@ #include "gsm-networks.h" #include "gsm-coding.h" -#ifndef UCLINUX - static GSM_Country GSM_Countries[] = { { "202", "Greece" }, @@ -484,5 +482,3 @@ void DecodeNetworkCode(unsigned char* buffer, unsigned char* output) output[4]=output[3]; output[3]=' '; } - -#endif /* UCLINUX */ diff --git a/common/newmodules/n6110.c b/common/newmodules/n6110.c index 481c92e..12d572a 100644 --- a/common/newmodules/n6110.c +++ b/common/newmodules/n6110.c @@ -54,13 +54,8 @@ GSM_Functions N6110_Functions = { NULL_KeepAlive, N6110_GetMemoryLocation, N6110_WritePhonebookLocation, -#ifndef UCLINUX N6110_GetSpeedDial, N6110_SetSpeedDial, -#else /* UCLINUX */ - NULL, - NULL, -#endif /* UCLINUX */ N6110_GetMemoryStatus, #ifndef UCLINUX N6110_GetSMSStatus, @@ -87,9 +82,16 @@ GSM_Functions N6110_Functions = { N6110_EnterSecurityCode, N6110_GetSecurityCodeStatus, N6110_GetSecurityCode, +#else /* UCLINUX */ + NULL, + NULL, + NULL, + NULL, +#endif /* UCLINUX */ N6110_GetIMEI, N6110_GetRevision, N6110_GetModel, +#ifndef UCLINUX N6110_GetDateTime, N6110_SetDateTime, N6110_GetAlarm, @@ -101,13 +103,6 @@ GSM_Functions N6110_Functions = { NULL, NULL, NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, #endif /* UCLINUX */ N6110_DialData, #ifndef UCLINUX @@ -3108,6 +3103,8 @@ GSM_Error N6110_GetSMSFolders ( GSM_SMSFolders *folders) return GE_NONE; } +#endif /* UCLINUX */ + GSM_Error N6110_GetIMEI(char *imei) { if (strlen(Current_IMEI)>0) { @@ -3129,8 +3126,6 @@ GSM_Error N6110_GetRevision(char *revision) return (GE_TRYAGAIN); } -#endif /* UCLINUX */ - static GSM_Error N6110_GetModel(char *model) { if (strlen(Current_Model)>0) { @@ -3268,8 +3263,13 @@ static void N6110_ReplyGetMemoryLocation(u16 MessageLength, u8 *MessageBuffer, u sleep(1); if (GetModelFeature (FN_PHONEBOOK)==F_PBK33) {//pbk with Unicode +#ifndef UCLINUX DecodeUnicode (CurrentPhonebookEntry->Name, MessageBuffer+6, count/2); CurrentPhonebookEntry->Name[count/2] = 0x00; +#else /* UCLINUX */ + fprintf(stderr,"FATAL ERROR: DecodeUnicode disabled!\n"); + exit(1); +#endif /* UCLINUX */ } else { memcpy(CurrentPhonebookEntry->Name, MessageBuffer + 6, count); CurrentPhonebookEntry->Name[count] = 0x00; @@ -3437,6 +3437,7 @@ GSM_Error N6110_WritePhonebookLocation(GSM_PhonebookEntry *entry) current=7; if (GetModelFeature (FN_PHONEBOOK)==F_PBK33) { +#ifndef UCLINUX req[6] = strlen(entry->Name)*2; @@ -3450,6 +3451,13 @@ GSM_Error N6110_WritePhonebookLocation(GSM_PhonebookEntry *entry) } current+=strlen(entry->Name)*2; + +#else /* UCLINUX */ + + fprintf(stderr,"FATAL ERROR: EncodeUnicode disabled!\n"); + exit(1); + +#endif /* UCLINUX */ } else { req[6] = strlen(entry->Name); @@ -3546,7 +3554,9 @@ GSM_Error N6110_SendDTMF(char *String) (20, &CurrentSendDTMFError, 5+length, 0x01, req); } -void N6110_ReplyGetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { +#endif /* UCLINUX */ + +static void N6110_ReplyGetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { switch (MessageBuffer[3]) { @@ -3596,7 +3606,7 @@ GSM_Error N6110_GetSpeedDial(GSM_SpeedDial *entry) (20, &CurrentSpeedDialError, 5, 0x03, req); } -void N6110_ReplySetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { +static void N6110_ReplySetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { switch (MessageBuffer[3]) { @@ -3642,6 +3652,8 @@ GSM_Error N6110_SetSpeedDial(GSM_SpeedDial *entry) (20, &CurrentSpeedDialError, 7, 0x03, req); } +#ifndef UCLINUX + /* This function finds parts of SMS in frame used in new Nokia phones in internal protocols (they're coded according to GSM 03.40), copies them to GSM_ETSISMSMessage and calls GSM_DecodeETSISMS to decode @@ -5584,11 +5596,11 @@ void N6110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) case 0x06:N6110_ReplyWritePhonebookLocation(MessageLength,MessageBuffer,MessageType);break; case 0x08: case 0x09:N6110_ReplyGetMemoryStatus(MessageLength,MessageBuffer,MessageType);break; -#ifndef UCLINUX case 0x17: case 0x18:N6110_ReplyGetSpeedDial(MessageLength,MessageBuffer,MessageType);break; case 0x1a: case 0x1b:N6110_ReplySetSpeedDial(MessageLength,MessageBuffer,MessageType);break; +#ifndef UCLINUX default :N6110_Dispatch0x03Message(MessageLength,MessageBuffer,MessageType);break; #endif /* UCLINUX */ } diff --git a/gnokii/gnokii.c b/gnokii/gnokii.c index 82b2b8b..d9030f7 100644 --- a/gnokii/gnokii.c +++ b/gnokii/gnokii.c @@ -97,9 +97,9 @@ char *SynchronizeTime; /* If we set date and time from computer to phone (from . #endif /* UCLINUX */ static char *BinDir; /* Binaries directory from .gnokiirc file - not used here yet */ -#ifdef DEBUG +#ifndef UCLINUX static GSM_SMSMessage SMS[4]; -#endif +#endif /* UCLINUX */ #ifndef UCLINUX @@ -560,8 +560,6 @@ int GSM_SendMultiPartSMSOnConsole(GSM_MultiSMSMessage *MultiSMS, int argnum, int return 0; } -#endif /* UCLINUX */ - static int GSM_SaveMultiPartSMSOnConsole(GSM_MultiSMSMessage *MultiSMS, int argnum, int argc, char *argv[], bool inter, bool unicode, bool profile, bool scale) { @@ -688,8 +686,6 @@ static int GSM_SaveMultiPartSMSOnConsole(GSM_MultiSMSMessage *MultiSMS, int argn return 0; } -#ifndef UCLINUX - void GSM_PlayRingtoneOnConsole(GSM_Ringtone *ringtone) { int i; @@ -737,8 +733,17 @@ static int usage(void) )); #endif /* UCLINUX */ +#ifndef UCLINUX fprintf(stdout, _( " gnokii --getmemory memory_type [start [end]] [-short|-v30|-v21|-v]\n" + )); +#else /* UCLINUX */ + fprintf(stdout, _( +" gnokii --getmemory memory_type [start [end]] [-short]\n" + )); +#endif /* UCLINUX */ + + fprintf(stdout, _( " gnokii --writephonebook [-i]\n" )); @@ -747,17 +752,9 @@ static int usage(void) " gnokii --sendphonebookentry destination memory_type location\n" " [--smsc message_center_number] [--smscno message_center_index]\n" " [-s] [-v n] [-d]\n" - )); -#endif /* UCLINUX */ - - fprintf(stdout, _( " gnokii --savephonebookentry memory_type location\n" " [--smsc message_center_number] [--smscno message_center_index]\n" " [-r] [-i] [-s] [-a] [--name name]\n" - )); - -#ifndef UCLINUX - fprintf(stdout, _( " gnokii --getvoicemailbox\n" )); #endif /* UCLINUX */ @@ -1085,9 +1082,7 @@ int main(int argc, char *argv[]) { "sendcalendarnote", required_argument, NULL, OPT_SENDCALENDARNOTE }, { "savecalendarnote", required_argument, NULL, OPT_SAVECALENDARNOTE }, { "sendphonebookentry", required_argument, NULL, OPT_SENDPHONEBOOKENTRY}, -#endif /* UCLINUX */ { "savephonebookentry", required_argument, NULL, OPT_SAVEPHONEBOOKENTRY}, -#ifndef UCLINUX { "deletecalendarnote", required_argument, NULL, OPT_DELCALENDARNOTE },// Delete calendar note mode #endif /* UCLINUX */ { "getmemory", required_argument, NULL, OPT_GETMEMORY },// Get memory mode @@ -1346,9 +1341,7 @@ int main(int argc, char *argv[]) case OPT_DELCALENDARNOTE: rc = deletecalendarnote(optarg);break; case OPT_SAVECALENDARNOTE: rc = savecalendarnote(nargc, nargv);break; case OPT_SENDCALENDARNOTE: rc = sendcalendarnote(nargc, nargv);break; -#endif /* UCLINUX */ case OPT_SAVEPHONEBOOKENTRY: rc = savephonebookentry(nargc, nargv);break; -#ifndef UCLINUX case OPT_SENDPHONEBOOKENTRY: rc = sendphonebookentry(nargc, nargv);break; case OPT_WRITECALENDARNOTE: rc = writecalendarnote(nargv); break; #endif /* UCLINUX */ @@ -4726,6 +4719,7 @@ static int getmemory(int argc, char *argv[]) i_used++; else if (do_all) break; +#ifndef UCLINUX if (output_opt && !strcmp( output_opt,"-v30")) { semicolon_pipe_substitution( &entry, 0 ); fprintf(stdout,_("%s"),GSM_GetVCARD(&entry,30)); @@ -4741,6 +4735,7 @@ static int getmemory(int argc, char *argv[]) fprintf(stdout,_("%s"),GSM_GetVCARD(&entry,10)); formatdone=true; } +#endif /* UCLINUX */ if (output_opt && !strcmp(output_opt,"-short")) { semicolon_pipe_substitution( &entry, 0 ); fprintf(stdout, "%s;%s;%s;%d;%d;", entry.Name, entry.Number, memory_type_string, entry.Location, entry.Group); @@ -8859,9 +8854,7 @@ int divert(int argc, char *argv[]) return 0; } -#endif /* UCLINUX */ - -static int savephonebookentry(int argc, char *argv[]) +int savephonebookentry(int argc, char *argv[]) { GSM_MultiSMSMessage MultiSMS; GSM_PhonebookEntry entry; @@ -8909,8 +8902,6 @@ static int savephonebookentry(int argc, char *argv[]) return 0; } -#ifndef UCLINUX - int sendphonebookentry(int argc, char *argv[]) { GSM_MultiSMSMessage MultiSMS; diff --git a/gnokii/gnokii.h b/gnokii/gnokii.h index 2c0e921..aa12300 100644 --- a/gnokii/gnokii.h +++ b/gnokii/gnokii.h @@ -109,9 +109,7 @@ int sendcalendarnote(int argc, char *argv[]); int receivesms(int argc, char *argv[]); int getsmsstatus(int argc, char *argv[]); int divert(int argc, char *argv[]); -#endif /* UCLINUX */ -static int savephonebookentry(int argc, char *argv[]); -#ifndef UCLINUX +int savephonebookentry(int argc, char *argv[]); int sendphonebookentry(int argc, char *argv[]); #endif /* UCLINUX */ diff --git a/include/gsm-api.h b/include/gsm-api.h index 10cb4b0..7efcfa0 100644 --- a/include/gsm-api.h +++ b/include/gsm-api.h @@ -295,10 +295,8 @@ extern GSM_Protocol *Protocol; extern GSM_PhonebookEntry *CurrentPhonebookEntry; extern GSM_Error CurrentPhonebookError; -#ifndef UCLINUX extern GSM_SpeedDial *CurrentSpeedDialEntry; extern GSM_Error CurrentSpeedDialError; -#endif /* UCLINUX */ extern unsigned char Current_IMEI[GSM_MAX_IMEI_LENGTH]; extern unsigned char Current_Revision[GSM_MAX_REVISION_LENGTH]; diff --git a/include/newmodules/n6110.h b/include/newmodules/n6110.h index cbce246..1557e37 100644 --- a/include/newmodules/n6110.h +++ b/include/newmodules/n6110.h @@ -72,10 +72,8 @@ static GSM_Error N6110_SetOperatorName ( GSM_Network *operator); static GSM_Error N6110_GetMemoryLocation(GSM_PhonebookEntry *entry); static GSM_Error N6110_WritePhonebookLocation(GSM_PhonebookEntry *entry); -#ifndef UCLINUX static GSM_Error N6110_GetSpeedDial(GSM_SpeedDial *entry); static GSM_Error N6110_SetSpeedDial(GSM_SpeedDial *entry); -#endif /* UCLINUX */ static GSM_Error N6110_GetMemoryStatus(GSM_MemoryStatus *Status); #ifndef UCLINUX @@ -100,11 +98,11 @@ static GSM_Error N6110_GetSecurityCode(GSM_SecurityCode *SecurityCode); static GSM_Error N6110_GetSMSCenter(GSM_MessageCenter *MessageCenter); static GSM_Error N6110_SetSMSCenter(GSM_MessageCenter *MessageCenter); +#endif /* UCLINUX */ static GSM_Error N6110_GetIMEI(char *imei); static GSM_Error N6110_GetRevision(char *revision); static GSM_Error N6110_GetModel(char *model); -#endif /* UCLINUX */ static GSM_Error N6110_GetManufacturer(char *manufacturer); #ifndef UCLINUX