X-Git-Url: http://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=common%2Fgsm-api.c;h=3c090a0d778e0c1519053c9daa500f41a820d773;hp=5a91da95607ed0d00be4f9727759baec2b398500;hb=253a25e0c1db3361620a7a14ca8249f072472299;hpb=5d49fe8eea4e11457b4f9904eb0d5db435679841 diff --git a/common/gsm-api.c b/common/gsm-api.c index 5a91da9..3c090a0 100644 --- a/common/gsm-api.c +++ b/common/gsm-api.c @@ -30,6 +30,7 @@ #include "gsm-api.h" +#include "newmodules/n3110.h" #include "newmodules/n6110.h" #include "newmodules/n7110.h" #include "newmodules/newat.h" @@ -38,6 +39,7 @@ #endif #include "protocol/fbusirda.h" #include "protocol/fbus.h" +#include "protocol/fbus3110.h" #include "protocol/mbus.h" #include "protocol/at.h" #include "files/cfgreader.h" @@ -247,6 +249,9 @@ bool CheckModel (GSM_Information InfoToCheck, char *model, GSM_ConnectionType co if (strstr(InfoToCheck.TekramModels, model) != NULL) { if (connection==GCT_Tekram) found_match=true; } + if (strstr(InfoToCheck.FBUS3110Models, model) != NULL) { + if (connection==GCT_FBUS3110) found_match=true; + } return found_match; } @@ -298,7 +303,8 @@ GSM_Error TryNewNokia(char *model, char *device, char *initlength, GSM_Connectio while (N6110_GetModel(phonemodel) != GE_NONE) sleep(1); - if (!strcmp(phonemodel,"NPE-3") || !strcmp(phonemodel,"NSE-5")) + if (!strcmp(phonemodel,"NPE-3") || !strcmp(phonemodel,"NSE-5") || + !strcmp(phonemodel,"NHM-3")) { GSM->Terminate(); @@ -426,7 +432,7 @@ GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_Connec 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; + case GCT_FBUS3110: Protocol = &FBUS3110_Functions;break; } CurrentConnectionType=connection; connection2=connection; @@ -452,6 +458,13 @@ GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_Connec } #endif + if (CheckModel (N3110_Information, model, connection)) { + /* Set pointers to relevant addresses */ + GSM = &N3110_Functions; + GSM_Info = &N3110_Information; + GSM_LinkOK = &CurrentLinkOK; + found_match=true; + } if (CheckModel (N6110_Information, model, connection)) { /* Set pointers to relevant addresses */ GSM = &N6110_Functions; @@ -483,7 +496,7 @@ GSM_Error GSM_Initialise(char *model, char *device, char *initlength, GSM_Connec 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; + case GCT_FBUS3110: Protocol = &FBUS3110_Functions;break; } } else return GE_NOTSUPPORTED; @@ -617,6 +630,7 @@ GSM_ConnectionType GetConnectionTypeFromString(char *Connection) { if (!strcmp(Connection, "infrared")) connection=GCT_Infrared; if (!strcmp(Connection, "mbus")) connection=GCT_MBUS; if (!strcmp(Connection, "dlr3")) connection=GCT_DLR3; + if (!strcmp(Connection, "fbus3110")) connection=GCT_FBUS3110; if (!strcmp(Connection, "at")) connection=GCT_AT; if (!strcmp(Connection, "tekram210"))connection=GCT_Tekram;