summaryrefslogtreecommitdiff
path: root/libgammu
diff options
context:
space:
mode:
Diffstat (limited to 'libgammu')
-rw-r--r--libgammu/gsmphones.c8
-rw-r--r--libgammu/misc/misc.c2
-rw-r--r--libgammu/phone/at/at-sms.c2
-rw-r--r--libgammu/phone/at/atgen.c29
-rw-r--r--libgammu/phone/nokia/dct3/dct3func.c3
-rw-r--r--libgammu/phone/nokia/dct3/n7110.c3
-rw-r--r--libgammu/phone/nokia/nfuncold.c2
-rw-r--r--libgammu/phone/nokia/wd2/n3650.c65
-rw-r--r--libgammu/phone/obex/obexgen.c1
-rw-r--r--libgammu/protocol/at/at.c7
-rw-r--r--libgammu/service/backup/backtext.c1
-rw-r--r--libgammu/service/gsmdata.c2
-rw-r--r--libgammu/service/gsmring.c2
-rw-r--r--libgammu/service/sms/gsmmulti.c6
14 files changed, 105 insertions, 28 deletions
diff --git a/libgammu/gsmphones.c b/libgammu/gsmphones.c
index 93b4926..f19c1cf 100644
--- a/libgammu/gsmphones.c
+++ b/libgammu/gsmphones.c
@@ -129,6 +129,7 @@ GSM_FeatureName AllFeatureNames[] = {
{"RESET_AFTER_TIMEOUT", F_RESET_AFTER_TIMEOUT},
{"HUAWEI_INIT", F_HUAWEI_INIT},
{"ZTE_INIT", F_ZTE_INIT},
+ {"USSD_GSM_CHARSET", F_USSD_GSM_CHARSET},
{"", 0},
};
@@ -405,6 +406,7 @@ GSM_PhoneModel allmodels[] = {
{"C2-01","RM-721","Nokia C2-01", {F_SERIES40_30,F_FILES2,F_TODO66,F_RADIO,F_NOTES,F_SMS_FILES,F_6230iCALLER,0}},/* fixme */
{"200", "RM-761","Nokia Asha 200", {F_SERIES40_30,F_FILES2,F_TODO66,F_RADIO,F_NOTES,F_SMS_FILES,F_6230iCALLER,0}},/* fixme */
{"306","RM-767","Nokia Asha 306", {F_SERIES40_30,F_FILES2,F_TODO66,F_RADIO,F_NOTES,F_SMS_FILES,F_6230iCALLER,0}},/* fixme */
+ {"105","RM-1135","Nokia 105", {F_SERIES40_30,F_FILES2,F_TODO66,F_RADIO,F_NOTES,F_SMS_FILES,F_6230iCALLER,0}},/* fixme */
{"112","RM-837","Nokia 112", {F_SERIES40_30,F_FILES2,F_TODO66,F_RADIO,F_NOTES,F_SMS_FILES,F_6230iCALLER,0}},/* fixme */
{"C3" ,"RM-614","Nokia C3", {F_SERIES40_30,F_FILES2,F_TODO66,F_RADIO,F_NOTES,F_SMS_FILES,F_6230iCALLER,0}},/* fixme */
{"X2-00","RM-618","Nokia X2-00", {F_SERIES40_30,F_FILES2,F_TODO66,F_RADIO,F_NOTES,F_SMS_FILES,F_6230iCALLER,0}},/* guess */
@@ -958,9 +960,11 @@ GSM_PhoneModel allmodels[] = {
{"E173", "E173", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"E180", "E180", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"E367", "E367", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
+ {"E1552", "E1552", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"E1556", "E1556", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"E1550", "E1550", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"E1750", "E1750", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, 0}},
+ {"E1780", "E1780", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"E1752", "E1752", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, 0}},
{"E1756", "E1756", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"E303", "E303", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
@@ -976,6 +980,9 @@ GSM_PhoneModel allmodels[] = {
{"K3770", "K3770", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"K4505", "K4505", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
{"K4511", "K4511", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}},
+ /* Telit */
+ {"HE910-D", "HE910-D", "", {F_USSD_GSM_CHARSET, 0}},
+ {"HE910", "HE910", "", {F_USSD_GSM_CHARSET, 0}},
/* ZTE */
{"MF100", "MF100", "", {F_ZTE_INIT, 0}},
@@ -992,6 +999,7 @@ GSM_PhoneModel allmodels[] = {
/* Other */
{"SIMCOM_SIM300D","SIMCOM_SIM300D","", {F_ENCODED_USSD, 0}},
{"SIMCOM_SIM900","SIMCOM_SIM900","", {0}},
+ {"Quectel_M35", "Quectel_M35","", {0}},
/* Qualcomm */
{"HP un2420 Mobile Broadband Module", "un2420", "", {F_NO_STOP_CUSD, 0}},
diff --git a/libgammu/misc/misc.c b/libgammu/misc/misc.c
index ced397b..ffa5a65 100644
--- a/libgammu/misc/misc.c
+++ b/libgammu/misc/misc.c
@@ -544,7 +544,7 @@ const char *GetOS(void)
struct utsname Ver;
# endif
#endif
- static char Buffer[100] = {0x00};
+ static char Buffer[240] = {0x00};
/* Value was already calculated */
if (Buffer[0] != 0) return Buffer;
diff --git a/libgammu/phone/at/at-sms.c b/libgammu/phone/at/at-sms.c
index 7cccfb1..7953616 100644
--- a/libgammu/phone/at/at-sms.c
+++ b/libgammu/phone/at/at-sms.c
@@ -889,6 +889,7 @@ GSM_Error ATGEN_ReplyGetSMSMessage(GSM_Protocol_Message *msg, GSM_StateMachine *
}
break;
}
+ FALLTHROUGH;
case SMS_Coding_Unicode_No_Compression:
case SMS_Coding_8bit:
if ((firstbyte & 0x40)==0x40 && GSM_IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_SMS_UTF8_ENCODED)) {
@@ -1716,6 +1717,7 @@ GSM_Error ATGEN_MakeSMSFrame(GSM_StateMachine *s, GSM_SMSMessage *message, unsig
}
break;
}
+ FALLTHROUGH;
case SMS_Coding_Unicode_No_Compression:
case SMS_Coding_8bit:
error = PHONE_EncodeSMSFrame(s,message,buffer,PHONE_SMSDeliver,current,TRUE);
diff --git a/libgammu/phone/at/atgen.c b/libgammu/phone/at/atgen.c
index 29ee97e..8d9ac36 100644
--- a/libgammu/phone/at/atgen.c
+++ b/libgammu/phone/at/atgen.c
@@ -1618,7 +1618,7 @@ GSM_Error ATGEN_ReplyGetUSSD(GSM_Protocol_Message *msg, GSM_StateMachine *s)
{
GSM_Phone_ATGENData *Priv = &s->Phone.Data.Priv.ATGEN;
GSM_USSDMessage ussd;
- GSM_Error error;
+ GSM_Error error = ERR_NONE;
unsigned char *pos = NULL;
int code = 0;
int dcs = 0;
@@ -1676,10 +1676,12 @@ GSM_Error ATGEN_ReplyGetUSSD(GSM_Protocol_Message *msg, GSM_StateMachine *s)
break;
case 4:
ussd.Status = USSD_NotSupported;
- return ERR_NETWORK_ERROR;
+ error = ERR_NETWORK_ERROR;
+ goto done;
case 5:
ussd.Status = USSD_Timeout;
- return ERR_TIMEOUT;
+ error = ERR_TIMEOUT;
+ goto done;
default:
ussd.Status = USSD_Unknown;
}
@@ -1699,7 +1701,7 @@ GSM_Error ATGEN_ReplyGetUSSD(GSM_Protocol_Message *msg, GSM_StateMachine *s)
hex_encoded, sizeof(hex_encoded));
}
if (error != ERR_NONE) {
- return error;
+ goto done;
}
if ((dcs & 0xc0) == 0) {
@@ -1731,7 +1733,10 @@ GSM_Error ATGEN_ReplyGetUSSD(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_UnpackEightBitsToSeven(0, strlen(hex_encoded), sizeof(decoded), packed, decoded);
DecodeDefault(ussd.Text, decoded, strlen(decoded), TRUE, NULL);
} else {
- DecodeDefault(ussd.Text, hex_encoded, strlen(hex_encoded), TRUE, NULL);
+ error = ATGEN_DecodeText(s, hex_encoded, strlen(hex_encoded), ussd.Text, sizeof(ussd.Text) - 1, FALSE, FALSE);
+ if (error != ERR_NONE) {
+ return error;
+ }
}
} else if (coding == SMS_Coding_Unicode_No_Compression) {
DecodeHexUnicode(ussd.Text, hex_encoded + offset, strlen(hex_encoded));
@@ -1749,17 +1754,18 @@ GSM_Error ATGEN_ReplyGetUSSD(GSM_Protocol_Message *msg, GSM_StateMachine *s)
&code,
ussd.Text, sizeof(ussd.Text));
if (error != ERR_NONE) {
- return error;
+ goto done;
}
}
+done:
/* Notify application */
if (s->User.IncomingUSSD != NULL) {
s->User.IncomingUSSD(s, &ussd, s->User.IncomingUSSDUserData);
}
}
- return ERR_NONE;
+ return error;
}
GSM_Error ATGEN_SetIncomingUSSD(GSM_StateMachine *s, gboolean enable)
@@ -4405,7 +4411,11 @@ GSM_Error ATGEN_DialService(GSM_StateMachine *s, char *number)
return ERR_MOREMEMORY;
}
/* Prefer unicode to be able to deal with unicode response */
- error = ATGEN_SetCharset(s, AT_PREF_CHARSET_UNICODE);
+ if (GSM_IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_USSD_GSM_CHARSET)) {
+ error = ATGEN_SetCharset(s, AT_PREF_CHARSET_GSM);
+ } else {
+ error = ATGEN_SetCharset(s, AT_PREF_CHARSET_UNICODE);
+ }
if (error != ERR_NONE) {
free(req);
@@ -4496,7 +4506,7 @@ GSM_Error ATGEN_EnterSecurityCode(GSM_StateMachine *s, GSM_SecurityCode *Code)
{
GSM_Error error;
GSM_SecurityCodeType Status;
- unsigned char req[GSM_SECURITY_CODE_LEN + 12] = {'\0'};
+ unsigned char req[GSM_SECURITY_CODE_LEN + 30] = {'\0'};
size_t len;
if (Code->Type == SEC_Pin2 &&
@@ -6229,6 +6239,7 @@ GSM_Reply_Function ATGENReplyFunctions[] = {
{ATGEN_GenericReplyIgnore, "+ZEND" ,0x00,0x00,ID_IncomingFrame },
{ATGEN_GenericReplyIgnore, "+CDSI:" ,0x00,0x00,ID_IncomingFrame },
{ATGEN_GenericReplyIgnore, "+CLCC:" ,0x00,0x00,ID_IncomingFrame },
+{ATGEN_GenericReplyIgnore, "#STN:" ,0x00,0x00,ID_IncomingFrame },
/* Sony Ericsson screenshot */
{SONYERICSSON_Reply_Screenshot, "AT*ZISI=?\r", 0x00,0x00,ID_Screenshot },
diff --git a/libgammu/phone/nokia/dct3/dct3func.c b/libgammu/phone/nokia/dct3/dct3func.c
index ccf1d36..3fa4501 100644
--- a/libgammu/phone/nokia/dct3/dct3func.c
+++ b/libgammu/phone/nokia/dct3/dct3func.c
@@ -1450,6 +1450,7 @@ GSM_Error N71_92_ReplyPhoneSetting(GSM_Protocol_Message *msg, GSM_StateMachine *
smprintf(s, "Startup text set\n");
return ERR_NONE;
}
+ return ERR_UNKNOWNRESPONSE;
case 0x15:
if (Data->RequestID == ID_GetBitmap || Data->RequestID == ID_EachFrame) {
smprintf(s, "Startup logo received\n");
@@ -1463,6 +1464,7 @@ GSM_Error N71_92_ReplyPhoneSetting(GSM_Protocol_Message *msg, GSM_StateMachine *
smprintf(s, "Startup logo set\n");
return ERR_NONE;
}
+ return ERR_UNKNOWNRESPONSE;
case 0x17:
if (Data->RequestID == ID_GetBitmap || Data->RequestID == ID_EachFrame) {
smprintf(s, "Dealer note text received\n");
@@ -1474,6 +1476,7 @@ GSM_Error N71_92_ReplyPhoneSetting(GSM_Protocol_Message *msg, GSM_StateMachine *
smprintf(s, "Dealer text set\n");
return ERR_NONE;
}
+ return ERR_UNKNOWNRESPONSE;
}
return ERR_UNKNOWNRESPONSE;
}
diff --git a/libgammu/phone/nokia/dct3/n7110.c b/libgammu/phone/nokia/dct3/n7110.c
index 0807a4b..4a26597 100644
--- a/libgammu/phone/nokia/dct3/n7110.c
+++ b/libgammu/phone/nokia/dct3/n7110.c
@@ -268,6 +268,7 @@ static GSM_Error N7110_ReplyGetSMSMessage(GSM_Protocol_Message *msg, GSM_StateMa
DCT3_DecodeSMSFrame(s, &Data->GetSMSMessage->SMS[0],msg->Buffer+9);
return ERR_NONE;
}
+ FALLTHROUGH;
case 0x02:
smprintf(s, "SMS template\n");
if (Data->RequestID == ID_GetSMSMessage) {
@@ -277,6 +278,7 @@ static GSM_Error N7110_ReplyGetSMSMessage(GSM_Protocol_Message *msg, GSM_StateMa
GSM_DecodeSMSFrame(&(s->di), &Data->GetSMSMessage->SMS[0],msg->Buffer+9,N7110_SMSTemplate);
return ERR_NONE;
}
+ FALLTHROUGH;
case 0x07:
smprintf(s, "Picture Image\n");
switch (Data->RequestID) {
@@ -352,6 +354,7 @@ static GSM_Error N7110_ReplyGetSMSMessage(GSM_Protocol_Message *msg, GSM_StateMa
return ERR_EMPTY;
default:
smprintf(s, "ERROR: unknown %i\n",msg->Buffer[4]);
+ return ERR_UNKNOWNRESPONSE;
}
case 0x6F:
smprintf(s, "SMS message info received\n");
diff --git a/libgammu/phone/nokia/nfuncold.c b/libgammu/phone/nokia/nfuncold.c
index 2f4a46e..a235d8c 100644
--- a/libgammu/phone/nokia/nfuncold.c
+++ b/libgammu/phone/nokia/nfuncold.c
@@ -36,11 +36,13 @@ static void N71_65_GetCalendarAlarm(GSM_StateMachine *s, unsigned char *buffer,
GetTimeDifference(diff, &entry->Entries[entry->EntriesNum].Date, FALSE, 60);
break;
}
+ FALLTHROUGH;
case GSM_CAL_CALL:
if (!GSM_IsPhoneFeatureAvailable(Data->ModelInfo, F_CAL35)) {
GetTimeDifference(diff, &entry->Entries[entry->EntriesNum].Date, FALSE, 60);
break;
}
+ FALLTHROUGH;
default:
GetTimeDifference(diff, &entry->Entries[entry->EntriesNum].Date, FALSE, 1);
}
diff --git a/libgammu/phone/nokia/wd2/n3650.c b/libgammu/phone/nokia/wd2/n3650.c
index e0ba708..ac6594e 100644
--- a/libgammu/phone/nokia/wd2/n3650.c
+++ b/libgammu/phone/nokia/wd2/n3650.c
@@ -47,7 +47,8 @@ static GSM_Error N3650_GetFilePart(GSM_StateMachine *s, GSM_File *File, int *Han
{
unsigned int len=10,i;
GSM_Error error;
- unsigned char StartReq[500] = {
+ unsigned char *req;
+ unsigned const char StartReq[11] = {
N7110_FRAME_HEADER, 0x0D, 0x10, 0x01, 0x07,
0x24, /* len1 */
0x12, /* len2 */
@@ -58,31 +59,36 @@ static GSM_Error N3650_GetFilePart(GSM_StateMachine *s, GSM_File *File, int *Han
0x08, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00};
if (File->Used == 0) {
+ req = malloc(strlen(File->ID_FullName) + 30);
+ if (req == NULL) {
+ return ERR_MOREMEMORY;
+ }
+ memcpy(req, StartReq, sizeof(StartReq));
(*Size) = 0;
- sprintf(StartReq+10,"%s",File->ID_FullName);
+ sprintf(req+10,"%s",File->ID_FullName);
len+=strlen(File->ID_FullName)-1;
- StartReq[7] = strlen(File->ID_FullName) + 3;
+ req[7] = strlen(File->ID_FullName) + 3;
- StartReq[8] = strlen(File->ID_FullName);
- StartReq[9] = 0;
- while (File->ID_FullName[StartReq[8]] != '\\') {
- StartReq[8]--;
- StartReq[9]++;
+ req[8] = strlen(File->ID_FullName);
+ req[9] = 0;
+ while (File->ID_FullName[req[8]] != '\\') {
+ req[8]--;
+ req[9]++;
}
- for (i=StartReq[8];i<strlen(File->ID_FullName);i++) {
- StartReq[i+10] = StartReq[i+1+10];
+ for (i=req[8];i<strlen(File->ID_FullName);i++) {
+ req[i+10] = req[i+1+10];
}
- StartReq[9]--;
+ req[9]--;
- EncodeUnicode(File->Name,File->ID_FullName+StartReq[8]+1,StartReq[9]);
+ EncodeUnicode(File->Name,File->ID_FullName+req[8]+1,req[9]);
File->Folder = FALSE;
error = DCT4_SetPhoneMode(s, DCT4_MODE_TEST);
if (error != ERR_NONE) return error;
s->Phone.Data.File = File;
- return GSM_WaitFor (s, StartReq, len, 0x58, 4, ID_GetFile);
+ return GSM_WaitFor (s, req, len, 0x58, 4, ID_GetFile);
}
s->Phone.Data.File = File;
@@ -125,8 +131,28 @@ static GSM_Error N3650_ReplyGetFolderInfo(GSM_Protocol_Message *msg, GSM_StateMa
EncodeUnicode(Priv->Files[Priv->FilesLocationsCurrent+i]->Name,msg->Buffer+pos+9,msg->Buffer[pos+8]);
smprintf(s,"%s\n",DecodeUnicodeString(Priv->Files[Priv->FilesLocationsCurrent+i]->Name));
Priv->Files[Priv->FilesLocationsCurrent+i]->Level = File->Level+1;
- sprintf(Priv->Files[Priv->FilesLocationsCurrent+i]->ID_FullName,"%s\\%s",File->ID_FullName,msg->Buffer+pos+9);
- pos+=msg->Buffer[pos+1];
+#ifdef __GNUC__
+#ifndef __clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-overflow"
+#endif
+#endif
+ /* Here we check limits before doing sprintf */
+ if (strlen(File->ID_FullName) + strlen(msg->Buffer+pos+9) + 20 >= sizeof(File->ID_FullName)) {
+ return ERR_MOREMEMORY;
+ }
+ sprintf(
+ Priv->Files[Priv->FilesLocationsCurrent+i]->ID_FullName,
+ "%s\\%s",
+ File->ID_FullName,
+ msg->Buffer + pos + 9
+ );
+#ifdef __GNUC__
+#ifndef __clang__
+#pragma GCC diagnostic pop
+#endif
+#endif
+ pos += msg->Buffer[pos+1];
}
smprintf(s, "\n");
return ERR_NONE;
@@ -135,13 +161,20 @@ static GSM_Error N3650_ReplyGetFolderInfo(GSM_Protocol_Message *msg, GSM_StateMa
static GSM_Error N3650_GetFolderInfo(GSM_StateMachine *s, GSM_File *File)
{
int len=10;
- unsigned char req[500] = {
+ unsigned char *req;
+ unsigned const char template[11] = {
N7110_FRAME_HEADER, 0x0B, 0x00, 0x01, 0x07,
0x18, /* folder name length + 6 */
0x12, /* folder name length */
0x00,
0x00}; /* folder name */
+ req = malloc(strlen(File->ID_FullName) + 30);
+ if (req == NULL) {
+ return ERR_MOREMEMORY;
+ }
+ memcpy(req, template, sizeof(template));
+
/* FIXME: I doubt this works */
sprintf(req+10,"%s", File->ID_FullName);
len +=strlen(File->ID_FullName);
diff --git a/libgammu/phone/obex/obexgen.c b/libgammu/phone/obex/obexgen.c
index a9c47ad..c7a66ef 100644
--- a/libgammu/phone/obex/obexgen.c
+++ b/libgammu/phone/obex/obexgen.c
@@ -733,6 +733,7 @@ static GSM_Error OBEXGEN_ReplyAddFilePart(GSM_Protocol_Message *msg, GSM_StateMa
/* ID of newly created m-obex entry */
Priv->m_obex_newid = msg->Buffer[Pos+3]*256 + msg->Buffer[Pos+4];
Pos += 5;
+ break;
case 0xcb:
/* Skip Connection ID (we ignore this for now) */
Pos += 5;
diff --git a/libgammu/protocol/at/at.c b/libgammu/protocol/at/at.c
index 5adedfc..abe5351 100644
--- a/libgammu/protocol/at/at.c
+++ b/libgammu/protocol/at/at.c
@@ -86,7 +86,8 @@ GSM_Error AT_StateMachine(GSM_StateMachine *s, unsigned char rx_char)
static const SpecialAnswersStruct SpecialAnswers[] = {
/* Standard GSM */
{"+CGREG:" ,1, ID_GetNetworkInfo},
- {"+CBM:" ,1, ID_All},
+ /* Following has 2 lines in PDU mode, 1 line in TEXT ... */
+ {"+CBM:" ,2, ID_All},
{"+CMT:" ,2, ID_All},
{"+CMTI:" ,1, ID_All},
{"+CDS:" ,2, ID_All},
@@ -145,6 +146,9 @@ GSM_Error AT_StateMachine(GSM_StateMachine *s, unsigned char rx_char)
/* ONDA */
{"+ZUSIMR:" ,1, ID_All}, /* +ZUSIMR:2 */
+ /* Telit */
+ {"#STN:" ,1, ID_All}, /* #STN: 150,1,"" */
+
{NULL ,1, ID_All}};
/* We're starting new message */
@@ -286,6 +290,7 @@ GSM_Error AT_StateMachine(GSM_StateMachine *s, unsigned char rx_char)
d->Msg.Length = 0;
break;
}
+ FALLTHROUGH;
default:
if (d->wascrlf) {
d->LineStart = d->Msg.Length - 1;
diff --git a/libgammu/service/backup/backtext.c b/libgammu/service/backup/backtext.c
index 24cdd5d..2d30971 100644
--- a/libgammu/service/backup/backtext.c
+++ b/libgammu/service/backup/backtext.c
@@ -936,6 +936,7 @@ static GSM_Error SaveWAPSettingsEntry(FILE *file, GSM_MultiWAPSettings *settings
sprintf(buffer,"IP%02i",i);
error = SaveBackupText(file, buffer, settings->Settings[i].IPAddress, UseUnicode);
if (error != ERR_NONE) return error;
+ FALLTHROUGH;
case WAPSETTINGS_BEARER_DATA:
if (settings->Settings[i].Bearer == WAPSETTINGS_BEARER_DATA) {
sprintf(buffer,"Bearer%02i = Data%c%c",i,13,10);
diff --git a/libgammu/service/gsmdata.c b/libgammu/service/gsmdata.c
index 9ff5998..bf89fa7 100644
--- a/libgammu/service/gsmdata.c
+++ b/libgammu/service/gsmdata.c
@@ -306,7 +306,7 @@ GSM_Error GSM_EncodeURLFile(unsigned char *Buffer, size_t *Length, GSM_WAPBookma
/* SNIFFS, specs somewhere in http://www.wapforum.org */
void GSM_EncodeMMSIndicatorSMSText(unsigned char *Buffer, size_t *Length, GSM_MMSIndicator *Indicator)
{
- unsigned char buffer[200];
+ unsigned char buffer[1000];
int i;
diff --git a/libgammu/service/gsmring.c b/libgammu/service/gsmring.c
index 82ffee5..ce282a5 100644
--- a/libgammu/service/gsmring.c
+++ b/libgammu/service/gsmring.c
@@ -1297,6 +1297,7 @@ static void RTTL2Binary(GSM_Ringtone *dest, GSM_Ringtone *src)
duration--;
}
note = 0x40; /* The rest is pause */
+ FALLTHROUGH;
case NaturalStyle:
if (note != 0x40 && duration) {
dest->NokiaBinary.Frame[current++] = 0x40;
@@ -1304,6 +1305,7 @@ static void RTTL2Binary(GSM_Ringtone *dest, GSM_Ringtone *src)
dest->NokiaBinary.Frame[current++] = 1;
duration--;
}
+ FALLTHROUGH;
default:
if (note != 0x40 && note == lastnote && duration) {
dest->NokiaBinary.Frame[current++] = 0x40;
diff --git a/libgammu/service/sms/gsmmulti.c b/libgammu/service/sms/gsmmulti.c
index c956d8a..e5d8ac2 100644
--- a/libgammu/service/sms/gsmmulti.c
+++ b/libgammu/service/sms/gsmmulti.c
@@ -710,6 +710,7 @@ GSM_Error GSM_EncodeMultiPartSMS(GSM_Debug_Info *di,
NOKIA_CopyBitmap(GSM_Nokia7110OperatorLogo, &Info->Entries[0].Bitmap->Bitmap[0], Buffer, &Length);
break;
}
+ FALLTHROUGH;
case SMS_NokiaOperatorLogo:
UDH = UDH_NokiaOperatorLogo;
Class = 1;
@@ -849,6 +850,9 @@ GSM_Error GSM_EncodeMultiPartSMS(GSM_Debug_Info *di,
FindDefaultAlphabetLen(Info->Entries[0].Buffer,&Length,&smslen,(GSM_MAX_8BIT_SMS_LENGTH-UDHHeader.Length)*8/7);
}
break;
+ case SMS_USSD:
+ Class = Info->Class;
+ break;
case SMS_ConcatenatedAutoTextLong:
case SMS_ConcatenatedAutoTextLong16bit:
smslen = UnicodeLength(Info->Entries[0].Buffer);
@@ -872,6 +876,7 @@ GSM_Error GSM_EncodeMultiPartSMS(GSM_Debug_Info *di,
}
}
/* No break here - we go to the SMS_ConcatenatedTextLong */
+ FALLTHROUGH;
case SMS_ConcatenatedTextLong:
case SMS_ConcatenatedTextLong16bit:
Class = Info->Class;
@@ -1338,6 +1343,7 @@ gboolean GSM_DecodeLinkedText(GSM_Debug_Info *di,
if (Info->Entries[0].ID == SMS_ConcatenatedTextLong16bit) {
Info->Entries[0].ID = SMS_ConcatenatedAutoTextLong16bit;
}
+ FALLTHROUGH;
case SMS_Coding_Default_No_Compression:
Info->Entries[0].Buffer = (unsigned char *)realloc(Info->Entries[0].Buffer, Length + UnicodeLength(SMS->SMS[i].Text)*2 + 2);
if (Info->Entries[0].Buffer == NULL) return FALSE;