Had to add set_online interface to he910 modem connman now, working properly if disable he910 cellular (was not implemented error before). --- plugins/he910.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plugins/he910.c b/plugins/he910.c index 69362b8..add2243 100644 --- a/plugins/he910.c +++ b/plugins/he910.c @@ -322,6 +322,30 @@ static void he910_pre_sim(struct ofono_modem *modem) ofono_location_reporting_create(modem, 0, "telitmodem", data->chat); } + +static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data) +{ + struct cb_data *cbd = user_data; + ofono_modem_online_cb_t cb = cbd->cb; + struct ofono_error error; + + decode_at_error(&error, g_at_result_final_response(result)); + cb(&error, cbd->data); +} + +static void he910_set_online(struct ofono_modem *modem, ofono_bool_t online, + ofono_modem_online_cb_t cb, void *user_data) +{ + struct he910_data *data = ofono_modem_get_data(modem); + struct cb_data *cbd = cb_data_new(cb, user_data); + char const *command = online ? "AT+CFUN=1,0" : "AT+CFUN=4,0"; + + DBG("modem %p %s", modem, online ? "online" : "offline"); + + g_at_chat_send(data->chat, command, none_prefix, set_online_cb, + cbd, g_free); +} + static void he910_post_online(struct ofono_modem *modem) { struct he910_data *data = ofono_modem_get_data(modem); @@ -388,6 +412,7 @@ static struct ofono_modem_driver he910_driver = { .enable = he910_enable, .disable = he910_disable, .pre_sim = he910_pre_sim, + .set_online = he910_set_online, .post_online = he910_post_online, }; -- 1.9.1