gsmopen: AT+CREG erratic behavior does no more give errors or warnings when badly formatted unsolicited signaling

This commit is contained in:
Giovanni Maruzzelli 2012-04-25 09:11:27 +02:00
parent 4178393a73
commit 0e4fa9e23b
1 changed files with 22 additions and 21 deletions

View File

@ -949,28 +949,29 @@ read:
if (option_debug > 1) if (option_debug > 1)
DEBUGA_GSMOPEN("|%s| +CREG: Display: %d, Registration=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], n, stat); DEBUGA_GSMOPEN("|%s| +CREG: Display: %d, Registration=%d\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i], n, stat);
if (err < 2) { if (err < 2) {
WARNINGA("|%s| is not formatted as: |+CREG: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); DEBUGA_GSMOPEN("|%s| is not formatted as: |+CREG: xx,yy|\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]);
} }else{
if (stat == 0) { if (stat == 0) {
ERRORA ERRORA
("|%s| CELLPHONE is not registered to network, consider to move it or additional antenna\n", ("|%s| CELLPHONE is not registered to network, consider to move it or additional antenna\n",
GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); GSMOPEN_P_LOG, tech_pvt->line_array.result[i]);
tech_pvt->not_registered = 1; tech_pvt->not_registered = 1;
tech_pvt->home_network_registered = 0; tech_pvt->home_network_registered = 0;
tech_pvt->roaming_registered = 0; tech_pvt->roaming_registered = 0;
alarm_event(tech_pvt, ALARM_NO_NETWORK_REGISTRATION, alarm_event(tech_pvt, ALARM_NO_NETWORK_REGISTRATION,
"CELLPHONE is not registered to network, consider to move it or additional antenna"); "CELLPHONE is not registered to network, consider to move it or additional antenna");
} else if (stat == 1) { } else if (stat == 1) {
DEBUGA_GSMOPEN("|%s| CELLPHONE is registered to the HOME network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); DEBUGA_GSMOPEN("|%s| CELLPHONE is registered to the HOME network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]);
tech_pvt->not_registered = 0; tech_pvt->not_registered = 0;
tech_pvt->home_network_registered = 1; tech_pvt->home_network_registered = 1;
tech_pvt->roaming_registered = 0; tech_pvt->roaming_registered = 0;
} else { } else {
ERRORA("|%s| CELLPHONE is registered to a ROAMING network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); ERRORA("|%s| CELLPHONE is registered to a ROAMING network\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]);
tech_pvt->not_registered = 0; tech_pvt->not_registered = 0;
tech_pvt->home_network_registered = 0; tech_pvt->home_network_registered = 0;
tech_pvt->roaming_registered = 1; tech_pvt->roaming_registered = 1;
alarm_event(tech_pvt, ALARM_ROAMING_NETWORK_REGISTRATION, "CELLPHONE is registered to a ROAMING network"); alarm_event(tech_pvt, ALARM_ROAMING_NETWORK_REGISTRATION, "CELLPHONE is registered to a ROAMING network");
}
} }
} }