stemodem: register should not be called from probe

This commit is contained in:
Denis Kenzior 2010-08-12 23:46:02 -05:00
parent 361773f4d8
commit 9a00f06329
1 changed files with 12 additions and 3 deletions

View File

@ -533,6 +533,16 @@ static void ecav_notify(GAtResult *result, gpointer user_data)
}
}
static void ste_voicecall_initialized(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct ofono_voicecall *vc = user_data;
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
g_at_chat_register(vd->chat, "*ECAV:", ecav_notify, FALSE, vc, NULL);
ofono_voicecall_register(vc);
}
static int ste_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
void *data)
{
@ -544,9 +554,8 @@ static int ste_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
ofono_voicecall_set_data(vc, vd);
g_at_chat_send(vd->chat, "AT*ECAM=1", NULL, NULL, NULL, NULL);
g_at_chat_register(vd->chat, "*ECAV:", ecav_notify, FALSE, vc, NULL);
ofono_voicecall_register(vc);
g_at_chat_send(vd->chat, "AT*ECAM=1", none_prefix,
ste_voicecall_initialized, vc, NULL);
return 0;
}