From: short <> Date: Thu, 28 Feb 2002 02:31:31 +0000 (+0000) Subject: http://marcin-wiacek.fkn.pl/english/zips/mygnokii.tar.gz X-Git-Tag: marked_working~4 X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=commitdiff_plain;h=f27649b20525793d0880d0df34205548f71ed7f8 marcin-wiacek.fkn.pl/english/zips/mygnokii.tar.gz md5sum: 0e70972231995d215d6bc31736051b86 length: 1098766 --- diff --git a/Docs/CREDITS b/Docs/CREDITS index 7193775..8232bd3 100644 --- a/Docs/CREDITS +++ b/Docs/CREDITS @@ -89,7 +89,7 @@ Thank you to, in no particular order... * Balazs Nagy for frames list and long hacker's work... -* Ladislav Michl & Manfred Jonsson for support for various AT phones... +* Ladislav Michl & Manfred Jonsson for support for various AT phones... * Manfred Jonsson for idea of programming, which looks for me good diff --git a/VERSION b/VERSION index 4735d92..3a1e380 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.3_pre8-gold_2002_02_16 +0.3.3_pre8-gold_2002_02_24 diff --git a/common/gsm-api.c b/common/gsm-api.c index 99b73d7..5a91da9 100644 --- a/common/gsm-api.c +++ b/common/gsm-api.c @@ -327,6 +327,7 @@ GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_Connec CurrentRLP_RXCallback = rlp_callback; CurrentCallPassup=NULL; + CurrentCallDivert=NULL; CurrentPhonebookEntry=NULL; CurrentNetworkInfo = NULL; CurrentGetBitmap=NULL; @@ -337,6 +338,7 @@ GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_Connec CurrentRequestTerminate=false; CurrentDisableKeepAlive=false; CurrentCalendarNotesInfo.HowMany=2000; + CurrentSMSMessage=NULL; CurrentMagicError = GE_BUSY; if (!strcmp(model,"auto")) { @@ -408,39 +410,14 @@ GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_Connec usleep(50); } else { -#ifdef DEBUG - if (CheckModel (Nsniff_Information, model, connection)) { - /* Set pointers to relevant addresses */ - GSM = &Nsniff_Functions; - GSM_Info = &Nsniff_Information; - GSM_LinkOK = &CurrentLinkOK; - found_match=true; - } -#endif - - if (CheckModel (N6110_Information, model, connection)) { - /* Set pointers to relevant addresses */ + if (!strcmp(model,"modelauto")) { + /* For now */ GSM = &N6110_Functions; GSM_Info = &N6110_Information; GSM_LinkOK = &CurrentLinkOK; - found_match=true; - } - if (CheckModel (N7110_Information, model, connection)) { - /* Set pointers to relevant addresses */ - GSM = &N7110_Functions; - GSM_Info = &N7110_Information; - GSM_LinkOK = &CurrentLinkOK; - found_match=true; - } - if (CheckModel (Nat_Information, model, connection)) { - /* Set pointers to relevant addresses */ - GSM = &Nat_Functions; - GSM_Info = &Nat_Information; - GSM_LinkOK = &CurrentLinkOK; - found_match=true; - } - - if (found_match) { +#ifdef DEBUG + fprintf(stdout,_("Trying to find connected model...\n")); +#endif switch (connection) { case GCT_FBUS : Protocol = &FBUS_Functions; break; case GCT_Infrared: Protocol = &FBUS_Functions; break; @@ -451,8 +428,66 @@ GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_Connec case GCT_AT : Protocol = &AT_Functions; break; case GCT_Default : Protocol = NULL; break; } - } else - return GE_NOTSUPPORTED; + CurrentConnectionType=connection; + connection2=connection; + if (TryNewNokia(model,device,initlength,CurrentConnectionType,rlp_callback)==GE_NONE) + { + found_match=true; + } else { + GSM->Terminate(); + } + + if (!found_match) return GE_NOTSUPPORTED; + + usleep(50); + + } else { +#ifdef DEBUG + if (CheckModel (Nsniff_Information, model, connection)) { + /* Set pointers to relevant addresses */ + GSM = &Nsniff_Functions; + GSM_Info = &Nsniff_Information; + GSM_LinkOK = &CurrentLinkOK; + found_match=true; + } +#endif + + if (CheckModel (N6110_Information, model, connection)) { + /* Set pointers to relevant addresses */ + GSM = &N6110_Functions; + GSM_Info = &N6110_Information; + GSM_LinkOK = &CurrentLinkOK; + found_match=true; + } + if (CheckModel (N7110_Information, model, connection)) { + /* Set pointers to relevant addresses */ + GSM = &N7110_Functions; + GSM_Info = &N7110_Information; + GSM_LinkOK = &CurrentLinkOK; + found_match=true; + } + if (CheckModel (Nat_Information, model, connection)) { + /* Set pointers to relevant addresses */ + GSM = &Nat_Functions; + GSM_Info = &Nat_Information; + GSM_LinkOK = &CurrentLinkOK; + found_match=true; + } + + if (found_match) { + switch (connection) { + case GCT_FBUS : Protocol = &FBUS_Functions; break; + case GCT_Infrared: Protocol = &FBUS_Functions; break; + case GCT_Tekram : Protocol = &FBUS_Functions; break; + case GCT_DLR3 : Protocol = &FBUS_Functions; break; + case GCT_MBUS : Protocol = &MBUS_Functions; break; + case GCT_Irda : Protocol = &FBUSIRDA_Functions;break; + case GCT_AT : Protocol = &AT_Functions; break; + case GCT_Default : Protocol = NULL; break; + } + } else + return GE_NOTSUPPORTED; + } } @@ -668,30 +703,30 @@ char *GetMygnokiiVersion() { 1.Name,2.CodeName,3.Calendar,4.Netmonitor,5.Caller groups,6.Phonebook, 7.Authentication 8.Datacalls 9.KeysPressing 10.SMSC Default Recipient 11.SpeedDials 12.ScreenSavers 13.DTMF 14.SMS 15.NoPowerFrame 16.StartUpLogo -17.Profiles 18.Ringtones 19.WAP +17.Profiles 18.Ringtones 19.WAP 20.RIngtonesNumber */ static OnePhoneModel allmodels[] = { -/*1, 2, 3, 4, 5, 6 7 8 9 10 11 12 13 14 15 16 17 18 19 */ -{"3210","NSE-8",{ 0,F_NETMON, 0, 0, 0, 0, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS ,F_NOPOWER,F_STANIM,F_PROF51,F_RINGBIN, 0}}, -{"3210","NSE-9",{ 0,F_NETMON, 0, 0, 0, 0, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS ,F_NOPOWER,F_STANIM,F_PROF51,F_RINGBIN, 0}}, -{"3310","NHM-5",{F_CAL33,F_NETMON, 0,F_PBK33, 0, 0, 0,F_SMSCDEF,F_SPEED,F_SCRSAV, 0,F_SMS ,F_NOPOWER,F_STANIM,F_PROF33,F_RING_SM, 0}}, -{"3330","NHM-6",{F_CAL33,F_NETMON, 0,F_PBK33, 0, 0,F_KEYB,F_SMSCDEF,F_SPEED,F_SCRSAV, 0,F_SMS , 0,F_STANIM,F_PROF33,F_RING_SM,F_WAP}}, -{"5110","NSE-1",{ 0,F_NETMON, 0, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0, 0,F_PROF51, 0, 0}}, -{"5130","NSK-1",{ 0,F_NETMON, 0, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0, 0,F_PROF51, 0, 0}}, -{"5190","NSB-1",{ 0,F_NETMON, 0, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0, 0,F_PROF51, 0, 0}}, -{"6110","NSE-3",{F_CAL61,F_NETMON,F_CALER61, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0}}, -{"6130","NSK-3",{F_CAL61,F_NETMON,F_CALER61, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0}}, -{"6150","NSM-1",{F_CAL61,F_NETMON,F_CALER61, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0}}, -{"6190","NSB-3",{F_CAL61,F_NETMON,F_CALER61, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0}}, -{"6210","NPE-3",{F_CAL71,F_NETMON,F_CALER61,F_PBK71, 0,F_DATA71, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS71, 0,F_STA62 ,F_PROF61,F_RINGBIN,F_WAP}}, -{"6250","NHM-3",{F_CAL71,F_NETMON,F_CALER61,F_PBK71, 0,F_DATA71, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS71, 0,F_STA62 ,F_PROF61,F_RINGBIN,F_WAP}}, -{"7110","NSE-5",{F_CAL71,F_NETMON,F_CALER61,F_PBK71, 0,F_DATA71, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS71, 0,F_STA71 ,F_PROF61,F_RINGBIN,F_WAP}}, -{"8210","NSM-3",{ 0,F_NETMON,F_CALER61, 0, 0,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0}}, -{"8850","NSM-2",{ 0,F_NETMON,F_CALER61, 0, 0,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0}}, -{"9210","RAE-3",{ 0,F_NETMON,F_CALER61, 0, 0,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0}},//quesses only ! -{"" ,"" ,{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} +/*1, 2, 3, 4, 5, 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 */ +{"3210","NSE-8",{ 0,F_NETMON, 0, 0, 0, 0, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS ,F_NOPOWER,F_STANIM,F_PROF51,F_RINGBIN, 0, 2}}, +{"3210","NSE-9",{ 0,F_NETMON, 0, 0, 0, 0, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS ,F_NOPOWER,F_STANIM,F_PROF51,F_RINGBIN, 0, 2}}, +{"3310","NHM-5",{F_CAL33,F_NETMON, 0,F_PBK33SIM, 0, 0, 0,F_SMSCDEF,F_SPEED,F_SCRSAV, 0,F_SMS ,F_NOPOWER,F_STANIM,F_PROF33,F_RING_SM, 0, 7}}, +{"3330","NHM-6",{F_CAL33,F_NETMON, 0,F_PBK33INT, 0, 0,F_KEYB,F_SMSCDEF,F_SPEED,F_SCRSAV, 0,F_SMS , 0,F_STANIM,F_PROF33,F_RING_SM,F_WAP, 7}}, +{"5110","NSE-1",{ 0,F_NETMON, 0, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0, 0,F_PROF51, 0, 0, 0}}, +{"5130","NSK-1",{ 0,F_NETMON, 0, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0, 0,F_PROF51, 0, 0, 0}}, +{"5190","NSB-1",{ 0,F_NETMON, 0, 0,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0, 0,F_PROF51, 0, 0, 0}}, +{"6110","NSE-3",{F_CAL61,F_NETMON,F_CALER61,F_PBK61INT,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0, 1}}, +{"6130","NSK-3",{F_CAL61,F_NETMON,F_CALER61,F_PBK61INT,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0, 1}}, +{"6150","NSM-1",{F_CAL61,F_NETMON,F_CALER61,F_PBK61INT,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0, 1}}, +{"6190","NSB-3",{F_CAL61,F_NETMON,F_CALER61,F_PBK61INT,F_AUTH,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0, 1}}, +{"6210","NPE-3",{F_CAL71,F_NETMON,F_CALER61,F_PBK71INT, 0,F_DATA71, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS71, 0,F_STA62 ,F_PROF61,F_RINGBIN,F_WAP, 5}}, +{"6250","NHM-3",{F_CAL71,F_NETMON,F_CALER61,F_PBK71INT, 0,F_DATA71, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS71, 0,F_STA62 ,F_PROF61,F_RINGBIN,F_WAP, 5}}, +{"7110","NSE-5",{F_CAL71,F_NETMON,F_CALER61,F_PBK71INT, 0,F_DATA71, 0,F_SMSCDEF,F_SPEED, 0, 0,F_SMS71, 0,F_STA71 ,F_PROF61,F_RINGBIN,F_WAP, 5}}, +{"8210","NSM-3",{ 0,F_NETMON,F_CALER61,F_PBK61INT, 0,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0, 1}}, +{"8850","NSM-2",{ 0,F_NETMON,F_CALER61,F_PBK61INT, 0,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0, 1}}, +{"9210","RAE-3",{ 0,F_NETMON,F_CALER61, 0, 0,F_DATA61,F_KEYB,F_SMSCDEF,F_SPEED, 0,F_DTMF,F_SMS , 0,F_STA ,F_PROF61,F_RINGBIN, 0, 0}},//quesses only ! +{"" ,"" ,{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} }; OnePhoneModel *GetPhoneModelData (const char *num) diff --git a/common/gsm-bitmaps.c b/common/gsm-bitmaps.c index 1e96f8b..9114c5d 100644 --- a/common/gsm-bitmaps.c +++ b/common/gsm-bitmaps.c @@ -68,6 +68,27 @@ void GSM_ClearBitmap(GSM_Bitmap *bmp) for (i=0;isize;i++) bmp->bitmap[i]=0; } +int GSM_GetBitmapSize(GSM_Bitmap *bitmap) +{ + switch (bitmap->type) { + case GSM_StartupLogo : /*size 84*48*/ + case GSM_OperatorLogo : /*size 72*14*/ + case GSM_CallerLogo : /*size 72*14*/ + case GSM_PictureImage : /*size 72*28*/ + return bitmap->height*bitmap->width/8; + + case GSM_7110OperatorLogo: /*size 78*21*/ + return (bitmap->width*bitmap->height + 7)/8; + + case GSM_7110StartupLogo: /*size 96*65*/ + case GSM_6210StartupLogo: /*size 96*60*/ + return (bitmap->height+7)/8*bitmap->width; + + default: + return 0; + } +} + GSM_Error GSM_ReadBitmap(GSM_SMSMessage *message, GSM_Bitmap *bitmap) { int offset = 1; @@ -101,7 +122,7 @@ GSM_Error GSM_ReadBitmap(GSM_SMSMessage *message, GSM_Bitmap *bitmap) if (bitmap->width!=72 || bitmap->height!=14) return GE_INVALIDIMAGESIZE; - bitmap->size = (bitmap->width * bitmap->height) / 8; + bitmap->size = GSM_GetBitmapSize(bitmap); memcpy(bitmap->bitmap, message->MessageText + offset + 3, bitmap->size); #ifdef DEBUG @@ -143,7 +164,7 @@ void GSM_ResizeBitmap(GSM_Bitmap *bitmap, GSM_Bitmap_Types target) bitmap->height=21; } bitmap->type=target; - bitmap->size=(bitmap->width*bitmap->height + 7)/8; + bitmap->size=GSM_GetBitmapSize(bitmap); width=backup.width; if (bitmap->widthNrNotes;i++) { - switch (ringtone->notes[i].duration) { - case 192: buffer[0]++; break; - case 128: buffer[0]++; break; - case 96: buffer[1]++; break; - case 64: buffer[1]++; break; - case 48: buffer[2]++; break; - case 32: buffer[2]++; break; - case 24: buffer[3]++; break; - case 16: buffer[3]++; break; - case 12: buffer[4]++; break; - case 8: buffer[4]++; break; - case 6: buffer[5]++; break; - case 4: buffer[5]++; break; - } - } - - /* Now find the most frequently used */ - j=0; - for (i=0;i<6;i++) { - if (buffer[i]>j) { - k=i; - j=buffer[i]; - } - } - - /* Finally convert the default duration */ - switch (k) { - case 0: DefNoteDuration=128; break; - case 1: DefNoteDuration= 64; break; - case 2: DefNoteDuration= 32; break; - case 3: DefNoteDuration= 16; break; - case 4: DefNoteDuration= 8; break; - case 5: DefNoteDuration= 4; break; - default: DefNoteDuration= 16; break; - } - - /* Find the most frequently used scale and use this for the default */ - for (i=0;i<6;i++) buffer[i]=0; - for (i=0;iNrNotes;i++) { - if (ringtone->notes[i].note!=255) { - buffer[ringtone->notes[i].note/14]++; - } - } - j=0; - for (i=0;i<6;i++) { - if (buffer[i]>j) { - DefNoteScale=i; - j=buffer[i]; - } - } + /* Find the most frequently used duration and use this for the default */ + for (i=0;i<6;i++) buffer[i]=0; + for (i=0;iNrNotes;i++) { + switch (ringtone->notes[i].duration) { + case 192: buffer[0]++; break; + case 128: buffer[0]++; break; + case 96: buffer[1]++; break; + case 64: buffer[1]++; break; + case 48: buffer[2]++; break; + case 32: buffer[2]++; break; + case 24: buffer[3]++; break; + case 16: buffer[3]++; break; + case 12: buffer[4]++; break; + case 8: buffer[4]++; break; + case 6: buffer[5]++; break; + case 4: buffer[5]++; break; + } + } + + /* Now find the most frequently used */ + j=0; + for (i=0;i<6;i++) { + if (buffer[i]>j) { + k=i; + j=buffer[i]; + } + } + + /* Finally convert the default duration */ + switch (k) { + case 0: DefNoteDuration=128; break; + case 1: DefNoteDuration= 64; break; + case 2: DefNoteDuration= 32; break; + case 3: DefNoteDuration= 16; break; + case 4: DefNoteDuration= 8; break; + case 5: DefNoteDuration= 4; break; + default: DefNoteDuration= 16; break; + } + + /* Find the most frequently used scale and use this for the default */ + for (i=0;i<6;i++) buffer[i]=0; + for (i=0;iNrNotes;i++) { + if (ringtone->notes[i].note!=255) { + buffer[ringtone->notes[i].note/14]++; + } + } + j=0; + for (i=0;i<6;i++) { + if (buffer[i]>j) { + DefNoteScale=i; + j=buffer[i]; + } + } StartBit=BitPackByte(package, StartBit, CommandLength, 8); StartBit=BitPackByte(package, StartBit, RingingToneProgramming, 7); @@ -916,7 +916,7 @@ void PrepareRingingTones(char model[64], char rev[64]) { /* returns names from code or number in menu */ char *RingingToneName(int code, int menu) { - int index=1,i; + int index=1; GSM_Error error; if (code==0) @@ -934,25 +934,14 @@ char *RingingToneName(int code, int menu) } if (!strncmp(RingingTones[index].name,"Uploaded ",9)) { - ringtone.location=atoi(&RingingTones[index].name[10]); + ringtone.location=atoi(&RingingTones[index].name[10]); - error=GSM->GetBinRingtone(&ringtone); - - if (error==GE_NONE) return ringtone.name; - if (error==GE_UNKNOWNMODEL) { - - /* In 33x we have normal "Smart Messaging" format */ - if (GetModelFeature (FN_RINGTONES)==F_RING_SM) { - - i=7; - if (ringtone.frame[9]==0x4a && ringtone.frame[10]==0x3a) i=8; - ringtone.frame[i]=0x02; - - GSM_UnPackRingtone(&SMringtone, ringtone.frame+i, ringtone.length-i); - - return SMringtone.name; - } - } + error=GSM_GetPhoneRingtone(&ringtone,&SMringtone); + + if (error==GE_NONE) { + if (GetModelFeature (FN_RINGTONES)==F_RING_SM) return SMringtone.name; + else return ringtone.name; + } } return RingingTones[index].name; @@ -1021,3 +1010,27 @@ int GSM_SaveRingtoneToSMS(GSM_MultiSMSMessage *SMS, return i; } + +GSM_Error GSM_GetPhoneRingtone(GSM_BinRingtone *ringtone,GSM_Ringtone *SMringtone) +{ + GSM_Error error; + int i; + + error=GSM->GetBinRingtone(ringtone); + + if (error==GE_UNKNOWNMODEL) + { + /* In 3310,... we have normal "Smart Messaging" format */ + if (GetModelFeature (FN_RINGTONES)==F_RING_SM) { + i=7; + if (ringtone->frame[9]==0x4a && ringtone->frame[10]==0x3a) i=8; + ringtone->frame[i]=0x02; + + GSM_UnPackRingtone(SMringtone, ringtone->frame+i, ringtone->length-i); + + return GE_NONE; + } + } + + return error; +} diff --git a/common/gsm-sms.c b/common/gsm-sms.c index 5a35034..52020c1 100644 --- a/common/gsm-sms.c +++ b/common/gsm-sms.c @@ -491,7 +491,7 @@ GSM_Error GSM_DecodeETSISMSSubmitData(GSM_SMSMessage *SMS, GSM_ETSISMSMessage *E fprintf(stdout, " 7 bit SMS, body is (length %i): ",SMS->Length); #endif /* DEBUG */ - DecodeDefault (SMS->MessageText, output, tmp); + DecodeDefault (SMS->MessageText, output, SMS->Length); #ifdef DEBUG fprintf(stdout, "%s\n",SMS->MessageText); diff --git a/common/misc.c b/common/misc.c index b17a93e..34d81b7 100644 --- a/common/misc.c +++ b/common/misc.c @@ -8,9 +8,9 @@ */ -#include -#include -#include +#include +#include +#include #ifndef WIN32 #include @@ -20,10 +20,10 @@ #include #include #include -#endif - -#include "misc.h" -#include "gsm-common.h" +#endif + +#include "misc.h" +#include "gsm-common.h" #ifndef HAVE_TIMEOPS diff --git a/gnokii/gnokii.c b/gnokii/gnokii.c index 43beca6..106b367 100644 --- a/gnokii/gnokii.c +++ b/gnokii/gnokii.c @@ -867,6 +867,7 @@ int usage(void) fprintf(stdout, _( " gnokii --sniff [port]\n" " gnokii --decodefile file\n" +" gnokii --getbinringfromfile file name offset file2\n" )); #endif @@ -1046,6 +1047,7 @@ int main(int argc, char *argv[]) #ifdef DEBUG { "sniff", optional_argument, NULL, OPT_SNIFFER },// Will show datas from port { "decodefile", required_argument, NULL, OPT_DECODEFILE },//decode input file + { "getbinringfromfile", required_argument, NULL, OPT_GETBINRINGFROMFILE }, #endif { 0, 0, 0, 0}, @@ -1067,6 +1069,7 @@ int main(int argc, char *argv[]) #ifdef DEBUG { OPT_SNIFFER, 0, 1, 0 }, { OPT_DECODEFILE, 1, 1, 0 }, + { OPT_GETBINRINGFROMFILE,4, 4, 0 }, #endif { OPT_SETDATETIME, 0, 5, 0 }, @@ -1215,6 +1218,7 @@ int main(int argc, char *argv[]) #ifdef DEBUG case OPT_SNIFFER: rc = sniff(nargc, nargv); break; case OPT_DECODEFILE: rc = decodefile(nargc, nargv); break; + case OPT_GETBINRINGFROMFILE: rc = getbinringfromfile(nargc, nargv);break; #endif // Now, options with arguments @@ -1302,7 +1306,141 @@ int main(int argc, char *argv[]) /* Restores various phone settings from one file */ int restoresettings(char *argv[]) { - fprintf(stdout,_("Work in progress. Not usefull now. Sorry\n")); + GSM_Backup Backup; + GSM_PhonebookEntry pbk; + + int confirm; + char ans[4]; + + int i,pos; + + GSM_MemoryStatus SIMMemoryStatus = {GMT_SM, 0, 0}; + GSM_MemoryStatus PhoneMemoryStatus = {GMT_ME, 0, 0}; + + if (GSM_ReadBackupFile(argv[0], &Backup)!=GE_NONE) return 1; + + fbusinit(NULL); + + if (Backup.SIMPhonebookUsed!=0) { + confirm=-1; + while (confirm < 0) { + fprintf(stderr, _("Restore SIM phonebook ? ")); + GetLine(stdin, ans, 99); + if (!strcmp(ans, "yes")) confirm = 1; + if (!strcmp(ans, "no" )) confirm = 0; + } + if (confirm==1) { + if (GSM->GetMemoryStatus(&SIMMemoryStatus) != GE_NONE) { + fprintf(stderr,_("Error getting memory status !\n")); + GSM->Terminate(); + } + i=0;pos=1; + + while ((pos-1)!=SIMMemoryStatus.Used+SIMMemoryStatus.Free) { + pbk.Location=pos; + pbk.MemoryType=GMT_SM; + pbk.Name[0]=0; + pbk.Number[0]=0; + pbk.SubEntriesCount = 0; + if (iWritePhonebookLocation(&pbk); + fprintf(stderr,_(".")); + pos++; + } + fprintf(stderr,_("\n")); + } + } + if (Backup.PhonePhonebookUsed!=0) { + confirm=-1; + while (confirm < 0) { + fprintf(stderr, _("Restore phone phonebook ? ")); + GetLine(stdin, ans, 99); + if (!strcmp(ans, "yes")) confirm = 1; + if (!strcmp(ans, "no" )) confirm = 0; + } + if (confirm==1) { + if (GSM->GetMemoryStatus(&PhoneMemoryStatus) != GE_NONE) { + fprintf(stderr,_("Error getting memory status !\n")); + GSM->Terminate(); + } + + i=0;pos=1; + + while ((pos-1)!=PhoneMemoryStatus.Used+PhoneMemoryStatus.Free) { + pbk.Location=pos; + pbk.MemoryType=GMT_ME; + pbk.Name[0]=0; + pbk.Number[0]=0; + pbk.SubEntriesCount = 0; + if (iWritePhonebookLocation(&pbk); + fprintf(stderr,_(".")); + pos++; + } + fprintf(stderr,_("\n")); + } + } + if (Backup.CallerAvailable==true) { + confirm=-1; + while (confirm < 0) { + fprintf(stderr, _("Restore caller groups ? ")); + GetLine(stdin, ans, 99); + if (!strcmp(ans, "yes")) confirm = 1; + if (!strcmp(ans, "no" )) confirm = 0; + } + if (confirm==1) { + for (i=0;i<5;i++) GSM->SetBitmap(&Backup.CallerGroups[i]); + } + } + if (Backup.OperatorLogoAvailable==true) { + confirm=-1; + while (confirm < 0) { + fprintf(stderr, _("Restore operator logo ? ")); + GetLine(stdin, ans, 99); + if (!strcmp(ans, "yes")) confirm = 1; + if (!strcmp(ans, "no" )) confirm = 0; + } + if (confirm==1) { + GSM->SetBitmap(&Backup.OperatorLogo); + } + } + if (Backup.StartupLogoAvailable==true) { + confirm=-1; + while (confirm < 0) { + fprintf(stderr, _("Restore startup logo ? ")); + GetLine(stdin, ans, 99); + if (!strcmp(ans, "yes")) confirm = 1; + if (!strcmp(ans, "no" )) confirm = 0; + } + if (confirm==1) { + GSM->SetBitmap(&Backup.StartupLogo); + } + } + + GSM->Terminate(); + return 0; } @@ -1321,7 +1459,7 @@ int backupsettings(char *argv[]) fprintf(stderr,_("Backup phonebook from SIM...")); Backup.SIMPhonebookUsed=0; - if (GSM->GetMemoryStatus(&SIMMemoryStatus) == GE_NONE) {//FIXME + if (GSM->GetMemoryStatus(&SIMMemoryStatus) == GE_NONE) { Backup.SIMPhonebookSize=SIMMemoryStatus.Used+SIMMemoryStatus.Free; PbkEntry.MemoryType=GMT_SM; @@ -1396,11 +1534,10 @@ int backupsettings(char *argv[]) Backup.OperatorLogoAvailable=true; Backup.OperatorLogo.type=GSM_7110OperatorLogo; if (GSM->GetBitmap(&Backup.OperatorLogo)!=GE_NONE) { - Backup.OperatorLogoAvailable=true; Backup.OperatorLogo.type=GSM_OperatorLogo; if (GSM->GetBitmap(&Backup.OperatorLogo)!=GE_NONE) { Backup.OperatorLogoAvailable=false; - fprintf(stderr,_("Error\n")); + fprintf(stderr,_("Error\n")); } else fprintf(stderr,_("Done\n")); } else fprintf(stderr,_("Done\n")); @@ -1442,9 +1579,6 @@ int presskeysequence(char *argv[]) sleep(1); - /* We need to make sure that the init is finished to avoid interrupted */ - /* multiframe packets... */ - fbusinit(NULL); for (i=0;i=1 && num<=3) { bitmap.number=num; @@ -3255,7 +3378,7 @@ int setlogo(int argc, char *argv[]) strncpy(bitmap.netcode,"000 00",7); bitmap.width=72; bitmap.height=14; - bitmap.size=bitmap.width*bitmap.height/8; + bitmap.size=GSM_GetBitmapSize(&bitmap); GSM_ClearBitmap(&bitmap); } if (!strcmp(argv[0],"7110op")) @@ -3264,7 +3387,7 @@ int setlogo(int argc, char *argv[]) strncpy(bitmap.netcode,"000 00",7); bitmap.width=78; bitmap.height=21; - bitmap.size=(bitmap.width*bitmap.height + 7)/8; + bitmap.size=GSM_GetBitmapSize(&bitmap); GSM_ClearBitmap(&bitmap); } /* FIX ME: how to remove startup and group logos ? */ @@ -7416,53 +7539,34 @@ int getringtone(int argc, char *argv[]) GSM_Error error; GSM_Ringtone SMringtone; - int i; - - char model[64]; - - FILE *file; - ringtone.location=1; if (argc>1) ringtone.location=atoi(argv[1]); /* Initialise the GSM interface. */ fbusinit(NULL); - error=GSM->GetBinRingtone(&ringtone); - - while (GSM->GetModel(model) != GE_NONE) - sleep(1); - - GSM->Terminate(); + error=GSM_GetPhoneRingtone(&ringtone,&SMringtone); fprintf(stdout, _("Downloaded ringtone, location %i: "),ringtone.location); switch (error) { case GE_NONE: fprintf(stdout, _("get succeeded!\n")); - fprintf(stdout, _("Name: %s (binary format)\n"),ringtone.name); + /* In 33.. we have normal "Smart Messaging" format */ + if (GetModelFeature (FN_RINGTONES)==F_RING_SM) { + fprintf(stdout, _("Name: %s (normal format)\n"),SMringtone.name); + GSM_SaveRingtoneFileOnConsole(argv[0], &SMringtone); + } else { + fprintf(stdout, _("Name: %s (binary format)\n"),ringtone.name); + GSM_SaveBinRingtoneFile(argv[0], &ringtone); + } + GSM->Terminate(); + return 0; break; case GE_INVALIDRINGLOCATION: fprintf(stdout, _("invalid location %i!\n"),ringtone.location); break; case GE_UNKNOWNMODEL: - - /* In 3310 we have normal "Smart Messaging" format */ - if (GetModelFeature (FN_RINGTONES)==F_RING_SM) { - - i=7; - if (ringtone.frame[9]==0x4a && ringtone.frame[10]==0x3a) i=8; - ringtone.frame[i]=0x02; - - GSM_UnPackRingtone(&SMringtone, ringtone.frame+i, ringtone.length-i); - - fprintf(stdout, _("Name: %s (normal format)\n"),SMringtone.name); - - GSM_SaveRingtoneFileOnConsole(argv[0], &SMringtone); - - return 0; - } - fprintf(stdout, _("mygnokii doesn't know format for this model!\n")); break; case GE_NOTIMPLEMENTED: @@ -7472,21 +7576,10 @@ int getringtone(int argc, char *argv[]) fprintf(stdout, _("not supported by this model!\n")); break; } - - if (error!=GE_NONE) - return(-1); - - file = fopen(argv[0], "wb"); - - if (!file) - return(GE_CANTOPENFILE); - fwrite(ringtone.frame, 1, ringtone.length, file); - - fclose(file); + GSM->Terminate(); - return 0; - + return(-1); } int binringtoneconvert(int argc, char *argv[]) @@ -7558,32 +7651,32 @@ int binringtoneconvert(int argc, char *argv[]) w=w*2; if (w>z && (w/2)<=z) { switch (m) { - case 1:fprintf(file,_("16"));break; - case 2:fprintf(file,_("8"));break; - case 3:fprintf(file,_("4"));break; - case 4:fprintf(file,_("2"));break; - case 5:fprintf(file,_("1"));break; + case 1:fprintf(file,_("16"));break; + case 2:fprintf(file,_("8"));break; + case 3:fprintf(file,_("4"));break; + case 4:fprintf(file,_("2"));break; + case 5:fprintf(file,_("1"));break; } break; } } if (z>w) fprintf(file,_("1")); pause=false; - switch (GSM_GetNote(j)) { - case Note_C :fprintf(file,_("c"));break; - case Note_Cis:fprintf(file,_("c#"));break; - case Note_D :fprintf(file,_("d"));break; - case Note_Dis:fprintf(file,_("d#"));break; - case Note_E :fprintf(file,_("e"));break; - case Note_F :fprintf(file,_("f"));break; - case Note_Fis:fprintf(file,_("f#"));break; - case Note_G :fprintf(file,_("g"));break; - case Note_Gis:fprintf(file,_("g#"));break; - case Note_A :fprintf(file,_("a"));break; - case Note_Ais:fprintf(file,_("a#"));break; - case Note_H :fprintf(file,_("h"));break; - default :pause=true;fprintf(file,_("p"));break; //Pause ? - } + switch (GSM_GetNote(j)) { + case Note_C :fprintf(file,_("c"));break; + case Note_Cis:fprintf(file,_("c#"));break; + case Note_D :fprintf(file,_("d"));break; + case Note_Dis:fprintf(file,_("d#"));break; + case Note_E :fprintf(file,_("e"));break; + case Note_F :fprintf(file,_("f"));break; + case Note_Fis:fprintf(file,_("f#"));break; + case Note_G :fprintf(file,_("g"));break; + case Note_Gis:fprintf(file,_("g#"));break; + case Note_A :fprintf(file,_("a"));break; + case Note_Ais:fprintf(file,_("a#"));break; + case Note_H :fprintf(file,_("h"));break; + default :pause=true;fprintf(file,_("p"));break; //Pause ? + } w=deflen*1.5; for (m=0;m<6;m++) { w=w*2; @@ -7722,11 +7815,11 @@ int setsimlock() fprintf(stderr,_("Error getting simlock info\n"));GSM->Terminate();return -1; } /* Opening all locks (we must check, if we can open them) */ - NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer0); - openbuffer[4]=1;NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer); - openbuffer[4]=2;NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer); - openbuffer[4]=4;NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer); - openbuffer[4]=8;NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer); + NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer0); + openbuffer[4]=1;NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer); + openbuffer[4]=2;NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer); + openbuffer[4]=4;NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer); + openbuffer[4]=8;NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer); if (GSM->SimlockInfo(&siml)!=GE_NONE) { fprintf(stderr,_("Error getting simlock info\n"));GSM->Terminate();return -1; } @@ -7775,13 +7868,13 @@ int setsimlock() } /* Closing simlock with given values */ closebuffer[4]=1+2+4+8; - NULL_SendMessageSequence(50, &CurrentMagicError, 20, 0x40,closebuffer); + NULL_SendMessageSequence (50, &CurrentMagicError, 20, 0x40,closebuffer); /* Opening all locks */ - NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer0); - openbuffer[4]=1;NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer); - openbuffer[4]=2;NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer); - openbuffer[4]=4;NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer); - openbuffer[4]=8;NULL_SendMessageSequence(50, &CurrentMagicError, 10, 0x40,openbuffer); + NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer0); + openbuffer[4]=1;NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer); + openbuffer[4]=2;NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer); + openbuffer[4]=4;NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer); + openbuffer[4]=8;NULL_SendMessageSequence (50, &CurrentMagicError, 10, 0x40,openbuffer); GSM->Reset(0x03); GSM->Terminate(); return 0; @@ -7881,7 +7974,7 @@ int geteeprom() if ((i/256)!=((i-1)/256)) fprintf(stderr,_(".")); - if (NULL_SendMessageSequence(50, &CurrentMagicError, 9, 0x40,buffer)!=GE_NONE) break; + if (NULL_SendMessageSequence(50, &CurrentMagicError, 9, 0x40,buffer)!=GE_NONE) break; i=i+0x10; } @@ -8682,7 +8775,7 @@ int savephonebookentry(int argc, char *argv[]) case GE_NONE: /* Put entry into SMS structure */ - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { GSM_SavePhonebookEntryToSMS(&MultiSMS,&entry,21); } else { GSM_SavePhonebookEntryToSMS(&MultiSMS,&entry,10); @@ -8727,7 +8820,7 @@ int sendphonebookentry(int argc, char *argv[]) case GE_NONE: /* Put entry into SMS structure */ - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { GSM_SavePhonebookEntryToSMS(&MultiSMS,&entry,21); } else { GSM_SavePhonebookEntryToSMS(&MultiSMS,&entry,10); @@ -8746,3 +8839,75 @@ int sendphonebookentry(int argc, char *argv[]) return 0; } + +#ifdef DEBUG +int getbinringfromfile(int argc, char *argv[]) +{ + FILE *file; + int i,j; + bool found; + GSM_BinRingtone binring,ringtone; + + fprintf(stdout,_("Offset %ld\n"),atol(argv[2])); + + file = fopen(argv[0], "rb"); + + if (!file) return(GE_CANTOPENFILE); + + fseek(file,atol(argv[2]),0); + + ringtone.length=fread(ringtone.frame, 1, 900, file); + + fclose(file); + + i=0;found=false; + while (true) { + if (ringtone.frame[i ]==0x00 && ringtone.frame[i+1]==0x02 && + ringtone.frame[i+2]==0xFC && ringtone.frame[i+3]==0x09) { + found=true; + break; + } + i++; + if (i==ringtone.length-3) break; + } + + if (!found) { + fprintf(stdout,_("Start not found\n")); + return (-1); + } + + j=0;found=false; + while (true) { + if (ringtone.frame[j]==0x07 && ringtone.frame[j+1]==0x0B) { + found=true; + break; + } + j++; + if (j==ringtone.length-2) break; + } + + if (!found) { + fprintf(stdout,_("End not found\n")); + return (-1); + } + + binring.length=0; + binring.frame[binring.length++]=0x00; + binring.frame[binring.length++]=0x00; + binring.frame[binring.length++]=0x0C; + binring.frame[binring.length++]=0x01; + binring.frame[binring.length++]=0x2C; + + memcpy(binring.frame+binring.length,argv[1],strlen(argv[1])); + binring.length=binring.length+strlen(argv[1]); + + binring.frame[binring.length++]=0x00; + + memcpy(binring.frame+binring.length,ringtone.frame+i,j-i+2); + binring.length=binring.length+j-i+2; + + GSM_SaveBinRingtoneFile(argv[3], &binring); + + return GE_NONE; +} +#endif diff --git a/include/gsm-api.h b/include/gsm-api.h index 0ab7718..7f45115 100644 --- a/include/gsm-api.h +++ b/include/gsm-api.h @@ -448,17 +448,19 @@ typedef enum { F_CAL33, /*Calendar in 3310 style - 10 reminders, Unicode, 3 coding types*/ F_CAL71, /*Calendar in 7110 style - 4 types, recurrance, etc.*/ - F_PBK33, /*Phonebook in Unicode. 3310 style - name and entry*/ - F_PBK71, /*Extended phonebook - multiple numbers,Unicode.Like in 7110*/ + F_PBK33SIM,/*Phonebook in Unicode(3310 style).Name and number.No internal*/ + F_PBK33INT,/*Phonebook in Unicode(3310 style).Name and number.Internal available*/ + F_PBK71INT,/*Extended phonebook-multiple numbers,Unicode(7110 style).Internal available*/ + F_PBK61INT,/*Name and number,no Unicode(6110 style).Internal available*/ F_DATA61, /*We can make data calls using gnokiid. Like in 6110*/ F_DATA71, /*Datacalls using AT commands*/ F_SMS, /*SMS with Inbox, Outbox*/ - F_SMS71, /*SMS with SMS folders like in 7110*/ + F_SMS71, /*SMS with SMS folders like in 7110*/ /*10*/ F_AUTH, /*We can make authentication and have "Accessory connected" like in 6110*/ - F_NETMON, /*Netmonitor available*/ /*10*/ + F_NETMON, /*Netmonitor available*/ F_CALER61,/*Caller groups in 6110 style - 5 groups with members*/ F_KEYB, /*We can press keys*/ F_SMSCDEF,/*SMSC can have default recipient*/ @@ -467,9 +469,9 @@ typedef enum { F_DTMF, /*We can handle DTMF sequences*/ F_NOPOWER,/*We must get power/battery info from netmonitor*/ - F_STANIM, /*Startup logo animated or static*/ + F_STANIM, /*Startup logo animated or static*/ /*20*/ F_STA , /*Startup logo static*/ - F_STA62 , /*Startup logo static size 6210*/ /*20*/ + F_STA62 , /*Startup logo static size 6210*/ F_STA71 , /*Startup logo static size 7110*/ F_PROF61, /*Profiles numbered like in N6110*/ @@ -499,14 +501,15 @@ typedef enum { FN_STARTUP, FN_PROFILES, FN_RINGTONES, - FN_WAP + FN_WAP, + FN_RINGNUMBER } featnum_index; /* For models table */ typedef struct { char *model; char *number; - feat_index features[17]; + feat_index features[18]; } OnePhoneModel; extern char *GetModelName (); diff --git a/include/gsm-bitmaps.h b/include/gsm-bitmaps.h index f65acc2..9d40713 100644 --- a/include/gsm-bitmaps.h +++ b/include/gsm-bitmaps.h @@ -55,5 +55,6 @@ void GSM_ResizeBitmap(GSM_Bitmap *bitmap, GSM_Bitmap_Types target); void GSM_PrintBitmap(GSM_Bitmap *bitmap); GSM_Error GSM_ReadBitmap(GSM_SMSMessage *message, GSM_Bitmap *bitmap); int GSM_SaveBitmapToSMS(GSM_MultiSMSMessage *SMS, GSM_Bitmap *bitmap,bool ScreenSaver, bool UnicodeText); +int GSM_GetBitmapSize(GSM_Bitmap *bitmap); #endif diff --git a/include/gsm-common.h b/include/gsm-common.h index c91a4c5..e0abef1 100644 --- a/include/gsm-common.h +++ b/include/gsm-common.h @@ -69,8 +69,8 @@ #define GSM_MAX_REVISION_LENGTH (20) #define GSM_MAX_MODEL_LENGTH (10) -/* In 6210 test 57 there seems to be 75 chars */ -#define NM_MAX_SCREEN_WIDTH 75 +/* In 6210 test 57 there seems to be 75 chars */ +#define NM_MAX_SCREEN_WIDTH 75 /* Power source types */ typedef enum { @@ -301,11 +301,11 @@ typedef enum { GE_WRONGCOLORS, /* Wrong colors in bitmap file */ GE_INVALIDFILEFORMAT, /* Invalid format of file */ GE_SUBFORMATNOTSUPPORTED, /* Subformat of file not supported */ - GE_TOOSHORT, /* Too short file, structure, etc. to read */ + GE_TOOSHORT, /* Too short file, structure, etc. to read */ /*30*/ GE_TOOLONG, /* Too long file, structure, etc. to read */ GE_INVALIDIMAGESIZE, /* Invalid size of bitmap (in file, etc.) */ GE_BUSY, /* Command is still being executed. */ - GE_UNKNOWN, /* Unknown error - well better than nothing!! */ + GE_UNKNOWN, /* Unknown error - well better than nothing!! */ /*34*/ GE_NOACCESS, GE_USERCANCELED, GE_MEMORYFULL, diff --git a/include/gsm-ringtones.h b/include/gsm-ringtones.h index 92e439e..948966d 100644 --- a/include/gsm-ringtones.h +++ b/include/gsm-ringtones.h @@ -191,4 +191,6 @@ int RingingToneMenu(int code); int NumberOfRingtones(); +GSM_Error GSM_GetPhoneRingtone(GSM_BinRingtone *ringtone,GSM_Ringtone *SMringtone); + #endif /* __gsm_ringtones_h */ diff --git a/xgnokii/xgnokii_contacts.c b/xgnokii/xgnokii_contacts.c index d7c5f78..39ef62b 100644 --- a/xgnokii/xgnokii_contacts.c +++ b/xgnokii/xgnokii_contacts.c @@ -251,7 +251,7 @@ static void OkEditEntryDialog (GtkWidget *widget, gpointer data) max_phonebook_name_length); entry->entry.Name[max_phonebook_name_length] = '\0'; - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { } else @@ -297,7 +297,7 @@ because you save it into SIM memory!")); gtk_widget_show (errorDialog.dialog); } - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { } else @@ -331,7 +331,7 @@ because you save it into SIM memory!")); max_phonebook_name_length); ((EditEntryData*) data)->pbEntry->entry.Name[max_phonebook_name_length] = '\0'; - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { } else @@ -356,7 +356,7 @@ because you save it into SIM memory!")); gtk_widget_show (errorDialog.dialog); } - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { } else @@ -473,7 +473,7 @@ static void OkNewEntryDialog(GtkWidget *widget, gpointer data ) max_phonebook_name_length); entry->entry.Name[max_phonebook_name_length] = '\0'; - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { } else @@ -511,7 +511,7 @@ because you save it into SIM memory!")); gtk_widget_show (errorDialog.dialog); } - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { } else @@ -537,7 +537,7 @@ because you save it into SIM memory!")); max_phonebook_name_length); ((EditEntryData*) data)->pbEntry->entry.Name[max_phonebook_name_length] = '\0'; - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { } else @@ -562,7 +562,7 @@ because you save it into SIM memory!")); gtk_widget_show (errorDialog.dialog); } - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { } else @@ -1077,7 +1077,7 @@ static void CreateEditDialog (EditEntryData *editEntryData, gchar *title, gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); gtk_widget_show (label); - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { button = gtk_button_new (); editEntryData->number = gtk_label_new (""); @@ -1097,7 +1097,7 @@ static void CreateEditDialog (EditEntryData *editEntryData, gchar *title, gtk_widget_show (editEntryData->number); } -/* if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) { +/* if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { hbox = gtk_hbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (editEntryData->dialog)->vbox), hbox); @@ -1160,7 +1160,7 @@ static void EditPbEntry(PhonebookEntry *pbEntry, gint row) gtk_entry_set_text (GTK_ENTRY (editEditEntryData.name), pbEntry->entry.Name); - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) gtk_label_set_text (GTK_LABEL (editEditEntryData.number), pbEntry->entry.Number); else gtk_entry_set_text (GTK_ENTRY (editEditEntryData.number), pbEntry->entry.Number); @@ -1253,7 +1253,7 @@ void NewPbEntry(PhonebookEntry *pbEntry) gtk_entry_set_text (GTK_ENTRY (newEditEntryData.name), ""); - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) gtk_label_set_text (GTK_LABEL (newEditEntryData.number), ""); else gtk_entry_set_text (GTK_ENTRY (newEditEntryData.number), ""); @@ -1297,7 +1297,7 @@ void DuplicatePbEntry (PhonebookEntry *pbEntry) gtk_entry_set_text (GTK_ENTRY (duplicateEditEntryData.name), pbEntry->entry.Name); - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) gtk_label_set_text (GTK_LABEL (duplicateEditEntryData.number), pbEntry->entry.Number); else gtk_entry_set_text (GTK_ENTRY (duplicateEditEntryData.number), pbEntry->entry.Number); @@ -2361,7 +2361,7 @@ static void ExportVCARD (FILE *f) fprintf (f, "X_GSM_CALLERGROUP:%d\n", pbEntry->entry.Group); /* Add ext. pbk info if required */ - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) for (j = 0; j < pbEntry->entry.SubEntriesCount; j++) { if (pbEntry->entry.SubEntries[j].EntryType == GSM_Number) @@ -2420,7 +2420,7 @@ static void ExportNative (FILE *f) strcat (buf, buf2); /* Add ext. pbk info if required */ - if (GetModelFeature(FN_PHONEBOOK)==F_PBK71) + if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT) { for (j = 0; j < pbEntry->entry.SubEntriesCount; j++) if (pbEntry->entry.SubEntries[j].EntryType==GSM_Number) diff --git a/xgnokii/xgnokii_logos.c b/xgnokii/xgnokii_logos.c index 5f806cf..61a6ae9 100644 --- a/xgnokii/xgnokii_logos.c +++ b/xgnokii/xgnokii_logos.c @@ -994,7 +994,7 @@ static void SetLogoEvent(GtkWidget *widget) { static void ClearLogoEvent(GtkWidget *widget) { - bitmap.size=bitmap.width*bitmap.height/8; + bitmap.size=GSM_GetBitmapSize(&bitmap); GSM_ClearBitmap(&bitmap); diff --git a/xgnokii/xgnokii_sms.c b/xgnokii/xgnokii_sms.c index a9726b9..d5da1f4 100644 --- a/xgnokii/xgnokii_sms.c +++ b/xgnokii/xgnokii_sms.c @@ -1005,7 +1005,7 @@ static void SendSMS (void) if (GTK_TOGGLE_BUTTON (sendSMS.report)->active) Multisms.SMS[j].Type = GST_DR; - if (GTK_TOGGLE_BUTTON (sendSMS.class)->active) Multisms.SMS[j].Class = 0; + if (GTK_TOGGLE_BUTTON (sendSMS.class)->active) Multisms.SMS[j].Class = 0; Multisms.SMS[j].Validity = Multisms.SMS[j].MessageCenter.Validity; @@ -1226,9 +1226,9 @@ static void CreateSMSSendWindow (void) gtk_box_pack_start (GTK_BOX (vbox), sendSMS.longSMS, FALSE, FALSE, 3); gtk_widget_show (sendSMS.longSMS); - sendSMS.class = gtk_check_button_new_with_label (_("Send as Flash SMS (Class 0)")); - gtk_box_pack_start (GTK_BOX (vbox), sendSMS.class, FALSE, FALSE, 3); - gtk_widget_show (sendSMS.class); + sendSMS.class = gtk_check_button_new_with_label (_("Send as Flash SMS (Class 0)")); + gtk_box_pack_start (GTK_BOX (vbox), sendSMS.class, FALSE, FALSE, 3); + gtk_widget_show (sendSMS.class); label = gtk_label_new (_("SMS Center:")); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 1);