"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libgammu/gsmstate.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.

gsmstate.c  (gammu-1.41.0.tar.bz2):gsmstate.c  (gammu-1.42.0.tar.bz2)
skipping to change at line 903 skipping to change at line 903
GSM_LogError(s, "Init:Phone->GetModel" , error); GSM_LogError(s, "Init:Phone->GetModel" , error);
return error; return error;
} }
error=s->Phone.Functions->GetFirmware(s); error=s->Phone.Functions->GetFirmware(s);
if (error != ERR_NONE && error != ERR_NOTSUPPORTED) { if (error != ERR_NONE && error != ERR_NOTSUPPORTED) {
GSM_LogError(s, "Init:Phone->GetFirmware" , error); GSM_LogError(s, "Init:Phone->GetFirmware" , error);
return error; return error;
} }
error=s->Phone.Functions->SetPower(s, 1);
if (error != ERR_NONE && error != ERR_NOTSUPPORTED) {
GSM_LogError(s, "Init:Phone->SetPower" , error);
return error;
}
error=s->Phone.Functions->PostConnect(s); error=s->Phone.Functions->PostConnect(s);
if (error != ERR_NONE && error != ERR_NOTSUPPORTED) { if (error != ERR_NONE && error != ERR_NOTSUPPORTED) {
GSM_LogError(s, "Init:Phone->PostConnect" , error); GSM_LogError(s, "Init:Phone->PostConnect" , error);
return error; return error;
} }
smprintf(s,"[Connected]\n"); smprintf(s,"[Connected]\n");
return ERR_NONE; return ERR_NONE;
} }
return ERR_UNCONFIGURED; return ERR_UNCONFIGURED;
skipping to change at line 1487 skipping to change at line 1493
++args_ptr; ++args_ptr;
} }
if(!*args_ptr) if(!*args_ptr)
return ERR_NONE; return ERR_NONE;
switch (*args_ptr) { switch (*args_ptr) {
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': case '5': case '6': case '7': case '8': case '9':
if (expect_comma) { if (expect_comma) {
printf("expected comma but got %c for parameter %lu\n", *args_ptr, ++p arams_ptr - out_params); printf("expected comma but got %c for parameter %d\n", *args_ptr, (int )(++params_ptr - out_params));
return ERR_INVALIDDATA; return ERR_INVALIDDATA;
} }
*params_ptr = *args_ptr - '0'; *params_ptr = *args_ptr - '0';
expect_comma = TRUE; expect_comma = TRUE;
break; break;
case ',': case ',':
++params_ptr; ++params_ptr;
expect_comma = FALSE; expect_comma = FALSE;
break; break;
default: { default: {
printf("error parsing parameters, unrecognized token '%c' in position %l printf("error parsing parameters, unrecognized token '%c' in position %d
u\n", \n",
*args_ptr, ++params_ptr - --out_params + ++whitespace_count); *args_ptr, (int)(++params_ptr - --out_params + ++whitespace_count
));
return ERR_INVALIDDATA; } return ERR_INVALIDDATA; }
} }
++args_ptr; ++args_ptr;
} }
return ERR_NONE; return ERR_NONE;
} }
GSM_Error GSM_ReadCNMIParams(int out_params[4], const char *args) GSM_Error GSM_ReadCNMIParams(int out_params[5], const char *args)
{ {
return GSM_ReadParams(out_params, 4, args); return GSM_ReadParams(out_params, 5, args);
} }
GSM_Error GSM_ReadConfig(INI_Section *cfg_info, GSM_Config *cfg, int num) GSM_Error GSM_ReadConfig(INI_Section *cfg_info, GSM_Config *cfg, int num)
{ {
INI_Section *h; INI_Section *h;
unsigned char section[50]={0}; unsigned char section[50]={0};
gboolean found = FALSE; gboolean found = FALSE;
char *Temp = NULL; char *Temp = NULL;
const int cnmi_default[4] = {-1,-1,-1,-1}; const int cnmi_default[5] = {-1,-1,-1,-1,-1};
GSM_Error error = ERR_UNKNOWN; GSM_Error error = ERR_UNKNOWN;
cfg->UseGlobalDebugFile = TRUE; cfg->UseGlobalDebugFile = TRUE;
memcpy(cfg->CNMIParams, &cnmi_default, sizeof(cfg->CNMIParams)); memcpy(cfg->CNMIParams, &cnmi_default, sizeof(cfg->CNMIParams));
/* If we don't have valid config, bail out */ /* If we don't have valid config, bail out */
if (cfg_info == NULL) { if (cfg_info == NULL) {
error = ERR_UNCONFIGURED; error = ERR_UNCONFIGURED;
goto fail; goto fail;
} }
 End of changes. 6 change blocks. 
7 lines changed or deleted 14 lines changed or added

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