summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/gsmstate.c
authorzautrix <zautrix>2004-10-25 08:56:23 (UTC)
committer zautrix <zautrix>2004-10-25 08:56:23 (UTC)
commit62e92aa86b6281b4e4c2a2bdb57f3ceb5a87f4e3 (patch) (side-by-side diff)
treec2b7a41b0c8fffdc0786b84ff86724ea8f08d6a1 /gammu/emb/common/gsmstate.c
parentfeff0930372dd51af24dc3b46697e70838277ea5 (diff)
downloadkdepimpi-62e92aa86b6281b4e4c2a2bdb57f3ceb5a87f4e3.zip
kdepimpi-62e92aa86b6281b4e4c2a2bdb57f3ceb5a87f4e3.tar.gz
kdepimpi-62e92aa86b6281b4e4c2a2bdb57f3ceb5a87f4e3.tar.bz2
gammu updates
Diffstat (limited to 'gammu/emb/common/gsmstate.c') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/gsmstate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gammu/emb/common/gsmstate.c b/gammu/emb/common/gsmstate.c
index 31e365d..c65dc01 100644
--- a/gammu/emb/common/gsmstate.c
+++ b/gammu/emb/common/gsmstate.c
@@ -525,65 +525,65 @@ GSM_Error GSM_WaitFor (GSM_StateMachine *s, unsigned char *buffer,
if (Phone->StartInfoCounter == 0) s->Phone.Functions->ShowStartInfo(s,false);
}
}
Phone->RequestID = request;
Phone->DispatchError = ERR_TIMEOUT;
for (reply=0;reply<s->ReplyNum;reply++) {
if (reply!=0) {
if (s->di.dl==DL_TEXT || s->di.dl==DL_TEXTALL || s->di.dl == DL_TEXTERROR ||
s->di.dl==DL_TEXTDATE || s->di.dl==DL_TEXTALLDATE || s->di.dl == DL_TEXTERRORDATE)
{
smprintf(s, "[Retrying %i type 0x%02X]\n", reply, type);
}
}
error = s->Protocol.Functions->WriteMessage(s, buffer, length, type);
if (error!=ERR_NONE) return error;
error = GSM_WaitForOnce(s, buffer, length, type, time);
if (error != ERR_TIMEOUT) return error;
}
return Phone->DispatchError;
}
static GSM_Error CheckReplyFunctions(GSM_StateMachine *s, GSM_Reply_Function *Reply, int *reply)
{
GSM_Phone_Data *Data = &s->Phone.Data;
GSM_Protocol_Message *msg = s->Phone.Data.RequestMsg;
bool execute;
bool available = false;
int i = 0;
-// int j;
+// int j;
while (Reply[i].requestID!=ID_None) {
execute=false;
/* Binary frames like in Nokia */
if (strlen(Reply[i].msgtype) < 2) {
if (Reply[i].msgtype[0]==msg->Type) {
if (Reply[i].subtypechar!=0) {
if (Reply[i].subtypechar<=msg->Length) {
if (msg->Buffer[Reply[i].subtypechar]==Reply[i].subtype)
execute=true;
}
} else execute=true;
}
} else {
// printf("msg length %i %i\n",strlen(Reply[i].msgtype),msg->Length);
if ((int)strlen(Reply[i].msgtype)<msg->Length) {
// printf("Comparing \"%s\" and \"",Reply[i].msgtype);
// for (j=0;j<strlen(Reply[i].msgtype);j++) {
// if (msg->Buffer[j]!=13 && msg->Buffer[j]!=10) {
// printf("%c",msg->Buffer[j]);
// }
// }
// printf("\"\n");
if (strncmp(Reply[i].msgtype,msg->Buffer,strlen(Reply[i].msgtype))==0) {
execute=true;
}
}
}
if (execute) {
*reply=i;
if (Reply[i].requestID == ID_IncomingFrame ||
@@ -841,64 +841,65 @@ bool GSM_ReadConfig(INI_Section *cfg_info, GSM_Config *cfg, int num)
Temp = INI_GetValue(cfg_info, section, "logformat", false);
if (!Temp) {
strcpy(cfg->DebugLevel,DefaultDebugLevel);
} else {
cfg->DefaultDebugLevel = false;
strcpy(cfg->DebugLevel,Temp);
}
cfg->StartInfo = INI_GetValue(cfg_info, section, "startinfo", false);
if (!cfg->StartInfo) {
free(cfg->StartInfo);
cfg->StartInfo = strdup(DefaultStartInfo);
} else {
cfg->DefaultStartInfo = false;
}
return true;
}
static OnePhoneModel allmodels[] = {
#ifdef GSM_ENABLE_NOKIA650
{"0650" ,"THF-12","", {0}},
#endif
#ifdef GSM_ENABLE_NOKIA6510
{"1100" ,"RH-18" ,"", {0}},
{"1100a","RH-38" ,"", {0}},
{"1100b","RH-36" ,"", {0}},
#endif
#ifdef GSM_ENABLE_NOKIA6110
{"2100" ,"NAM-2" ,"", {F_NOWAP,F_NOCALLER,F_RING_SM,F_CAL33,F_POWER_BATT,F_PROFILES33,F_NOCALLINFO,F_NODTMF,0}},//quess
#endif
#ifdef GSM_ENABLE_NOKIA6510
{"3100" ,"RH-19" ,"", {F_PBKTONEGAL,F_PBKSMSLIST,0}},//fixme
{"3100b","RH-50" ,"", {F_PBKTONEGAL,F_PBKSMSLIST,0}},//fixme
+ {"3105" ,"RH-48" ,"Nokia 3105", {F_PBKTONEGAL,F_PBKSMSLIST,F_VOICETAGS,0}},//fixme
{"3108", "RH-6", "Nokia 3108", {0}}, //does it have irda ?
{"3200", "RH-30" ,"Nokia 3200", {F_PBKTONEGAL,0}},//fixme
{"3200a","RH-31" ,"Nokia 3200", {F_PBKTONEGAL,0}},//fixme
#endif
#ifdef GSM_ENABLE_NOKIA6110
{"3210" ,"NSE-8" ,"", {F_NOWAP,F_NOCALLER,F_NOCALENDAR,F_NOPBKUNICODE,F_POWER_BATT,F_PROFILES51,F_NOPICTUREUNI,F_NOCALLINFO,F_NODTMF,0}},
{"3210" ,"NSE-9" ,"", {F_NOWAP,F_NOCALLER,F_NOCALENDAR,F_NOPBKUNICODE,F_POWER_BATT,F_PROFILES51,F_NOPICTUREUNI,F_NOCALLINFO,F_NODTMF,0}},
#endif
#ifdef GSM_ENABLE_NOKIA6510
{"3300" ,"NEM-1" ,"Nokia 3300", {F_PBKTONEGAL,0}},//fixme
{"3300" ,"NEM-2" ,"Nokia 3300", {F_PBKTONEGAL,0}},//fixme
#endif
#ifdef GSM_ENABLE_NOKIA6110
{"3310" ,"NHM-5" ,"", {F_NOWAP,F_NOCALLER,F_RING_SM,F_CAL33,F_POWER_BATT,F_PROFILES33,F_NOCALLINFO,F_NODTMF,0}},
#endif
#ifdef GSM_ENABLE_NOKIA3320
{"3320" ,"NPC-1" ,"Nokia 3320", {F_CAL62,F_DAYMONTH,0}},//fixme
#endif
#ifdef GSM_ENABLE_NOKIA6110
{"3330" ,"NHM-6" ,"", {F_NOCALLER,F_RING_SM,F_CAL33,F_PROFILES33,F_NOPICTUREUNI,F_NOCALLINFO,F_NODTMF,0}},
{"3390" ,"NPB-1" ,"", {F_NOWAP,F_NOCALLER,F_RING_SM,F_CAL33,F_PROFILES33,F_NOPICTUREUNI,F_NOCALLINFO,F_NODTMF,0}},
{"3410" ,"NHM-2" ,"", {F_RING_SM,F_CAL33,F_PROFILES33,F_NOCALLINFO,F_NODTMF,0}},
#endif
#ifdef GSM_ENABLE_NOKIA6510
{"3510" ,"NHM-8" ,"", {F_CAL35,F_PBK35,F_NOGPRSPOINT,F_VOICETAGS,0}},
{"3510i","RH-9" ,"", {F_CAL35,F_PBK35,F_NOGPRSPOINT,F_VOICETAGS,0}},
{"3530" ,"RH-9" ,"", {F_CAL35,F_PBK35,F_NOGPRSPOINT,F_VOICETAGS,0}},
{"3589i","RH-44" ,"", {F_VOICETAGS,0}},
{"3590" ,"NPM-8" ,"", {0}},//irda?
{"3595" ,"NPM-10" ,"", {0}},//irda?
#endif
#ifdef GSM_ENABLE_NOKIA6110
@@ -925,66 +926,66 @@ static OnePhoneModel allmodels[] = {
{"5210" ,"NSM-5" ,"Nokia 5210", {F_CAL52,F_NOSTARTANI,F_NOPICTUREUNI,F_NODTMF,0}},
#endif
#ifdef GSM_ENABLE_NOKIA6110
{"5510" ,"NPM-5" ,"", {F_NOCALLER,F_PROFILES33,F_NOPICTUREUNI,0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6510)
{"6100" ,"NPL-2" ,"Nokia 6100", {F_PBKTONEGAL,F_TODO66,0}},
#endif
#ifdef GSM_ENABLE_NOKIA6110
{"6110" ,"NSE-3" ,"", {F_NOWAP,F_NOPICTURE,F_NOSTARTANI,F_NOPBKUNICODE,F_MAGICBYTES,F_DISPSTATUS,0}},
{"6130" ,"NSK-3" ,"", {F_NOWAP,F_NOPICTURE,F_NOSTARTANI,F_NOPBKUNICODE,F_MAGICBYTES,F_DISPSTATUS,0}},
{"6150" ,"NSM-1" ,"", {F_NOWAP,F_NOSTARTANI,F_NOPBKUNICODE,F_MAGICBYTES,F_DISPSTATUS,F_NOPICTUREUNI,0}},
{"6190" ,"NSB-3" ,"", {F_NOWAP,F_NOPICTURE,F_NOSTARTANI,F_NOPBKUNICODE,F_MAGICBYTES,F_DISPSTATUS,0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6510)
{"6200" ,"NPL-3" ,"Nokia 6200", {F_PBKTONEGAL,0}},
{"6220" ,"RH-20" ,"Nokia 6220", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKSMSLIST,F_PBKUSER,F_WAPMMSPROXY,F_NOTES,0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA7110)
{"6210" ,"NPE-3" ,"Nokia 6210", {F_VOICETAGS,F_CAL62,0}},
{"6250" ,"NHM-3" ,"Nokia 6250", {F_VOICETAGS,F_CAL62,0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6510)
{"6230" ,"RH-12" ,"Nokia 6230", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKSMSLIST,F_PBKUSER,F_WAPMMSPROXY,F_NOTES,0}},
{"6310" ,"NPE-4" ,"Nokia 6310", {F_TODO63,F_CAL65,F_NOMIDI,F_NOMMS,F_VOICETAGS,0}},
{"6310i","NPL-1" ,"Nokia 6310i",{F_TODO63,F_CAL65,F_NOMIDI,F_BLUETOOTH,F_NOMMS,F_VOICETAGS,0}},
{"6385" ,"NHP-2AX","Nokia 6385",{F_TODO63,F_CAL65,F_NOMIDI,F_NOMMS,F_VOICETAGS,0}},
{"6510" ,"NPM-9" ,"Nokia 6510", {F_TODO63,F_CAL65,F_NOMIDI,F_RADIO,F_NOFILESYSTEM,F_NOMMS,F_VOICETAGS,0}},
{"6610" ,"NHL-4U","Nokia 6610", {F_PBKTONEGAL,F_TODO66,F_RADIO,0}},
{"6610i","RM-37" ,"Nokia 6610i",{F_PBKTONEGAL,F_TODO66,F_RADIO,0}},
{"6800" ,"NSB-9" ,"Nokia 6800", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKSMSLIST,0}},
{"6800" ,"NHL-6" ,"Nokia 6800", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKSMSLIST,0}},
- {"6810" ,"RM-2" ,"Nokia 6810", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKSMSLIST,0}},//quess
- {"6820" ,"NHL-9" ,"Nokia 6820", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKSMSLIST,0}},//quess
+ {"6810" ,"RM-2" ,"Nokia 6810", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKSMSLIST,F_NOTES,0}},//quess
+ {"6820" ,"NHL-9" ,"Nokia 6820", {F_PBKTONEGAL,F_TODO66,F_PBKSMSLIST,F_NOTES,0}},//quess
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA7110)
{"7110" ,"NSE-5" ,"Nokia 7110", {F_CAL62,0}},
{"7190" ,"NSB-5" ,"Nokia 7190", {F_CAL62,0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6510)
{"7200" ,"RH-23" ,"Nokia 7200", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKSMSLIST,F_PBKUSER,0}},//quess
{"7210" ,"NHL-4" ,"Nokia 7210", {F_PBKTONEGAL,F_TODO66,F_RADIO,0}},
{"7250" ,"NHL-4J","Nokia 7250", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKIMG,0}},
{"7250i","NHL-4JX","Nokia 7250i",{F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKIMG,0}},
{"7600", "NMM-3", "Nokia 7600", {F_TODO66,0}},
#endif
#if defined(GSM_ENABLE_ATGEN)
{"7650" ,"NHL-2" ,"Nokia 7650", {0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6110)
{"8210" ,"NSM-3" ,"Nokia 8210", {F_NOWAP,F_NOSTARTANI,F_NOPBKUNICODE,F_NOPICTUREUNI,0}},
{"8250" ,"NSM-3D","Nokia 8250", {F_NOWAP,F_NOSTARTANI,F_CAL82,F_NOPICTUREUNI,0}},
{"8290" ,"NSB-7" ,"Nokia 8290", {F_NOWAP,F_NOSTARTANI,F_NOPBKUNICODE,F_NOPICTUREUNI,0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6510)
{"8310" ,"NHM-7" ,"Nokia 8310", {F_CAL62,F_NOMIDI,F_RADIO,F_NOFILESYSTEM,F_NOMMS,F_VOICETAGS,0}},
{"8390" ,"NSB-8" ,"Nokia 8390", {F_CAL62,F_NOMIDI,F_RADIO,F_NOFILESYSTEM,F_NOMMS,F_VOICETAGS,0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6110)
{"8850" ,"NSM-2" ,"Nokia 8850", {0}},
{"8855" ,"NSM-4" ,"Nokia 8855", {0}},
{"8890" ,"NSB-6" ,"Nokia 8890", {0}},
#endif
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6510)
{"8910" ,"NHM-4" ,"Nokia 8910", {F_CAL62,F_NOMIDI,F_NOFILESYSTEM,F_NOMMS,0}},
{"8910i","NHM-4" ,"Nokia 8910i",{F_CAL62,F_NOMIDI,F_NOFILESYSTEM,F_NOMMS,0}},