mirror of git://git.sysmocom.de/ofono
atmodem: introduce send_clcc() to reduce code duplication
Reduce code duplication by introducing send_clcc function.
This commit is contained in:
parent
bff7de9552
commit
30fd4b3e34
|
@ -264,14 +264,17 @@ poll_again:
|
||||||
poll_clcc, vc);
|
poll_clcc, vc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void send_clcc(struct voicecall_data *vd, struct ofono_voicecall *vc)
|
||||||
|
{
|
||||||
|
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix, clcc_poll_cb, vc, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean poll_clcc(gpointer user_data)
|
static gboolean poll_clcc(gpointer user_data)
|
||||||
{
|
{
|
||||||
struct ofono_voicecall *vc = user_data;
|
struct ofono_voicecall *vc = user_data;
|
||||||
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
|
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
|
||||||
|
|
||||||
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
|
send_clcc(vd, vc);
|
||||||
clcc_poll_cb, vc, NULL);
|
|
||||||
|
|
||||||
vd->clcc_source = 0;
|
vd->clcc_source = 0;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -297,8 +300,7 @@ static void generic_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
|
send_clcc(vd, req->vc);
|
||||||
clcc_poll_cb, req->vc, NULL);
|
|
||||||
|
|
||||||
/* We have to callback after we schedule a poll if required */
|
/* We have to callback after we schedule a poll if required */
|
||||||
req->cb(&error, req->data);
|
req->cb(&error, req->data);
|
||||||
|
@ -316,8 +318,7 @@ static void release_id_cb(gboolean ok, GAtResult *result,
|
||||||
if (ok)
|
if (ok)
|
||||||
vd->local_release = 1 << req->id;
|
vd->local_release = 1 << req->id;
|
||||||
|
|
||||||
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
|
send_clcc(vd, req->vc);
|
||||||
clcc_poll_cb, req->vc, NULL);
|
|
||||||
|
|
||||||
/* We have to callback after we schedule a poll if required */
|
/* We have to callback after we schedule a poll if required */
|
||||||
req->cb(&error, req->data);
|
req->cb(&error, req->data);
|
||||||
|
@ -962,8 +963,7 @@ static void no_carrier_notify(GAtResult *result, gpointer user_data)
|
||||||
struct ofono_voicecall *vc = user_data;
|
struct ofono_voicecall *vc = user_data;
|
||||||
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
|
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
|
||||||
|
|
||||||
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
|
send_clcc(vd, vc);
|
||||||
clcc_poll_cb, vc, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void no_answer_notify(GAtResult *result, gpointer user_data)
|
static void no_answer_notify(GAtResult *result, gpointer user_data)
|
||||||
|
@ -971,8 +971,7 @@ static void no_answer_notify(GAtResult *result, gpointer user_data)
|
||||||
struct ofono_voicecall *vc = user_data;
|
struct ofono_voicecall *vc = user_data;
|
||||||
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
|
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
|
||||||
|
|
||||||
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
|
send_clcc(vd, vc);
|
||||||
clcc_poll_cb, vc, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void busy_notify(GAtResult *result, gpointer user_data)
|
static void busy_notify(GAtResult *result, gpointer user_data)
|
||||||
|
@ -984,8 +983,7 @@ static void busy_notify(GAtResult *result, gpointer user_data)
|
||||||
* or UDUB on the other side
|
* or UDUB on the other side
|
||||||
* TODO: Handle UDUB or other conditions somehow
|
* TODO: Handle UDUB or other conditions somehow
|
||||||
*/
|
*/
|
||||||
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
|
send_clcc(vd, vc);
|
||||||
clcc_poll_cb, vc, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cssi_notify(GAtResult *result, gpointer user_data)
|
static void cssi_notify(GAtResult *result, gpointer user_data)
|
||||||
|
|
Loading…
Reference in New Issue