Hi Guillaume,

> >> Change log from v4:
> >>    - Check if modem name is sent by oFono
> >>    - CDMA modem name is used as network name
> >>    - Change modem_data property from is_cdma into has_cdma
> >>
> >>   plugins/ofono.c |  156 
> >> +++++++++++++++++++++++++++++++++++++++++++++++++++++--
> >>   1 files changed, 151 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/plugins/ofono.c b/plugins/ofono.c
> >> index 8650bfc..88a1781 100644
> >> --- a/plugins/ofono.c
> >> +++ b/plugins/ofono.c
> >> @@ -50,6 +50,7 @@
> >>   #define OFONO_CONTEXT_INTERFACE          OFONO_SERVICE 
> >> ".ConnectionContext"
> >>   #define OFONO_SIM_INTERFACE              OFONO_SERVICE ".SimManager"
> >>   #define OFONO_REGISTRATION_INTERFACE     OFONO_SERVICE 
> >> ".NetworkRegistration"
> >> +#define OFONO_CDMA_INTERFACE              OFONO_SERVICE 
> >> ".cdma.ConnectionManager"
> >>
> >>   #define PROPERTY_CHANGED         "PropertyChanged"
> >>   #define GET_PROPERTIES                   "GetProperties"
> >> @@ -76,6 +77,7 @@ struct modem_data {
> >>    gboolean has_sim;
> >>    gboolean has_reg;
> >>    gboolean has_gprs;
> >> +  gboolean has_cdma;
> >>    gboolean available;
> >>    gboolean pending_online;
> >>    dbus_bool_t requested_online;
> >> @@ -337,6 +339,7 @@ static struct connman_device_driver modem_driver = {
> >>
> >>   static void remove_device_networks(struct connman_device *device)
> >>   {
> >> +  struct modem_data *modem = connman_device_get_data(device);
> >>    GHashTableIter iter;
> >>    gpointer key, value;
> >>    GSList *info_list = NULL;
> >> @@ -362,6 +365,11 @@ static void remove_device_networks(struct 
> >> connman_device *device)
> >>            connman_device_remove_network(device, info->network);
> >>    }
> >>
> >> +  if (modem->has_cdma == TRUE) {
> >> +          g_hash_table_remove(network_hash, "/context1");
> >> +          modem->has_cdma = FALSE;
> >> +  }
> >> +
> >>    g_slist_free(info_list);
> >>   }
> > I do not like this "/context1" stuff at all. What is wrong with just
> > using the modem object path that you get from oFono here. I do not
> > remember that devices and networks have to have distinct object paths. I
> > think that limitation is gone since a long time.
> The drawback of this solution is:
> When you need to save APN Username and Password that you entered, if you 
> use the
> "/default/profile/cellular_IMEI_modem_path" path to save them for cdma, 
> when you will
> plug/unplug the modem multiple times, your modem name will increase from 
> cdma0 to
> cdma5...
> Then you will create multiple references to the same configuration but 
> you won't be able
> to find again the APN Username and Password.
> What would you suggest to be used as key to save APN Username Password then?

the /context1 is not going to work either way. Once you attach a second
CDMA modem, everything will fall apart. The network_hash is a global
variable.

Also saving username + password inside ConnMan is wrong and not going to
happen. Saving it inside the UI is even more wrong since that is not an
UI detail in the first place. The only right place to save the username
and password setting is inside oFono. Please go and fix it there.

For GSM this is done exactly the same way. oFono keeps all the settings
and then it does not matter what the object path might be in ConnMan.

Regards

Marcel


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to