From de3c0d624742b5caff093cfeeff758d04886742a Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 25 Oct 2010 14:42:59 -0500 Subject: [PATCH] phonesim: Support multiple contexts --- plugins/phonesim.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/phonesim.c b/plugins/phonesim.c index 851ed769..8d5ef8f2 100644 --- a/plugins/phonesim.c +++ b/plugins/phonesim.c @@ -477,7 +477,7 @@ static void phonesim_post_online(struct ofono_modem *modem) struct phonesim_data *data = ofono_modem_get_data(modem); struct ofono_message_waiting *mw; struct ofono_gprs *gprs; - struct ofono_gprs_context *gc; + struct ofono_gprs_context *gc1, *gc2; DBG("%p", modem); @@ -503,10 +503,14 @@ static void phonesim_post_online(struct ofono_modem *modem) } gprs = ofono_gprs_create(modem, 0, "atmodem", data->chat); - gc = ofono_gprs_context_create(modem, 0, "phonesim", data->chat); - if (gprs && gc) - ofono_gprs_add_context(gprs, gc); + gc1 = ofono_gprs_context_create(modem, 0, "phonesim", data->chat); + if (gprs && gc1) + ofono_gprs_add_context(gprs, gc1); + + gc2 = ofono_gprs_context_create(modem, 0, "phonesim", data->chat); + if (gprs && gc2) + ofono_gprs_add_context(gprs, gc2); mw = ofono_message_waiting_create(modem); if (mw)