Patch Description
cover Patch Description
I just got a new Option modem (iCON 452), and this patch is to enable several atoms for it.
The stk support is still not avaiable, for I couldn't find any appropriate manual for this part. If you happen to know this, please kindly share the info.
Yang Gu (1):
Enable some atoms for hso modem
plugins/hso.c | 34 ++++++++++++++++++++++++++++++++-- 1 files changed, 32 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.2.3
PATCH 1/1 Enable some atoms for hso modem
--- plugins/hso.c | 34 ++++++++++++++++++++++++++++++++-- 1 files changed, 32 insertions(+), 2 deletions(-)
plugins/hso.c +32 -2
@@ -34,14 +34,23 @@#define OFONO_API_SUBJECT_TO_CHANGE #include <ofono/plugin.h> #include <ofono/modem.h> +#include <ofono/call-barring.h> +#include <ofono/call-forwarding.h> +#include <ofono/call-meter.h> +#include <ofono/call-settings.h> +#include <ofono/call-volume.h> #include <ofono/devinfo.h> +#include <ofono/message-waiting.h> #include <ofono/netreg.h> +#include <ofono/phonebook.h> #include <ofono/sim.h> #include <ofono/cbs.h> #include <ofono/sms.h> +#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/gprs.h> #include <ofono/gprs-context.h> +#include <ofono/voicecall.h> #include <ofono/radio-settings.h> #include <ofono/log.h>
@@ -257,24 +266,40 @@ static void hso_pre_sim(struct ofono_modem *modem)ofono_devinfo_create (modem,0 ,"atmodem" , data->control); sim =ofono_sim_create (modem,OFONO_VENDOR_OPTION_HSO ,"atmodem" , data->control); +ofono_voicecall_create (modem,0 ,"atmodem" , data->app);if (sim)ofono_sim_inserted_notify (sim, TRUE); } + +static void hso_post_sim (struct ofono_modem *modem) +{ +struct hso_data *data =ofono_modem_get_data (modem); + +DBG ("%p" , modem); + +ofono_phonebook_create (modem,0 ,"atmodem" , data->app); +} +static void hso_post_online (struct ofono_modem *modem) {struct hso_data *data =ofono_modem_get_data (modem); +struct ofono_message_waiting *mw;struct ofono_gprs *gprs;struct ofono_gprs_context *gc;DBG ("%p" , modem); +ofono_call_forwarding_create (modem,0 ,"atmodem" , data->app); +ofono_call_settings_create (modem,0 ,"atmodem" , data->app);ofono_netreg_create (modem,OFONO_VENDOR_OPTION_HSO ,"atmodem" , data->app); - +ofono_call_meter_create (modem,0 ,"atmodem" , data->app); +ofono_call_barring_create (modem,0 ,"atmodem" , data->app); +ofono_ssn_create (modem,0 ,"atmodem" , data->app); +ofono_call_volume_create (modem,0 ,"atmodem" , data->app);ofono_radio_settings_create (modem,0 ,"hsomodem" , data->app); -ofono_sms_create (modem,OFONO_VENDOR_OPTION_HSO ,"atmodem" , data->app);ofono_cbs_create (modem,OFONO_VENDOR_QUALCOMM_MSM ,"atmodem" , data->app);
@@ -286,6 +311,10 @@ static void hso_post_online(struct ofono_modem *modem)if (gprs && gc)ofono_gprs_add_context (gprs, gc); + + mw =ofono_message_waiting_create (modem); +if (mw) +ofono_message_waiting_register (mw); }static struct ofono_modem_driver hso_driver = {
@@ -296,6 +325,7 @@ static struct ofono_modem_driver hso_driver = { .disable = hso_disable, .set_online = hso_set_online, .pre_sim = hso_pre_sim, + .post_sim = hso_post_sim, .post_online = hso_post_online, };
Signature · 1 line
1.7.2.3
Re: [PATCH 1/1] Enable some atoms for hso modem
Hi Yang,
Quoted 41 lines
plugins/hso.c | 34 ++++++++++++++++++++++++++++++++-- 1 files changed, 32 insertions(+), 2 deletions(-)plugins/hso.c +10
-0@@ -34,14 +34,23 @@#define OFONO_API_SUBJECT_TO_CHANGE #include <ofono/plugin.h> #include <ofono/modem.h> +#include <ofono/call-barring.h> +#include <ofono/call-forwarding.h> +#include <ofono/call-meter.h> +#include <ofono/call-settings.h> +#include <ofono/call-volume.h> #include <ofono/devinfo.h> +#include <ofono/message-waiting.h> #include <ofono/netreg.h> +#include <ofono/phonebook.h> #include <ofono/sim.h> #include <ofono/cbs.h> #include <ofono/sms.h> +#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/gprs.h> #include <ofono/gprs-context.h> +#include <ofono/voicecall.h> #include <ofono/radio-settings.h> #include <ofono/log.h> @@ -257,24 +266,40 @@ static void hso_pre_sim(struct ofono_modem *modem)ofono_devinfo_create (modem,0 ,"atmodem" , data->control); sim =ofono_sim_create (modem,OFONO_VENDOR_OPTION_HSO ,"atmodem" , data->control); +ofono_voicecall_create (modem,0 ,"atmodem" , data->app);if (sim)ofono_sim_inserted_notify (sim, TRUE); }
plugins/hso.c static void hso_pre_sim(struct ofono_modem *modem) · line 284
Quoted 10 lines
plugins/hso.c +10
-0+ +static void hso_post_sim (struct ofono_modem *modem) +{ +struct hso_data *data =ofono_modem_get_data (modem); + +DBG ("%p" , modem); + +ofono_phonebook_create (modem,0 ,"atmodem" , data->app); +} +
this part is fine with me.
However why should we enable any kind of voice call support for this modem? It is a data dongle and until you tell me that the voice is routed to the host PC via USB or some external microphone, it makes no sense to enable these parts.
If they are data only dongle, I prefer to leave them like that.
Regards
Marcel
Re: [PATCH 1/1] Enable some atoms for hso modem
In reply to Yang GuHi Yang,
plugins/hso.c static void hso_pre_sim(struct ofono_modem *modem) · line 270
Quoted 6 lines
plugins/hso.c +1
-0@@ -257,24 +266,40 @@ static void hso_pre_sim(struct ofono_modem *modem)ofono_devinfo_create (modem,0 ,"atmodem" , data->control); sim =ofono_sim_create (modem,OFONO_VENDOR_OPTION_HSO ,"atmodem" , data->control); +ofono_voicecall_create (modem,0 ,"atmodem" , data->app);
The Option hardware can never do audio, so enabling voice functionality is not a good idea.
Quoted 4 lines
plugins/hso.c +0
-0if (sim)ofono_sim_inserted_notify (sim, TRUE); }
plugins/hso.c static void hso_pre_sim(struct ofono_modem *modem) · line 284
Quoted 10 lines
plugins/hso.c +10
-0+ +static void hso_post_sim (struct ofono_modem *modem) +{ +struct hso_data *data =ofono_modem_get_data (modem); + +DBG ("%p" , modem); + +ofono_phonebook_create (modem,0 ,"atmodem" , data->app); +} +
This is OK
Quoted 24 lines
plugins/hso.c +7
-2static void hso_post_online (struct ofono_modem *modem) {struct hso_data *data =ofono_modem_get_data (modem); +struct ofono_message_waiting *mw;struct ofono_gprs *gprs;struct ofono_gprs_context *gc;DBG ("%p" , modem); +ofono_call_forwarding_create (modem,0 ,"atmodem" , data->app); +ofono_call_settings_create (modem,0 ,"atmodem" , data->app);ofono_netreg_create (modem,OFONO_VENDOR_OPTION_HSO ,"atmodem" , data->app); - +ofono_call_meter_create (modem,0 ,"atmodem" , data->app); +ofono_call_barring_create (modem,0 ,"atmodem" , data->app); +ofono_ssn_create (modem,0 ,"atmodem" , data->app); +ofono_call_volume_create (modem,0 ,"atmodem" , data->app);ofono_radio_settings_create (modem,0 ,"hsomodem" , data->app); -ofono_sms_create (modem,OFONO_VENDOR_OPTION_HSO ,"atmodem" , data->app);ofono_cbs_create (modem,OFONO_VENDOR_QUALCOMM_MSM ,"atmodem" , data->app);
plugins/hso.c static void hso_post_online(struct ofono_modem *modem) · line 317
Quoted 7 lines
plugins/hso.c +4
-0@@ -286,6 +311,10 @@ static void hso_post_online(struct ofono_modem *modem)if (gprs && gc)ofono_gprs_add_context (gprs, gc); + + mw =ofono_message_waiting_create (modem); +if (mw) +ofono_message_waiting_register (mw);
Same thing here, since voicecalls are not enabled, all the call-* related atoms are not needed.
Regards,
-Denis
Gu
RE: [PATCH 1/1] Enable some atoms for hso modem
Hi Denis and Marcel,
Quoted 4 lines
Quoted 4 lines
plugins/hso.c +4
-0+ +static void hso_post_sim (struct ofono_modem *modem) +{ +struct hso_data *data =ofono_modem_get_data (modem);
Quoted 8 lines
plugins/hso.c static void hso_pre_sim(struct ofono_modem *modem) · line 284
Quoted 6 lines
plugins/hso.c +6
-0+ +DBG ("%p" , modem); + +ofono_phonebook_create (modem,0 ,"atmodem" , data->app); +} +This is OK
So I will send the patch to enable phonebook only:)
Regards,
-Yang