summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/gsmstate.c
authorzautrix <zautrix>2004-10-05 11:13:51 (UTC)
committer zautrix <zautrix>2004-10-05 11:13:51 (UTC)
commit50ab40e1e02ad7c65c17a78d08116a808b1257aa (patch) (side-by-side diff)
tree0d1939e2297fa7bbd8e1f2030f154463854164c6 /gammu/emb/common/gsmstate.c
parentcf8616f64f20e5448d4ff644f7cc15750cf3f85f (diff)
downloadkdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.zip
kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.tar.gz
kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.tar.bz2
updated to latest gammu version
Diffstat (limited to 'gammu/emb/common/gsmstate.c') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/gsmstate.c74
1 files changed, 53 insertions, 21 deletions
diff --git a/gammu/emb/common/gsmstate.c b/gammu/emb/common/gsmstate.c
index b8f5f89..31e365d 100644
--- a/gammu/emb/common/gsmstate.c
+++ b/gammu/emb/common/gsmstate.c
@@ -185,8 +185,11 @@ GSM_Error GSM_RegisterAllPhoneModules(GSM_StateMachine *s)
#endif
#ifdef GSM_ENABLE_NOKIA3650
GSM_RegisterModule(s,&N3650Phone);
#endif
+#ifdef GSM_ENABLE_NOKIA650
+ GSM_RegisterModule(s,&N650Phone);
+#endif
#ifdef GSM_ENABLE_NOKIA6110
GSM_RegisterModule(s,&N6110Phone);
#endif
#ifdef GSM_ENABLE_NOKIA6510
@@ -209,9 +212,8 @@ GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum)
{
GSM_Error error;
GSM_DateTime time;
int i;
- char Buffer[80];
for (i=0;i<s->ConfigNum;i++) {
s->CurrentConfig = &s->Config[i];
@@ -249,20 +251,18 @@ GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum)
if (error != ERR_NONE) return error;
if (s->di.dl == DL_TEXTALL || s->di.dl == DL_TEXT || s->di.dl == DL_TEXTERROR ||
s->di.dl == DL_TEXTALLDATE || s->di.dl == DL_TEXTDATE || s->di.dl == DL_TEXTERRORDATE) {
- smprintf(s,"[Gammu - version %s built %s %s]\n",VERSION,__TIME__,__DATE__);
- smprintf(s,"[Connection - \"%s\"]\n",s->CurrentConfig->Connection);
+ smprintf(s,"[Gammu - %s built %s %s",VERSION,__TIME__,__DATE__);
+ if (strlen(GetCompiler()) != 0) {
+ smprintf(s," in %s",GetCompiler());
+ }
+ smprintf(s,"]\n[Connection - \"%s\"]\n",s->CurrentConfig->Connection);
smprintf(s,"[Model type - \"%s\"]\n",s->CurrentConfig->Model);
smprintf(s,"[Device - \"%s\"]\n",s->CurrentConfig->Device);
-
- Buffer[0] = 0;
- if (strlen(GetOS()) != 0) sprintf(Buffer,"%s",GetOS());
- if (strlen(GetCompiler()) != 0) {
- if (Buffer[0] != 0) strcat(Buffer+strlen(Buffer),", ");
- strcat(Buffer+strlen(Buffer),GetCompiler());
+ if (strlen(GetOS()) != 0) {
+ smprintf(s,"[Run on - %s]\n",GetOS());
}
- if (Buffer[0] != 0) smprintf(s,"[OS/compiler - %s]\n",Buffer);
}
if (s->di.dl==DL_BINARY) {
smprintf(s,"%c",((unsigned char)strlen(VERSION)));
smprintf(s,"%s",VERSION);
@@ -553,8 +553,9 @@ static GSM_Error CheckReplyFunctions(GSM_StateMachine *s, GSM_Reply_Function *Re
GSM_Protocol_Message *msg = s->Phone.Data.RequestMsg;
bool execute;
bool available = false;
int i = 0;
+// int j;
while (Reply[i].requestID!=ID_None) {
execute=false;
/* Binary frames like in Nokia */
@@ -567,10 +568,20 @@ static GSM_Error CheckReplyFunctions(GSM_StateMachine *s, GSM_Reply_Function *Re
}
} else execute=true;
}
} else {
- if (strncmp(Reply[i].msgtype,msg->Buffer,strlen(Reply[i].msgtype))==0) {
- execute=true;
+// 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) {
@@ -844,30 +855,33 @@ bool GSM_ReadConfig(INI_Section *cfg_info, GSM_Config *cfg, int num)
return true;
}
static OnePhoneModel allmodels[] = {
+#ifdef GSM_ENABLE_NOKIA650
+ {"0650" ,"THF-12","", {0}},
+#endif
#ifdef GSM_ENABLE_NOKIA6510
- {"1100", "RH-18" ,"", {0}},
+ {"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}},
- {"3100b","RH-50" ,"", {F_PBKTONEGAL,F_PBKSMSLIST,0}},
+ {"3100" ,"RH-19" ,"", {F_PBKTONEGAL,F_PBKSMSLIST,0}},//fixme
+ {"3100b","RH-50" ,"", {F_PBKTONEGAL,F_PBKSMSLIST,0}},//fixme
{"3108", "RH-6", "Nokia 3108", {0}}, //does it have irda ?
- {"3200", "RH-30" ,"Nokia 3200", {F_PBKTONEGAL,0}},
- {"3200a","RH-31" ,"Nokia 3200", {F_PBKTONEGAL,0}},
+ {"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}},
- {"3300" ,"NEM-2" ,"Nokia 3300", {F_PBKTONEGAL,0}},
+ {"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
@@ -897,8 +911,10 @@ static OnePhoneModel allmodels[] = {
#if defined(GSM_ENABLE_ATGEN) || defined(GSM_ENABLE_NOKIA6510)
{"5100" ,"NPM-6" ,"Nokia 5100", {F_PBKTONEGAL,F_TODO66,F_RADIO,0}},
{"5100" ,"NPM-6U","Nokia 5100", {F_PBKTONEGAL,F_TODO66,F_RADIO,0}},
{"5100" ,"NPM-6X","Nokia 5100", {F_PBKTONEGAL,F_TODO66,F_RADIO,0}},
+ {"5140" ,"NPL-4" ,"Nokia 5140", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKUSER,F_WAPMMSPROXY,0}},
+ {"5140" ,"NPL-5" ,"Nokia 5140", {F_PBKTONEGAL,F_TODO66,F_RADIO,F_PBKUSER,F_WAPMMSPROXY,0}},
#endif
#ifdef GSM_ENABLE_NOKIA6110
{"5110" ,"NSE-1" ,"", {F_NOWAP,F_NOCALLER,F_NORING,F_NOPICTURE,F_NOSTARTUP,F_NOCALENDAR,F_NOPBKUNICODE,F_PROFILES51,F_MAGICBYTES,F_DISPSTATUS,0}},
{"5110i","NSE-2" ,"", {F_NOWAP,F_NOCALLER,F_NORING,F_NOPICTURE,F_NOSTARTUP,F_NOCALENDAR,F_NOPBKUNICODE,F_PROFILES51,F_MAGICBYTES,F_DISPSTATUS,0}},
@@ -921,29 +937,33 @@ static OnePhoneModel allmodels[] = {
{"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,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,0}},
+ {"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
#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}},
@@ -974,10 +994,12 @@ static OnePhoneModel allmodels[] = {
{"9210i","RAE-5" ,"", {0}},
#endif
#ifdef GSM_ENABLE_ATGEN
{"at" , "at", "", {0}},
+ /* Siemens */
{"M20" , "M20", "", {F_M20SMS,F_SLOWWRITE,0}},
{"MC35" , "MC35", "", {0}},
+ {"TC35" , "TC35", "", {0}},
{"S25", "S25", "SIEMENS S25", {0}},
{"C35i" , "C35i", "", {0}},
{"S35i" , "S35i", "", {0}},
{"M35i" , "M35i", "", {0}},
@@ -990,8 +1012,17 @@ static OnePhoneModel allmodels[] = {
{"M50" , "M50", "", {0}},
{"S45" , "6618" , "", {0}},
{"ME45" , "3618" , "", {0}},
{"S55" , "S55" , "", {0}},
+ /* Samsung */
+ {"S100" , "SGH-S100" , "", {0}},
+ {"S200" , "SGH-S200" , "", {0}},
+ {"S300" , "SGH-S300" , "", {0}},
+ {"S500" , "SGH-S500" , "", {0}},
+ {"V200" , "SGH-V200" , "", {0}},
+ {"T100" , "SGH-T100" , "", {0}},
+ {"E700" , "SGH-E700" , "", {0}},
+ /* Ericsson/Sony Ericsson */
{"T28s", "1101101-BVT28s","", {0}},
{"R320s" , "1101201-BV R320s","", {0}},
{"R380s", "7100101-BVR380s" ,"", {0}},
{"R520m", "1130101-BVR520m" ,"", {0}},
@@ -1003,8 +1034,9 @@ static OnePhoneModel allmodels[] = {
{"T200", "1130501-BVT200" ,"", {0}},
{"T300", "1130601-BVT300" ,"T300", {0}},
{"T310", "1130602-BVT310" ,"", {0}},
{"P800", "7130501-BVP800" ,"", {0}},
+ /* Other */
{"iPAQ" , "iPAQ" , "" , {0}},
{"A2D" , "A2D" , "" , {0}},
{"9210" , "RAE-3", "Nokia Communicator GSM900/1800",{0}},
{"myV-65", "myV-65 GPRS", "", {F_SMSME900,0}},