static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct cb_data *cbd = user_data; ofono_netreg_status_cb_t cb = cbd->cb; int status, lac, ci, tech; struct ofono_error error; struct netreg_data *nd = cbd->user; decode_at_error(&error, g_at_result_final_response(result)); if (!ok) { cb(&error, -1, -1, -1, -1, cbd->data); return; } if (at_util_parse_reg(result, "+CREG:", NULL, &status, &lac, &ci, &tech, nd->vendor) == FALSE) { CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, cbd->data); return; } if ((status == 1 || status == 5) && (tech == -1)) tech = nd->tech; cb(&error, status, lac, ci, tech, cbd->data); }
static void creg_cb(gboolean ok, GAtResult *result, gpointer user_data) { int status, lac, ci, tech; if (!ok) return; if (at_util_parse_reg(result, "+CREG:", NULL, &status, &lac, &ci, &tech) == FALSE) return; if (status != 1 && status != 5) { g_at_chat_register(control, "+CREG:", creg_notify, FALSE, NULL, NULL); return; } activate_gprs(status); }
static void at_cgreg_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct cb_data *cbd = user_data; ofono_gprs_status_cb_t cb = cbd->cb; struct ofono_error error; int status; struct gprs_data *gd = cbd->user; decode_at_error(&error, g_at_result_final_response(result)); if (!ok) { cb(&error, -1, cbd->data); return; } if (at_util_parse_reg(result, "+CGREG:", NULL, &status, NULL, NULL, NULL, gd->vendor) == FALSE) { CALLBACK_WITH_FAILURE(cb, -1, cbd->data); return; } cb(&error, status, cbd->data); }