* 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
-0.3.3_pre8-gold_2002_02_16
+0.3.3_pre8-gold_2002_02_24
CurrentRLP_RXCallback = rlp_callback;
CurrentCallPassup=NULL;
+ CurrentCallDivert=NULL;
CurrentPhonebookEntry=NULL;
CurrentNetworkInfo = NULL;
CurrentGetBitmap=NULL;
CurrentRequestTerminate=false;
CurrentDisableKeepAlive=false;
CurrentCalendarNotesInfo.HowMany=2000;
+ CurrentSMSMessage=NULL;
CurrentMagicError = GE_BUSY;
if (!strcmp(model,"auto")) {
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;
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;
+ }
}
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)
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;
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
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) {
return 0;
}
+
{ "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 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 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 50", "Reliance"},
+ { "404 50", "Reliance"},\r
{ "404 52", "Reliance"},
{ "404 56", "Escotel"},
- { "404 60", "AIRCELL"},
+ { "404 60", "AIRCELL"},\r
{ "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" },
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);
/* 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)
}
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 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;
+}
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);
*/
-#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>
#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
fprintf(stdout, _(
" gnokii --sniff [port]\n"
" gnokii --decodefile file\n"
+" gnokii --getbinringfromfile file name offset file2\n"
));
#endif
#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},
#ifdef DEBUG
{ OPT_SNIFFER, 0, 1, 0 },
{ OPT_DECODEFILE, 1, 1, 0 },
+ { OPT_GETBINRINGFROMFILE,4, 4, 0 },
#endif
{ OPT_SETDATETIME, 0, 5, 0 },
#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
/* 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;
}
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.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"));
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++)
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) {
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:
- 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"));
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:
- 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"));
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;
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"))
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_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:
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[])
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;
- 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;
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;
}
}
/* 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 */
- 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;
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;
}
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);
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);
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
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*/
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*/
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 ();
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
#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 {
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,
int NumberOfRingtones();
+GSM_Error GSM_GetPhoneRingtone(GSM_BinRingtone *ringtone,GSM_Ringtone *SMringtone);
+
#endif /* __gsm_ringtones_h */
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
gtk_widget_show (errorDialog.dialog);
}
- if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT)
{
}
else
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
gtk_widget_show (errorDialog.dialog);
}
- if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT)
{
}
else
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
gtk_widget_show (errorDialog.dialog);
}
- if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT)
{
}
else
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
gtk_widget_show (errorDialog.dialog);
}
- if (GetModelFeature(FN_PHONEBOOK)==F_PBK71)
+ if (GetModelFeature(FN_PHONEBOOK)==F_PBK71INT)
{
}
else
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 ("");
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);
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_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_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);
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)
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)
static void ClearLogoEvent(GtkWidget *widget) {
- bitmap.size=bitmap.width*bitmap.height/8;
+ bitmap.size=GSM_GetBitmapSize(&bitmap);
GSM_ClearBitmap(&bitmap);
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;
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);