"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libgammu/phone/at/at-sms.c" between
gammu-1.41.0.tar.bz2 and gammu-1.42.0.tar.bz2

About: Gammu (GNU All Mobile Management Utilities) is a cellular manager (ringtones, phonebook, SMS, logos, WAP, date/time, alarm, calls, backups etc) for Nokia and other mobile phones and modems.

at-sms.c  (gammu-1.41.0.tar.bz2):at-sms.c  (gammu-1.42.0.tar.bz2)
skipping to change at line 17 skipping to change at line 17
*/ */
/** /**
* @ingroup Phone * @ingroup Phone
* @{ * @{
*/ */
/** /**
* @addtogroup ATPhone * @addtogroup ATPhone
* @{ * @{
*/ */
#include "gammu-error.h"
#define _GNU_SOURCE #define _GNU_SOURCE
#include <gammu-config.h> #include <gammu-config.h>
#ifdef GSM_ENABLE_ATGEN #ifdef GSM_ENABLE_ATGEN
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <ctype.h> #include <ctype.h>
#include <stdarg.h> #include <stdarg.h>
#include <assert.h> #include <assert.h>
skipping to change at line 2621 skipping to change at line 2622
case AT_Reply_Error: case AT_Reply_Error:
return ERR_NOTSUPPORTED; return ERR_NOTSUPPORTED;
case AT_Reply_CMSError: case AT_Reply_CMSError:
return ATGEN_HandleCMSError(s); return ATGEN_HandleCMSError(s);
case AT_Reply_CMEError: case AT_Reply_CMEError:
return ATGEN_HandleCMEError(s); return ATGEN_HandleCMEError(s);
default: default:
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
/* Sample resposne we get here: /* Sample responses we get here:
AT+CNMI=? AT+CNMI=?
+CNMI: (0-2),(0,1,3),(0),(0,1),(0,1) +CNMI: (0-2),(0,1,3),(0),(0,1),(0,1)
Or: Or:
+CNMI:(0-3),(0-3),(0-3),(0,1),(0,1) +CNMI:(0-3),(0-3),(0-3),(0,1),(0,1)
Or: Or:
+CNMI: (2),(0-1,3),(0,2),(0-1),(0)" +CNMI: (2),(0-1,3),(0,2),(0-1),(0)"
*/ */
Priv->CNMIMode = 0; Priv->CNMIMode = 0;
Priv->CNMIProcedure = 0; Priv->CNMIProcedure = 0;
Priv->CNMIDeliverProcedure = 0; Priv->CNMIDeliverProcedure = 0;
#ifdef GSM_ENABLE_CELLBROADCAST #ifdef GSM_ENABLE_CELLBROADCAST
Priv->CNMIBroadcastProcedure = 0; Priv->CNMIBroadcastProcedure = 0;
#endif #endif
Priv->CNMIClearUnsolicitedResultCodes = 0;
buffer = GetLineString(msg->Buffer, &Priv->Lines, 2); buffer = GetLineString(msg->Buffer, &Priv->Lines, 2);
if (buffer == NULL) { if (buffer == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
while (isspace((int)*buffer)) { while (isspace((int)*buffer)) {
buffer++; buffer++;
} }
if (strncmp(buffer, "+CNMI:", 6) != 0) { if (strncmp(buffer, "+CNMI:", 6) != 0) {
skipping to change at line 2660 skipping to change at line 2662
buffer = strchr(buffer, '('); buffer = strchr(buffer, '(');
if (buffer == NULL) { if (buffer == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
range = GetRange(s, buffer); range = GetRange(s, buffer);
if (range == NULL) { if (range == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
if (InRange(range, 2)) { param = s->CurrentConfig->CNMIParams[0];
if (param >= 0 && InRange(range, param)) {
Priv->CNMIMode = param;
}
else if (InRange(range, 2)) {
Priv->CNMIMode = 2; /* 2 = buffer messages and send them when link is free */ Priv->CNMIMode = 2; /* 2 = buffer messages and send them when link is free */
} }
else if (InRange(range, 3)) { else if (InRange(range, 3)) {
Priv->CNMIMode = 3; /* 3 = send messages directly */ Priv->CNMIMode = 3; /* 3 = send messages directly */
} }
else { else {
free(range); free(range);
range = NULL; range = NULL;
return ERR_NONE; /* we don't want: 1 = ignore new messages, 0 = s tore messages and no indication */ return ERR_NONE; /* we don't want: 1 = ignore new messages, 0 = s tore messages and no indication */
} }
skipping to change at line 2686 skipping to change at line 2692
if (buffer == NULL) { if (buffer == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
range = GetRange(s, buffer); range = GetRange(s, buffer);
if (range == NULL) { if (range == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
param = s->CurrentConfig->CNMIParams[1]; param = s->CurrentConfig->CNMIParams[1];
if (param && InRange(range, param)) { if (param >= 0 &amp;& InRange(range, param)) {
Priv->CNMIProcedure = param; Priv->CNMIProcedure = param;
} }
else if (InRange(range, 1)) { else if (InRange(range, 1)) {
Priv->CNMIProcedure = 1; /* 1 = store message and send whe re it is stored */ Priv->CNMIProcedure = 1; /* 1 = store message and send whe re it is stored */
} }
else if (InRange(range, 2)) { else if (InRange(range, 2)) {
Priv->CNMIProcedure = 2; /* 2 = route message to TE */ Priv->CNMIProcedure = 2; /* 2 = route message to TE */
} }
else if (InRange(range, 3)) { else if (InRange(range, 3)) {
Priv->CNMIProcedure = 3; /* 3 = 1 + route class 3 to TE */ Priv->CNMIProcedure = 3; /* 3 = 1 + route class 3 to TE */
skipping to change at line 2715 skipping to change at line 2721
if (buffer == NULL) { if (buffer == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
range = GetRange(s, buffer); range = GetRange(s, buffer);
if (range == NULL) { if (range == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
param = s->CurrentConfig->CNMIParams[2]; param = s->CurrentConfig->CNMIParams[2];
if (param && InRange(range, param)) { if (param >= 0 &amp;& InRange(range, param)) {
Priv->CNMIBroadcastProcedure = param; Priv->CNMIBroadcastProcedure = param;
} }
else if (InRange(range, 2)) { else if (InRange(range, 2)) {
Priv->CNMIBroadcastProcedure = 2; /* 2 = route message to TE */ Priv->CNMIBroadcastProcedure = 2; /* 2 = route message to TE */
} }
else if (InRange(range, 1)) { else if (InRange(range, 1)) {
Priv->CNMIBroadcastProcedure = 1; /* 1 = store message and send w here it is stored */ Priv->CNMIBroadcastProcedure = 1; /* 1 = store message and send w here it is stored */
} }
else if (InRange(range, 3)) { else if (InRange(range, 3)) {
Priv->CNMIBroadcastProcedure = 3; /* 3 = 1 + route class 3 to TE */ Priv->CNMIBroadcastProcedure = 3; /* 3 = 1 + route class 3 to TE */
skipping to change at line 2745 skipping to change at line 2751
if (buffer == NULL) { if (buffer == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
range = GetRange(s, buffer); range = GetRange(s, buffer);
if (range == NULL) { if (range == NULL) {
return ERR_UNKNOWNRESPONSE; return ERR_UNKNOWNRESPONSE;
} }
param = s->CurrentConfig->CNMIParams[3]; param = s->CurrentConfig->CNMIParams[3];
if (param && InRange(range, param)) { if (param >= 0 &amp;& InRange(range, param)) {
Priv->CNMIDeliverProcedure = param; Priv->CNMIDeliverProcedure = param;
} }
else if (InRange(range, 2)) { else if (InRange(range, 2)) {
Priv->CNMIDeliverProcedure = 2; /* 2 = store message and send whe re it is stored */ Priv->CNMIDeliverProcedure = 2; /* 2 = store message and send whe re it is stored */
} }
else if (InRange(range, 1)) { else if (InRange(range, 1)) {
Priv->CNMIDeliverProcedure = 1; /* 1 = route message to TE */ Priv->CNMIDeliverProcedure = 1; /* 1 = route message to TE */
} }
/* we don't want: 0 = no routing */ /* we don't want: 0 = no routing */
free(range); free(range);
range = NULL; range = NULL;
buffer++;
buffer = strchr(buffer, '(');
if (buffer == NULL) {
return ERR_NONE;
}
range = GetRange(s, buffer);
if (range == NULL) {
return ERR_UNKNOWNRESPONSE;
}
param = s->CurrentConfig->CNMIParams[4];
if (param >= 0 && InRange(range, param)) {
Priv->CNMIClearUnsolicitedResultCodes = param;
}
free(range);
range = NULL;
return ERR_NONE; return ERR_NONE;
} }
GSM_Error ATGEN_GetCNMIMode(GSM_StateMachine *s) GSM_Error ATGEN_GetCNMIMode(GSM_StateMachine *s)
{ {
GSM_Error error; GSM_Error error;
error = ATGEN_WaitForAutoLen(s, "AT+CNMI=?\r", 0x00, 80, ID_GetCNMIMode); error = ATGEN_WaitForAutoLen(s, "AT+CNMI=?\r", 0x00, 80, ID_GetCNMIMode);
return error; return error;
} }
skipping to change at line 2792 skipping to change at line 2818
if (Priv->CNMIMode == 0) { if (Priv->CNMIMode == 0) {
return ERR_NOTSUPPORTED; return ERR_NOTSUPPORTED;
} }
if (Priv->CNMIBroadcastProcedure == 0) { if (Priv->CNMIBroadcastProcedure == 0) {
return ERR_NOTSUPPORTED; return ERR_NOTSUPPORTED;
} }
length = sprintf( length = sprintf(
buffer, buffer,
"AT+CNMI=%d,%d,%d,%d\r", "AT+CNMI=%d,%d,%d,%d,%d\r",
Priv->CNMIMode, Priv->CNMIMode,
s->Phone.Data.EnableIncomingSMS ? Priv->CNMIProcedure : 0, s->Phone.Data.EnableIncomingSMS ? Priv->CNMIProcedure : 0,
#ifdef GSM_ENABLE_CELLBROADCAST #ifdef GSM_ENABLE_CELLBROADCAST
s->Phone.Data.EnableIncomingCB ? Priv->CNMIBroadcastProcedure : 0, s->Phone.Data.EnableIncomingCB ? Priv->CNMIBroadcastProcedure : 0,
#else #else
0, 0,
#endif #endif
Priv->CNMIDeliverProcedure Priv->CNMIDeliverProcedure,
Priv->CNMIClearUnsolicitedResultCodes
); );
return ATGEN_WaitFor(s, buffer, length, 0x00, 80, ID_SetIncomingSMS); return ATGEN_WaitFor(s, buffer, length, 0x00, 80, ID_SetIncomingSMS);
} }
GSM_Error ATGEN_SetIncomingCB(GSM_StateMachine *s, gboolean enable) GSM_Error ATGEN_SetIncomingCB(GSM_StateMachine *s, gboolean enable)
{ {
#ifdef GSM_ENABLE_CELLBROADCAST #ifdef GSM_ENABLE_CELLBROADCAST
if (s->Phone.Data.EnableIncomingCB != enable) { if (s->Phone.Data.EnableIncomingCB != enable) {
s->Phone.Data.EnableIncomingCB = enable; s->Phone.Data.EnableIncomingCB = enable;
 End of changes. 10 change blocks. 
7 lines changed or deleted 34 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)