http://marcin-wiacek.fkn.pl/english/zips/mygnokii.tar.gz
authorshort <>
Thu, 28 Feb 2002 02:31:31 +0000 (02:31 +0000)
committershort <>
Thu, 28 Feb 2002 02:31:31 +0000 (02:31 +0000)
md5sum: 0e70972231995d215d6bc31736051b86
length: 1098766

16 files changed:
Docs/CREDITS
VERSION
common/gsm-api.c
common/gsm-bitmaps.c
common/gsm-networks.c
common/gsm-ringtones.c
common/gsm-sms.c
common/misc.c
gnokii/gnokii.c
include/gsm-api.h
include/gsm-bitmaps.h
include/gsm-common.h
include/gsm-ringtones.h
xgnokii/xgnokii_contacts.c
xgnokii/xgnokii_logos.c
xgnokii/xgnokii_sms.c

index 7193775..8232bd3 100644 (file)
@@ -89,7 +89,7 @@ Thank you to, in no particular order...
    
 *  Balazs Nagy for frames list and long hacker's work...
 
    
 *  Balazs Nagy for frames list and long hacker's work...
 
-*  Ladislav Michl & Manfred Jonsson for support for various AT phones...
+*  Ladislav Michl & Manfred Jonsson\r for support for various AT phones...
 
 *  Manfred Jonsson for idea of programming, which looks for me good
 
 
 *  Manfred Jonsson for idea of programming, which looks for me good
 
diff --git a/VERSION b/VERSION
index 4735d92..3a1e380 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.3.3_pre8-gold_2002_02_16
+0.3.3_pre8-gold_2002_02_24
index 99b73d7..5a91da9 100644 (file)
@@ -327,6 +327,7 @@ GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_Connec
 
   CurrentRLP_RXCallback = rlp_callback;
   CurrentCallPassup=NULL;
 
   CurrentRLP_RXCallback = rlp_callback;
   CurrentCallPassup=NULL;
+  CurrentCallDivert=NULL;
   CurrentPhonebookEntry=NULL;
   CurrentNetworkInfo = NULL;
   CurrentGetBitmap=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;
   CurrentRequestTerminate=false;
   CurrentDisableKeepAlive=false;
   CurrentCalendarNotesInfo.HowMany=2000;
+  CurrentSMSMessage=NULL;
   CurrentMagicError = GE_BUSY;  
   
   if (!strcmp(model,"auto")) {
   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 {
     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;
       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;
       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;
       }
         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
 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[] = {
 
 */
 
 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)
 };
 
 OnePhoneModel *GetPhoneModelData (const char *num)
index 1e96f8b..9114c5d 100644 (file)
@@ -68,6 +68,27 @@ void GSM_ClearBitmap(GSM_Bitmap *bmp)
   for (i=0;i<bmp->size;i++) bmp->bitmap[i]=0;
 }
 
   for (i=0;i<bmp->size;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;
 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;
   
   
   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
   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->height=21;
   }
   bitmap->type=target;
-  bitmap->size=(bitmap->width*bitmap->height + 7)/8;
+  bitmap->size=GSM_GetBitmapSize(bitmap);
   
   width=backup.width;
   if (bitmap->width<width) {
   
   width=backup.width;
   if (bitmap->width<width) {
@@ -279,3 +300,4 @@ int GSM_SaveBitmapToSMS(GSM_MultiSMSMessage *SMS, GSM_Bitmap *bitmap,
 
   return 0;
 }
 
   return 0;
 }
+
index 4101a38..b36bcf5 100644 (file)
@@ -269,49 +269,49 @@ GSM_Network GSM_Networks[] =
   { "400 01", "AZERCELL GSM" },
   { "400 02", "Bakcell GSM 2000" },
 
   { "400 01", "AZERCELL GSM" },
   { "400 02", "Bakcell GSM 2000" },
 
-  { "404 01", "AIRCELL"},
-  { "404 02", "Evergrowth"},
-  { "404 03", "Bharthi Telenet"},
-  { "404 05", "Fascel"},
-  { "404 07", "Tata Cell"}, //TATA Cellular
+  { "404 01", "AIRCELL"},\r
+  { "404 02", "Evergrowth"},\r
+  { "404 03", "Bharthi Telenet"},\r
+  { "404 05", "Fascel"},\r
+  { "404 07", "Tata Cell"},\r //TATA Cellular
   { "404 08", "Koshika"},
   { "404 08", "Koshika"},
-  { "404 09", "Reliance"},
-  { "404 10", "AIRTEL"}, //AirTel
-  { "404 11", "Essar"}, //Essar Cellphone
-  { "404 12", "Escotel"},
-  { "404 14", "Spice"}, //Modicom
-  { "404 15", "AIRCELL"}, //Essar Cellphone
-  { "404 18", "Reliance"},
-  { "404 19", "Escotel"},
-  { "404 20", "Orange"}, //Max Touch
-  { "404 21", "BPL Mobile"}, //BPL - Mobile
-  { "404 22", "Birla AT&T"},
-  { "404 24", "Birla AT&T"},
-  { "404 26", "Koshika"},
-  { "404 27", "BPL Mobile"}, //BPL USWEST Cellular
-  { "404 30", "Usha"}, //Command
-  { "404 31", "AIRCELL"}, //?
-  { "404 31", "Command"}, //?
-  { "404 32", "Koshika"},
-  { "404 34", "Koshika"},
-  { "404 36", "Reliance"},
-  { "404 40", "SkyCell"},
+  { "404 09", "Reliance"},\r
+  { "404 10", "AIRTEL"},\r //AirTel
+  { "404 11", "Essar"},\r //Essar Cellphone
+  { "404 12", "Escotel"},\r
+  { "404 14", "Spice"},\r //Modicom
+  { "404 15", "AIRCELL"},\r //Essar Cellphone
+  { "404 18", "Reliance"},\r
+  { "404 19", "Escotel"},\r
+  { "404 20", "Orange"},\r //Max Touch
+  { "404 21", "BPL Mobile"},\r //BPL - Mobile
+  { "404 22", "Birla AT&T"},\r
+  { "404 24", "Birla AT&T"},\r
+  { "404 26", "Koshika"},\r
+  { "404 27", "BPL Mobile"},\r //BPL USWEST Cellular
+  { "404 30", "Usha"},\r //Command
+  { "404 31", "AIRCELL"},\r //?
+  { "404 31", "Command"},\r //?
+  { "404 32", "Koshika"},\r
+  { "404 34", "Koshika"},\r
+  { "404 36", "Reliance"},\r
+  { "404 40", "SkyCell"},\r
   { "404 41", "RPG"}, //RPG Cellular
   { "404 41", "RPG"}, //RPG Cellular
-  { "404 42", "AIRCELL"}, //AIRCEL
-  { "404 43", "BPL Mobile"},
-  { "404 44", "Spice"},
-  { "404 45", "AIRTEL-blr"},
-  { "404 46", "BPL Moibile"},
+  { "404 42", "AIRCELL"},\r //AIRCEL
+  { "404 43", "BPL Mobile"},\r
+  { "404 44", "Spice"},\r
+  { "404 45", "AIRTEL-blr"},\r
+  { "404 46", "BPL Moibile"},\r
   { "404 49", "AIRTEL"},
   { "404 49", "AIRTEL"},
-  { "404 50", "Reliance"},
+  { "404 50", "Reliance"},\r
   { "404 52", "Reliance"},
   { "404 56", "Escotel"},
   { "404 52", "Reliance"},
   { "404 56", "Escotel"},
-  { "404 60", "AIRCELL"},
+  { "404 60", "AIRCELL"},\r
   { "404 67", "Reliance"},
   { "404 67", "Reliance"},
-  { "404 70", "Hexacom"},
-  { "404 78", "RPG"},
-  { "404 85", "Reliance"},
-
+  { "404 70", "Hexacom"},\r
+  { "404 78", "RPG"},\r
+  { "404 85", "Reliance"},\r
+\r
   { "410 01", "Mobilink" },
   { "413 02", "DIALOG GSM" },
   { "415 01", "CELLIS" },
   { "410 01", "Mobilink" },
   { "413 02", "DIALOG GSM" },
   { "415 01", "CELLIS" },
index 8bb013d..588ddad 100644 (file)
@@ -223,62 +223,62 @@ u8 GSM_PackRingtone(GSM_Ringtone *ringtone, unsigned char *package, int *maxleng
   int DefNoteTempo=63;
   u8 DefNoteStyle=NaturalStyle;
   
   int DefNoteTempo=63;
   u8 DefNoteStyle=NaturalStyle;
   
-  int buffer[6];              /* Used to find default ringtone parameters */
-  int i,j,k=0,thisnote,thisnotelong;
+  int buffer[6];\r              /* Used to find default ringtone parameters */
+  int i,j,k=0,thisnote,thisnotelong;\r
   
   
-  /* Find the most frequently used duration and use this for the default */
-  for (i=0;i<6;i++) buffer[i]=0;
-  for (i=0;i<ringtone->NrNotes;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;i<ringtone->NrNotes;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 */\r
\r for (i=0;i<6;i++) buffer[i]=0;\r
+  for (i=0;i<ringtone->NrNotes;i++) {\r
+    switch (ringtone->notes[i].duration) {\r
+      case 192: buffer[0]++; break;\r
+      case 128: buffer[0]++; break;\r
+      case  96:        buffer[1]++; break;\r
+      case  64: buffer[1]++; break;\r
+      case  48: buffer[2]++; break;\r
+      case  32: buffer[2]++; break;\r
+      case  24: buffer[3]++; break;\r
+      case  16: buffer[3]++; break;\r
+      case  12: buffer[4]++; break;\r
+      case   8: buffer[4]++; break;\r
+      case   6: buffer[5]++; break;\r
+      case   4: buffer[5]++; break;\r
+    }\r
+  }\r
+\r
+  /* Now find the most frequently used */\r
+  j=0;\r
+  for (i=0;i<6;i++) {\r
+    if (buffer[i]>j) {\r
+      k=i; \r
+      j=buffer[i];\r
+    }\r
+  }\r
+\r
+  /* Finally convert the default duration */\r
+  switch (k) {\r
+      case 0: DefNoteDuration=128; break;      \r
+      case 1: DefNoteDuration= 64; break;      \r
+      case 2: DefNoteDuration= 32; break;      \r
+      case 3: DefNoteDuration= 16; break;      \r
+      case 4: DefNoteDuration=  8; break;      \r
+      case 5: DefNoteDuration=  4; break;      \r
+     default: DefNoteDuration= 16; break;      \r
+  }  \r
+\r
+  /* Find the most frequently used scale and use this for the default */\r\r
+  for (i=0;i<6;i++) buffer[i]=0;\r
+  for (i=0;i<ringtone->NrNotes;i++) {\r
+    if (ringtone->notes[i].note!=255) {\r
+      buffer[ringtone->notes[i].note/14]++;\r
+    }\r
+  }\r
+  j=0;\r
+  for (i=0;i<6;i++) {\r
+    if (buffer[i]>j) {\r
+      DefNoteScale=i;\r
+      j=buffer[i];\r
+    }\r
+  }\r
 
   StartBit=BitPackByte(package, StartBit, CommandLength, 8);
   StartBit=BitPackByte(package, StartBit, RingingToneProgramming, 7);
 
   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)
 {
 /* 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)
   GSM_Error error;
 
   if (code==0)
@@ -934,25 +934,14 @@ char *RingingToneName(int code, int menu)
   }
 
   if (!strncmp(RingingTones[index].name,"Uploaded ",9)) {
   }
 
   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;
   }
   
   return RingingTones[index].name;
@@ -1021,3 +1010,27 @@ int GSM_SaveRingtoneToSMS(GSM_MultiSMSMessage *SMS,
 
   return i;
 }
 
   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;
+}
index 5a35034..52020c1 100644 (file)
@@ -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 */
 
       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);          
 
 #ifdef DEBUG
       fprintf(stdout, "%s\n",SMS->MessageText);          
index b17a93e..34d81b7 100644 (file)
@@ -8,9 +8,9 @@
 
 */
 
 
 */
 
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
+#include <string.h>\r
+#include <ctype.h>\r
+#include <time.h>\r
 
 #ifndef WIN32
   #include <sys/types.h>
 
 #ifndef WIN32
   #include <sys/types.h>
   #include <signal.h>
   #include <unistd.h>
   #include <errno.h>
   #include <signal.h>
   #include <unistd.h>
   #include <errno.h>
-#endif
-
-#include "misc.h"
-#include "gsm-common.h"
+#endif\r
+\r
+#include "misc.h"\r
+#include "gsm-common.h"\r
 
 #ifndef HAVE_TIMEOPS
 
 
 #ifndef HAVE_TIMEOPS
 
index 43beca6..106b367 100644 (file)
@@ -867,6 +867,7 @@ int usage(void)
   fprintf(stdout, _(
 "          gnokii --sniff [port]\n"
 "          gnokii --decodefile file\n"
   fprintf(stdout, _(
 "          gnokii --sniff [port]\n"
 "          gnokii --decodefile file\n"
+"          gnokii --getbinringfromfile file name offset file2\n"
   ));
 #endif
 
   ));
 #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
 #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},
 #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 },
 #ifdef DEBUG
     { OPT_SNIFFER,           0, 1, 0 },
     { OPT_DECODEFILE,        1, 1, 0 },
+    { OPT_GETBINRINGFROMFILE,4, 4, 0 },
 #endif
 
     { OPT_SETDATETIME,       0, 5, 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;
 #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
 #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[])
 {
 /* 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 (i<Backup.SIMPhonebookUsed) {
+          if (Backup.SIMPhonebook[i].Location==pbk.Location) {
+            pbk=Backup.SIMPhonebook[i];
+            i++;
+//#ifdef DEBUG
+//            fprintf(stdout,_("Copying from backup\n"));
+//#endif
+          }
+        }
+//#ifdef DEBUG
+//        fprintf(stdout,_("Setting location %i\n"),pbk.Location);
+//#endif
+        GSM->WritePhonebookLocation(&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 (i<Backup.PhonePhonebookUsed) {
+          if (Backup.PhonePhonebook[i].Location==pbk.Location) {
+            pbk=Backup.PhonePhonebook[i];
+            i++;
+//#ifdef DEBUG
+//            fprintf(stdout,_("Copying from backup\n"));
+//#endif
+          }
+        }
+//#ifdef DEBUG
+//        fprintf(stdout,_("Setting location %i\n"),pbk.Location);
+//#endif
+        GSM->WritePhonebookLocation(&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;
 }
 
   return 0;
 }
 
@@ -1321,7 +1459,7 @@ int backupsettings(char *argv[])
 
   fprintf(stderr,_("Backup phonebook from SIM..."));
   Backup.SIMPhonebookUsed=0;
 
   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;
     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_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;
     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"));
 
     } else fprintf(stderr,_("Done\n"));
   } else fprintf(stderr,_("Done\n"));
 
@@ -1442,9 +1579,6 @@ int presskeysequence(char *argv[])
   
   sleep(1);
 
   
   sleep(1);
 
-  /* We need to make sure that the init is finished to avoid interrupted */
-  /* multiframe packets... */
-
   fbusinit(NULL);
   
   for (i=0;i<strlen(argv[0]);i++)
   fbusinit(NULL);
   
   for (i=0;i<strlen(argv[0]);i++)
@@ -1988,11 +2122,8 @@ int getsms(int argc, char *argv[])
      int i;
      
      /* [end] can be only argv[4] */
      int i;
      
      /* [end] can be only argv[4] */
-     if (argv[4][0] == '-') {
-        end_message = start_message;
-     } else {
-        end_message = atoi(argv[4]);
-     }
+     if (argv[4][0] == '-') { end_message = start_message; }
+                       else { end_message = atoi(argv[4]); }
 
      /* parse all options (beginning with '-' */
      while ((i = getopt(argc, argv, "f:")) != -1) {
 
      /* parse all options (beginning with '-' */
      while ((i = getopt(argc, argv, "f:")) != -1) {
@@ -2051,16 +2182,12 @@ int getsms(int argc, char *argv[])
           switch (message.Status)
           {
            case  GSS_SENTREAD:
           switch (message.Status)
           {
            case  GSS_SENTREAD:
-                if (message.folder==0) //GST_INBOX
-                 fprintf(stdout, _("(read)\n"));
-                else
-                 fprintf(stdout, _("(sent)\n"));
+                if (message.folder==0) fprintf(stdout, _("(read)\n")); //GST_INBOX
+                                  else fprintf(stdout, _("(sent)\n"));
                break;
            case  GSS_NOTSENTREAD:
                break;
            case  GSS_NOTSENTREAD:
-                if (message.folder==0) //GST_INBOX
-                 fprintf(stdout, _("(unread)\n"));
-                else
-                 fprintf(stdout, _("(not sent)\n"));
+                if (message.folder==0) fprintf(stdout, _("(unread)\n")); //GST_INBOX
+                                  else fprintf(stdout, _("(not sent)\n"));
                break;
            case  GSS_UNKNOWN:
                fprintf(stdout, _("(not known :-()\n"));
                break;
            case  GSS_UNKNOWN:
                fprintf(stdout, _("(not known :-()\n"));
@@ -2113,16 +2240,12 @@ int getsms(int argc, char *argv[])
          switch (message.Status)
            {
            case  GSS_SENTREAD:
          switch (message.Status)
            {
            case  GSS_SENTREAD:
-                if (message.folder==0) //GST_INBOX
-                 fprintf(stdout, _("(read)\n"));
-                else
-                 fprintf(stdout, _("(sent)\n"));
+                if (message.folder==0) fprintf(stdout, _("(read)\n")); //GST_INBOX
+                                  else fprintf(stdout, _("(sent)\n"));
                break;
            case  GSS_NOTSENTREAD:
                break;
            case  GSS_NOTSENTREAD:
-                if (message.folder==0) //GST_INBOX
-                 fprintf(stdout, _("(unread)\n"));
-                else
-                 fprintf(stdout, _("(not sent)\n"));
+                if (message.folder==0) fprintf(stdout, _("(unread)\n")); //GST_INBOX
+                                  else fprintf(stdout, _("(not sent)\n"));
                break;
             case  GSS_UNKNOWN:
                 fprintf(stdout, _("(not known :-()\n"));
                break;
             case  GSS_UNKNOWN:
                 fprintf(stdout, _("(not known :-()\n"));
@@ -3141,7 +3264,7 @@ int setlogo(int argc, char *argv[])
           bitmap.type=GSM_StartupLogo;
           bitmap.width=84;
           bitmap.height=48;
           bitmap.type=GSM_StartupLogo;
           bitmap.width=84;
           bitmap.height=48;
-         bitmap.size=bitmap.width*bitmap.height/8;
+         bitmap.size=GSM_GetBitmapSize(&bitmap);
           num=argv[1][0]-'0';
           if (num>=1 && num<=3) {
            bitmap.number=num;
           num=argv[1][0]-'0';
           if (num>=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;
          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"))
          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;
          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 ? */
          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;
 
   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);
 
   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, _("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:
       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:
       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;
   }
       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[])
 }
 
 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) {
            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;\r
+               case 2:fprintf(file,_("8"));break;\r
+               case 3:fprintf(file,_("4"));break;\r
+               case 4:fprintf(file,_("2"));break;\r
+               case 5:fprintf(file,_("1"));break;\r
              }
              break;
            }
          }
          if (z>w) fprintf(file,_("1"));
          pause=false;
              }
              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)) {\r
+            case Note_C  :fprintf(file,_("c"));break;\r
+            case Note_Cis:fprintf(file,_("c#"));break;\r
+            case Note_D  :fprintf(file,_("d"));break;\r
+            case Note_Dis:fprintf(file,_("d#"));break;\r
+            case Note_E  :fprintf(file,_("e"));break;\r
+            case Note_F  :fprintf(file,_("f"));break;\r
+            case Note_Fis:fprintf(file,_("f#"));break;\r
+            case Note_G  :fprintf(file,_("g"));break;\r
+            case Note_Gis:fprintf(file,_("g#"));break;\r
+            case Note_A  :fprintf(file,_("a"));break;\r
+            case Note_Ais:fprintf(file,_("a#"));break;\r
+            case Note_H  :fprintf(file,_("h"));break;\r
+            default      :pause=true;fprintf(file,_("p"));break; //Pause ?\r
+          }\r
          w=deflen*1.5;
          for (m=0;m<6;m++) {
            w=w*2;
          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) */
     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\r(50, &CurrentMagicError, 10, 0x40,openbuffer0);
+  openbuffer[4]=1;NULL_SendMessageSequence\r(50, &CurrentMagicError, 10, 0x40,openbuffer);
+  openbuffer[4]=2;NULL_SendMessageSequence\r(50, &CurrentMagicError, 10, 0x40,openbuffer);
+  openbuffer[4]=4;NULL_SendMessageSequence\r(50, &CurrentMagicError, 10, 0x40,openbuffer);
+  openbuffer[4]=8;NULL_SendMessageSequence\r(50, &CurrentMagicError, 10, 0x40,openbuffer);
   if (GSM->SimlockInfo(&siml)!=GE_NONE) {
     fprintf(stderr,_("Error getting simlock info\n"));GSM->Terminate();return -1;
   }
   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;
   }  
   /* Closing simlock with given values */
   closebuffer[4]=1+2+4+8;
-  NULL_SendMessageSequence(50, &CurrentMagicError, 20, 0x40,closebuffer);  
+  NULL_SendMessageSequence\r(50, &CurrentMagicError, 20, 0x40,closebuffer);  
   /* Opening all locks */
   /* 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\r(50, &CurrentMagicError, 10, 0x40,openbuffer0);
+  openbuffer[4]=1;NULL_SendMessageSequence\r(50, &CurrentMagicError, 10, 0x40,openbuffer);
+  openbuffer[4]=2;NULL_SendMessageSequence\r(50, &CurrentMagicError, 10, 0x40,openbuffer);
+  openbuffer[4]=4;NULL_SendMessageSequence\r(50, &CurrentMagicError, 10, 0x40,openbuffer);
+  openbuffer[4]=8;NULL_SendMessageSequence\r(50, &CurrentMagicError, 10, 0x40,openbuffer);
   GSM->Reset(0x03);
   GSM->Terminate();
   return 0;
   GSM->Reset(0x03);
   GSM->Terminate();
   return 0;
@@ -7881,7 +7974,7 @@ int geteeprom()
     
     if ((i/256)!=((i-1)/256)) fprintf(stderr,_("."));
     
     
     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)\r      break;
 
     i=i+0x10;
   }
 
     i=i+0x10;
   }
@@ -8682,7 +8775,7 @@ int savephonebookentry(int argc, char *argv[])
     case GE_NONE:
 
       /* Put entry into SMS structure */
     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);
         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 */
     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);
         GSM_SavePhonebookEntryToSMS(&MultiSMS,&entry,21);
       } else {
         GSM_SavePhonebookEntryToSMS(&MultiSMS,&entry,10);
@@ -8746,3 +8839,75 @@ int sendphonebookentry(int argc, char *argv[])
 
   return 0;
 }
 
   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
index 0ab7718..7f45115 100644 (file)
@@ -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_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_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_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*/
   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_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_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*/
   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_STARTUP,
   FN_PROFILES,
   FN_RINGTONES,
-  FN_WAP
+  FN_WAP,
+  FN_RINGNUMBER
 } featnum_index;
 
 /* For models table */
 typedef struct {
   char *model;
   char *number;
 } featnum_index;
 
 /* For models table */
 typedef struct {
   char *model;
   char *number;
-  feat_index features[17];  
+  feat_index features[18];  
 } OnePhoneModel;
 
 extern char *GetModelName ();
 } OnePhoneModel;
 
 extern char *GetModelName ();
index f65acc2..9d40713 100644 (file)
@@ -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);
 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
 
 #endif
index c91a4c5..e0abef1 100644 (file)
@@ -69,8 +69,8 @@
 #define GSM_MAX_REVISION_LENGTH (20)
 #define GSM_MAX_MODEL_LENGTH    (10)
 
 #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 */\r
+#define NM_MAX_SCREEN_WIDTH 75\r
 
 /* Power source types */
 typedef enum {
 
 /* 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_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_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,
   GE_NOACCESS,
   GE_USERCANCELED,
   GE_MEMORYFULL,
index 92e439e..948966d 100644 (file)
@@ -191,4 +191,6 @@ int RingingToneMenu(int code);
 
 int NumberOfRingtones();
 
 
 int NumberOfRingtones();
 
+GSM_Error GSM_GetPhoneRingtone(GSM_BinRingtone *ringtone,GSM_Ringtone *SMringtone);
+
 #endif /* __gsm_ringtones_h */
 #endif /* __gsm_ringtones_h */
index d7c5f78..39ef62b 100644 (file)
@@ -251,7 +251,7 @@ static void OkEditEntryDialog (GtkWidget *widget, gpointer data)
             max_phonebook_name_length);
     entry->entry.Name[max_phonebook_name_length] = '\0';
 
             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
     {
     }
     else
@@ -297,7 +297,7 @@ because you save it into SIM memory!"));
       gtk_widget_show (errorDialog.dialog);
     }
 
       gtk_widget_show (errorDialog.dialog);
     }
 
-    if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
+    if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT)
     {
     }
     else
     {
     }
     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';
 
               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
       {
       }
       else
@@ -356,7 +356,7 @@ because you save it into SIM memory!"));
         gtk_widget_show (errorDialog.dialog);
       }
 
         gtk_widget_show (errorDialog.dialog);
       }
 
-      if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
+      if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT)
       {
       }
       else
       {
       }
       else
@@ -473,7 +473,7 @@ static void OkNewEntryDialog(GtkWidget *widget, gpointer data )
             max_phonebook_name_length);
     entry->entry.Name[max_phonebook_name_length] = '\0';
 
             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
     {
     }
     else
@@ -511,7 +511,7 @@ because you save it into SIM memory!"));
       gtk_widget_show (errorDialog.dialog);
     }
 
       gtk_widget_show (errorDialog.dialog);
     }
 
-    if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
+    if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT)
     {
     }
     else
     {
     }
     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';
 
               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
       {
       }
       else
@@ -562,7 +562,7 @@ because you save it into SIM memory!"));
         gtk_widget_show (errorDialog.dialog);
       }
 
         gtk_widget_show (errorDialog.dialog);
       }
 
-      if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
+      if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT)
       {
       }
       else
       {
       }
       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);
 
   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 ("");
   {
     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);
   }
 
     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);
 
     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);
 
 
   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);
     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), "");
   
 
   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), "");
     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);
 
 
   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);
     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 */
     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)
       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 */
       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)
       {
         for (j = 0; j < pbEntry->entry.SubEntriesCount; j++)
           if (pbEntry->entry.SubEntries[j].EntryType==GSM_Number)
index 5f806cf..61a6ae9 100644 (file)
@@ -994,7 +994,7 @@ static void SetLogoEvent(GtkWidget *widget) {
 
 static void ClearLogoEvent(GtkWidget *widget) {
   
 
 static void ClearLogoEvent(GtkWidget *widget) {
   
-  bitmap.size=bitmap.width*bitmap.height/8;
+  bitmap.size=GSM_GetBitmapSize(&bitmap);
   
   GSM_ClearBitmap(&bitmap);
 
   
   GSM_ClearBitmap(&bitmap);
 
index a9726b9..d5da1f4 100644 (file)
@@ -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.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)\r Multisms.SMS[j].Class = 0;\r
 
       Multisms.SMS[j].Validity = Multisms.SMS[j].MessageCenter.Validity;
 
 
       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);
 
   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)"));\r
+  gtk_box_pack_start (GTK_BOX (vbox), sendSMS.class, FALSE, FALSE, 3);\r
+  gtk_widget_show (sendSMS.class);\r
 
   label = gtk_label_new (_("SMS Center:"));
   gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 1);
 
   label = gtk_label_new (_("SMS Center:"));
   gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 1);